For the past few years, while working on a variety of projects, I've started developing a suite of reusable code that I'm now working on cleaning, documenting and packing into a neat engine that will be available for everyone to buy on itch.io. I call it the MEGA Engine, mostly because it started as a Mega Man fan project.
It has many features like tile based collisions, a camera system, a state machine implementation and many more.
On of my favorite feature though is the animation management system. You can create an animation preset by defining a start and end frame, playing speed, looping it or not, give it a name and then just call it with a call to play("anim_name")" and that's it! The object plays the animation as defined (using the selected sprite) until it is changed.
The state machine is also robust and allow for easily writing actions in a sequence so it makes writing complex cutscenes very manageable. Speaking of cutscenes, the engine also features a simple dialog system so not only can you manage sequence of actions and animations but you can also insert dialogs.

Quick example of the dialog in action
Below is what the code to create the animation above looks like. See the "state_" calls? All functions that start with "state_" in MEGA engine are played in sequence. So you don't have to worry about complicated nested "if then" to make things happen in the order you want, you just write things in the order you want them to happen and voilà!

I'll end this post with one last handy feature, which is the screen management system. Screen objects are simply dropped in your rooms and the camera will respect the bounds of whichever "screen" it finds itself in until the hero touches one of the border of that screen. The camera will then proceed to transition to the next screen in the direction the player is going, moving the hero accordingly to have him fully move into the new screen.

For the sake of keeping this post short, I'll end this here! I'll try to post more information about MEGA Engine soon and I expect to release a beta version before the end of January 2025.
Cheers all and keep on deving!
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.