Tuto tiny-ecs beatemup Part 4 LevelX
the levelX.lua file
This is where all the fun takes place!
The transitions Class controls all scenes transitions. It plays an essential role in the flow of the game. I put the code here in case it is different from the Gideros Game Template1.
The code:
transitions.lua Code comments
The transitions Class takes 1 argument, that is the next scene to be loaded.
There is one MovieClip which plays a fade animation. Feel free to change it to anything you like or change the duration of the clip.
When the fading animation is done, all the previous Sprites and their eventual listeners are removed from memory and the new scene is added to the stage.
The menu.lua file is the same as the one in Gideros Game Template1. We add some buttons to our menu you can navigate with the mouse and the keyboard.
The code:
main.lua Code comments
The only thing I could say is calling the self:updateButtons() function asynchronously so we let the menu fully load before calling an update on the buttons.
the options.lua file
This is the longest file of them and it should be similar to the one in the Gideros Game Template1. Here we implement the key remapping system and we save the user's preferences to file.
The code:
options.lua Code comments
The code uses other Classes like aslider.lua, buttonMonster.lua, ... so make sure you have them (in the classes folder).
Maybe the names on the buttons are different from the Game Template1, other than that all should be good?
Next?
We quickly went through what is already in the Gideros Game Template1 tutorial. The next part is really where this beat'em up tutorial begins: the LevelX scene...
Prev.: Tuto tiny-ecs beatemup Part 3 transitions menu options
Next: Tuto tiny-ecs beatemup Part 5 XXX