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

[GM7/8] Analyzing the Sonic Dash Engine...


Recommended Posts

Okay, so I've been playing around with the Sonic Dash engine for GM7. It's great and solid, but overall it's still pretty confusing. I have only minimal experience with Game Maker and that's being generous, so it doesn't help that I'm confused.

My question is if there is any documentation on how to use the engine in general. For instance, I'm using a Sonic sprite with different animation frames, so where in the engine can I edit the values for the animations? Any help would be most appreciated. :)

Link to comment
Share on other sites

Well, there is no guide currently for that certain engine, all it requires is basic GML knowledge (and there are plenty of GML guides around). If you wanted to edit the animation's from when they start, end, and restart, then you would have to open up the character you want to edit, go to the "Create" tab, then the script containing the numbers/information should be the 2nd script in the right column.

  • Like 1
Link to comment
Share on other sites

It was hard for me to pick up on too. Just realize that everything is done in scripts and constants. So if for instance I type Action = consActionSpindash sonic will spin dash. To return Sonic to his normal mode you'd do Action = consActionNormal. Now the reason why this works is because in the step event under Action management you see

case consActionSpindash:

scrPlayerActionSpindash();

break;

So if Action = consActionSpinDash the spindash script will run. If you create any Actions of your own you'll have to create a script a constant such as consActionPeelout or whatever and you'll also add it to the manage actions.

Objects collisions work a similar way. In the player step event you will see an object handle code block. Look inside and you see a ton of scripts. Every step these scripts are checked to see if any of the objects need to be dealt with.

Most of the time objects matter to the player when you are in a collision. You don't want to use GM's built in collisions with Dash. Dash provides you with a bunch of collisions that do a much better job. scrPlayerCollisionLeft(Mask, Offset) and the like check for collisions with terrain in a particular direction. scrPlayerCollisionBottomObject(Mask, Offset, Object) and the like you can set an object to check if the player is colliding with it. The mask is the sprite used to check the collision you can see them all under the player sprites. Then I believe the masks are basically at the center of the Sonic sprite and using offset you can change that. With a bottom collision I believe that an off set of 1 makes the mask one pixel lower and an off set of -1 makes the mask one pixel higher, its the reverse for a top collision, and the same system transfers to left and right collisions as well. There is also scrPlayerPresiseCollisionCheck(x, y, Object) which checks collisions next to Sonic's actual sprite.

I'd also spend some time studying the variables in objPlayer's creation event. Most of them are self explained so I won't go into them.

I hope that helps some and good luck.

Link to comment
Share on other sites

Man, I was hoping I'd be a cool mentor and explain things to him, but I came, gave him little info, then you, Overbound, came in and basically killed the mood. XD I've never been good at tutorials and such, thanks for helping out. :)

Link to comment
Share on other sites

.ANIM files? I didn't even know those were there. :S I'm pretty sure they're useless space hogs, Because I don't have them and I can still run the engine. It took about 3 to finally understand GML, and I have been using GameMaker since I was 10 (about 5 years ago). Then, I realized how simple GML is. Like Overbound said, it's basically just scripts, constants, and variables.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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