I am using gideros for quite some time now but I still have difficulties structuring a game. Although I have published several games in the playstore, I am still doubtful if my code is enough or sort of hackish. I am a lone coder, I have no friends that I can talk about programming. So I will upload some my code here that I think enough to explain my coding style. I need a feedback about my code (Dos and Donts). Thanks
Comments
- I like your init file
- I didn't like your extractFrames being in its own file, I would put it at the top of the main.lua as a private function
- I would put the punk spritesheets in a folder images/punk/
- I would rename some variables like idle_frames to player_idle or something like this
- player:setAnchorPoint(0.2, 0.5) works better imho
In conclusion your code runs just fine, you are using event listeners quite a bit and it is a bit complicated but that works.
You are on the right track, you will find other ways to organise your code (make your player and other monsters inherit a base class, ...) that will come with time.
PS: there is these functions to animate your sprite https://wiki.gideros.rocks/index.php/Animated_Sprite_Factory
Good luck with your projects
The project is the same, I accidentally uploaded twice but I can't delete the duplicate because of website error.
Does excessive use of event listeners have effect in overall performance?
Likes: MoKaLux
Your animation system seems to be a bit complicated imho but you have full control over your animations which is cool.
Likes: MoKaLux