New Blocks On The Kid

I agree! I was expecting a little more in terms of difficulty, but looks great!

I mean it’s part of the theme!

And my mom loved playing this game!

That doesn’t mean it can’t get harder as the game progresses, so that it becomes a challenge for better players.


It also doesn’t not mean it can’t

1 Like

High score:

Actually, I do have a couple programming question for @pharap and @MLXXXp or anyone else

In the particles.h file I’m using this-> with all the variables, but is this necessary? I’m asking because it was just there in the example that @filmote gave me but I just kept using it. But also during development a few times I forgot to add it and it seemed to work just fine.

Furthermore, is it possible and if it is how would I code it so that I can treat particles[] like this:

particles[i].x += 2;

instead of what I’m doing now:

int x = particles[i].getX();
particles[i].setX( x + 2 );
1 Like

this-> is usually not necessary. The class can usually determine that something belongs to it. The Arduboy2 library only has this-> in one function, and that’s only because I didn’t write it and haven’t bothered to remove them. (Maybe I’ll do it for the upcoming release).

Just make x, etc., public instead of private (move them to be under a public: declaration).

Edit: I just removed every occurrence of this-> in particle.h. The code compiled and the resulting .hex file was identical to the original.

Edit 2:

Even without making Particle::x public, you could simplify the above to:

particles[i].setX(particles[i].getX() + 2);
1 Like

Well, sure, but I’m just keeping track of variables so there is no reason to use functions. in almost all cases.

This guy gets it:

ALSO: I had actually thought of preloading an array of part drops that would look random but would guarantee that you never actually lose the game if all you did was press down or did nothing. So, you could only actually lose if you pressed right or left.

True but using this-> is a good habit to get into as it makes it clear to the user that we are referring to a member variable rather than a local one.

Obviously, in the sample below it is necessary:

uint8_t x;

void setX(uint8_t x) {
  this->x = x;

Of course this is a super trivial example and you could rename the parameter from x to something else, such a newX or even val.

That’s akin to removing comments in my book. I find the use of this-> makes the code more readable.

[Sits back and waits for reaction …]

1 Like

6 posts were split to a new topic: Is using this-> and typing code extra work?

There have been quite a few comments about how good this game looks, and I agree.

I’d like to point out to those who didn’t realise it or didn’t think about it; this game uses only the basic pixel, line, rectangle and text drawing functions of the Arduboy2 library. No sprites or other fancy stuff.

It shows what can be done using just simple shapes! :clap:

That was kind of the intention of the code size part of the jam, although I didn’t do much else to attempt a small flash footprint.

1 Like

Yes, competition was hard for this jam…