Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

AeroGP's Worshop: Day 1 Synopsis


VectorSatyr

Recommended Posts

Sunday, I wanted to get everyone familiar with the technology we'll be using for today's and Wednesday's lectures. The Sonic Dash engine (not the SAGE game) is an easy to use template for creating a Sonic game in Game Maker. There isn't any radical support for it like there is Sonic Worlds. However, the inherint flexibility of Game Maker gives the engine a little more potential. Also, finite-state machines (explained by DW) are a little easier to manage here.

Basic interactions in Sonic Dash: Layering

"Layer" is a local variable used to determine possible collisions with the Player object (objPlayer). The player object can only collide with other objects on the same layer. If Layer is equal to 0, only objects with the text "Layer0" in their names can collide with it, while objects with the text "Layer1" will be ignored. Other objects without a "layer" will also be collided with, so it only affects objects that you designate to have a "layer".

There are 3 objects associated with changing the "Layer" variable within objPlayer. When objPlayer collides with them, the Layer variable is instantly changed. objEngineLayerChangeTo0 sets the layer to "0", and objEngineLayerChangeTo1 to "1".

objEngineLayerChangeToSwitch is used for the game's famous Loop-De-Loops. The Loop-De-Loop functions by setting a tile at Layer0 on the right side, a tile at Layer1 on the left side, and objEngineLayerChangeTo0 at the top middle of the loop. If the player hits objEngineLayerChangeTo0 going right, he will go to layer "1". If he hits the object going left, he'll go to layer "0". Thus, he'll come into the loop colliding with the right tile and passing the left, switch layers midway, come down by colliding on the left tile, and exit by passing the right tile.

The abillity to ignore collision came come in handy for specific objects. An example would be a floating object that can crush the enemy. Normally, that object would cause collision and push the player out of the way. But, if you set it as the child of a Layer1 object, where objPlayer is Layer0, it will completely pass the player, allowing you to set your own event in the case of a collision. (e.g. getting hurt instead of dying) You can even change the player's Layer instead of the object's, thus allowing you to move atop the object when it isn't trying to crush you.

Basic interactions in Sonic Dash: Rings

The interaction between a ring and the player is the simplest the engine has to offer. Rings are the life force of the player in Sonic the Hedgehog. When the player loses all of his rings, he loses a life. The ring merely has to increase the ring count when collided with, and then "dissapear". There are other, more complicated actions the ring can take (which will be discussed in today's lecture), but this is the only one at the moment that a ring has to do for the player.

Basic interactions in Sonic Dash: Item Boxes

Item boxes (Monitors) can have any kind of goodies inside. Since this is an engine, you get to decide what items the player can get from them. As far as interaction is concerned, there are plenty of ways the the player can manipulate an item box.

The basic interaction is simply "breaking" open the box by either jumping on top of it, landing on it while gliding (exclusive to Knuckles), spindashing into it from the side, or coming at it from the side while gliding, sliding, or attempting to climb/rise (exclusive to Knuckles).

Jumping on it simply means being in the "Jumping" state (part of the state machine DW discussed) and colliding with the item box from below. Also, the player checks if you, the user, was holding the Action key at the time to determine how strong of a "bounce" should occur from the item box. This check does not occur if you land on the box via gliding (and therefore, you are Knuckles).

For determining a collision from the side, the "Speed" of the player is what determines it. If "Speed" is positive, the player is going right, and if negative he is going left. The collision should only connect if you're comming at the item box from the correct side at the correct direction, so you can't break open the box if you're moving right, but you didn't hit the left side.

To give the player his powerup, the player passes his instance id to the item box object (objMonitorParent) it collided with, which then passes it on to a created objMonitorIcons in its destroyed. This is used so that objMonitorIcons knows who to give the powerup to, in case there is more than one objPlayer in the same room. This makes it possible for the partner character to get powerups - if only a collision were allowed! However, the flag "ComputerControlled == false" prevents the check from even occuring in the event that an objPlayer object is being run by the computer (meaning only a human partner can open the box).

Homework:

I did have at least one person to lecture, so I gave them an assignment. You can try it yourself to get accustomed to the engine:

The engine only has Monitor objects for "Eggman", "Big 10 Ring", and "Barrier" at the moment. Please create a "Life up" Monitor object that gives the player an extra life. The variable MonitorIcons (in objMonitorParent) is what determines the item a Monitor has, and global.Lives is used to determine how many lives the player has. Use debug mode (the red play button) to view the variable when testing.

Next, duplicate and edit your Life Up box so that the item character face changes depending on which character is in use. The character in use is determined by global.FirstCharacter. 1 = Sonic, 2 = Tails, and 3 = Knuckles. Note that the number for the item face of each character is the same, subtract 1.

Finally, make a "Random" Item box that can give any possible powerup availible at the moment (0-5). The item box should randomize every step.

Good luck, and thanks for reading! ~ AeroGP

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...