Large Sprites for GB Studio 2.0

Add to
My games
Add to
Wishlist
Save to
Collection
No reviews
Exceptional
Meh
Skip

About

I shoehorned in a way to have larger sprites in GB Studio games. With the immense power granted by eject engine, I hacked together a function that checks a certain set of variables to determine if a sprite should be parented to another sprite, and if so, forces its position to be adjacent to it at all times. The parent sprite is free to move as a normal sprite, and all of its children will happily follow.

It's kludgy and hacky, probably really inefficient, and presumably prone to failure. But it's also really cool, so check it out!

If you wish to use it in your own game, and let me make it abundantly clear you are doing so at your own risk, these are the steps you should take:

  1. Eject the engine in your project, if you haven't already.
  2. Copy assets/engine/src/core/ParentedActors.c to the equivalent folder in your project directory
  3.  Do the same with assets/engine/include/ParentedActors.h
  4. Open assets/engine/src/core/Core_Main.c in a text editor
  5. Insert the line #include "ParentedActors.h" immediately after the line that says #include "main.h"
  6. Insert the line PositionParentedActors(); before the first line that says UpdateActors();
  7. Save the file

Now, when you run your game, it will take a little while to build the first time, but if the emulator opens, then you did everything right.

To actually make use of it, you will need to make an On Init script with two events. It will look something like this:

Variable: Set To Value has two fields, and both are important:

  • The variable field on top tells the game which actor should be the child. The variable ID should be the actor's number + 90. In this instance, I want Actor 3 to be the child, so I set it to $93$
  • The value field below tells the game which actor should be the parent. Here, it is set to 2, standing for actor 2. If you want the player to be the parent, set it to 10.

Variable: Add Flags has 8 checkboxes. Flags 5-8 tell the game where the child should be positioned relative to the parent. Flags 1-4 should be left unchecked.

  • Flag 5 sets the child to be left of the parent
  • Flag 6 sets the child to be up from the parent
  • Flag 7 sets the child to be down from the parent
  • Flag 8 sets the child to be right of the parent

They are in the same order as the Direction buttons for easy reference. 

If you did everything right, when you run the game, everything should just magically work. The child actor will follow the parent actor wherever it goes.

Note: I realized as I was typing this up that I didn't take into account the fact that GBS2.0 supports more than 9 actors. As a result, future updates to this patch will be incompatible with the current variable configuration.

Platforms
Release date
Developer
um3k
Age rating
Not rated

System requirements for Web

Read more...
Large Sprites for GB Studio 2.0 screenshot, image №2529965 - RAWG
Edit the game info
Last Modified: Sep 11, 2020

Where to buy

itch.io