SuperPong - Tutorial Remix

A new take on the classic pong. Following @crait 's tutorials and adding a nice twist with music, graphics and more features, the version of pong is definitely worth a try!

4 Likes

Got any pics? :smile:

2 Likes

The arduboy library is depreciated and is no longer reccomended. Migrate your game to Arduboy2 and you can use a useful function called justPressed() which negates the need for a pressed variable.

Plus, you can switch all those ints to uint8_t as long as you include <stdint.h>. If your number is negative use int8_t.

Also, your gamestates could be changed to a scoped enumeration but i think thats a little complex at the moment.

Update those tutorials @crait ! I have a text file with those first 2 sentences because newbies think int is the only way!

This will require using the ArduboyPlaytune library for sounds, as well, but it’s not a difficult change.

No include is necessary to use the stdint types. The Arduino environment does this for you.

1 Like

This will require using the ArduboyPlaytune library for sounds, as well, but it’s not a difficult change.

Ive always used arduboytones, is that ok?

No include is necessary to use the stdint types. The Arduino environment does this for you\

For some reason it does not work on my version of arduino. Not really sure why.

And for some reason i dont need it anymore…what

It’s because you use .h and .cpp files, and those do need #include <stdint.h> under certain circumstances.

Only .ino files have stdint.h auto-included due to the weird way .ino files are handled.

In this case there’s just one .ino file so it isn’t needed.

But only now i dont need it anymore…what

arduino is drunk

Yes, it’s fine. The reason I recommended ArduboyPlaytune here is because SuperPong is using the sound functions in the Arduboy library. Switching to ArduboyPlaytune with Arduboy2 takes the least amount of effort.

Hi peeps. This was created by my 13 year old son, following @crait ‘s tutorials with no prior coding knowledge. There was a great deal of code and post searching before he figured out how to add music and title screens.

I’m afraid that most of what you guys are talking about here is just gibberish to us. :disappointed:. Is there some place that advises when certain things are out of date and need replacing with new things? Some of this is a little overwhelming for complete noobs!

4 Likes

The first paragraph of the first part of the tutorial you followed is the following:

NOTE: This tutorial series is a bit outdated. It uses the older Arduboy library, which is no longer being maintained. If you’re developing your own game, it’s recommended that you use the Arduboy2 library. For the most part this just means changing Arduboy to Arduboy2 in a few places at the start of the code.

1 Like

Hi Scott. Being completely new to programming we didn’t know what that meant so just continued with the tutorial as is. It all worked so it’s all good. What is the benefit of changing to the new version of whatever that is?

2 Likes

As the note says, the original Arduboy library is no longer being maintained. It doesn’t have any of the new features or other advantages that are in the Arduboy2 library. For example, one advantage has been previously mentioned:

Another advantage is that Arduboy2 has been continually optimised, so that some of the functions it provides use less program memory. This leaves more space available to add features to your game.

I’ve taken a few minutes and changed SuperPong to use the Arduboy2 and ArduboyPlaytune libraries. I’ve created a pull request for your GitHub repository, so you can examine and merge these changes, if you wish.

2 Likes

Yeah, updating those tutorials are on my to-do list for this month, as well. :stuck_out_tongue:

4 Likes

Don’t worry too much about the influx of advice.
Sometimes people are a bit overzealous to give suggestions for improvements.
It is meant in good faith.

I don’t disagree with the advice, but I think for a first attempt this game is very good even without the suggested changes.

Wow, thanks! My son is already all over this.

2 Likes

Yeah, I guessed that. :wink:
Tbh, I’m impressed that my son has stayed so interested in this. I think it’s a brilliant little device.
Thanks to everyone in here for your help and advice.

2 Likes