TnTank - Don't Get Blown by TNT

Hi, everyone

Finally, we managed to finish TnTank. @GoateeRP did the sprite, and I did the code stuff.

Source code: https://github.com/madya121/TNTANK
Hex file: https://github.com/madya121/TNTANK/releases/download/v2.0/TNTANK.ino.leonardo.hex

If you’re interested about how TnTank was created, you can read this post: https://medium.com/@madya121/tntank-how-i-create-a-game-using-arduengine-ed9361cc6528

Cheers :slight_smile:

8 Likes

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.

1 Like

Hi Filmote, thanks for your kind word :slight_smile:

Try it, hope you like the game.

Ah, thanks for point that out.

I’ll fix it in the near future (hopefully :sweat:)

1 Like

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 :laughing:. But thanks! I learn something new from your feedback.

1 Like

Hi @Hendra. I thought I was alone :laughing:

Nice to e-meet you too (Salam kenal juga :smile: )

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 :smile:

1 Like

Thanks for try the game :smiley:

I think it would be hard to find the right time to meet since I’m currently living in Singapore :disappointed: