I haen’t had a chance to play the game yet but I am really interested in the framework you are putting together. Well done on thinking beyond just writing the game!
It seems that your code has memory leaks.
Specifically you never delete the object or scene arrays that you allocate,
so the objects allocated here and here are never cleaned up, you just overwrite the old pointer and the previous array remains on the heap, never being cleaned up.
Hi Filmote, thanks for your kind word
Try it, hope you like the game.
Ah, thanks for point that out.
I’ll fix it in the near future (hopefully )
Don’t know that someone from Indonesia also developing game for arduboy, Gonna try this tonight. Salam kenal mas @madya121
I made a fork that fixes the leaks and gives
ArduEngine a proper destructor.
Let me know if you want me to make a pull request.
There’s a lot of places where you’re using dynamic allocation unnecessarily so the RAM usage reported by the IDE won’t be accurate.
Also although the state-based engine is a good idea, some of the features use more memory than necessary so it wouldn’t be suitable for a larger game, like giving the text object a 64 char byte buffer instead of a char pointer.
That said, it’s still nice to see someone trying to use a class-oriented approach to Arduboy games instead of a C-like approach, and it’s an interesting game.
Yes, please do. Thank you very much for that!
There’s lots of “At least it works first, I’ll come back to it later” kind of stuff in the code . But thanks! I learn something new from your feedback.
Hi @Hendra. I thought I was alone
Nice to e-meet you too (Salam kenal juga )
I’ve made a PR.
If there’s anything you’d like me to explain, then feel free to ask.
(e.g. why the leaks were happening, how my changes fix the leaks, what a destructor is, how to avoid dynamic allocation etc.)
I see you also live in the same city as I do, care to do a meetup around Tangerang? I already sent you a friend request at facebook.
Btw the game need a lot of focus to play, great game for memory training
Thanks! I already merge your PR.
After see your PR and read some resources, everything is clear. Thanks @Pharap
Thanks for try the game
I think it would be hard to find the right time to meet since I’m currently living in Singapore