LoveRush - Cute Infinite Shooter


(Stephane C) #1

A cute infinite shooter for Arduboy dedicated to my wife.

It’s my first project for arduboy, so i tried to keep everything simple.
You need to get all the hearts you can while avoiding the falling angry faces.
Let’s see the scores you guys can get!

ArduboyRecording-4

Game Features:

• Parralax scrolling
• HighScore saving (with a way to reset it by pressing B on title screen)
• Cute hearts all over the screen!
• Press A to shoot
• Press B to pause the game
• Catching heart gives you 5pts
• Shooting a heart is -10pts
• You get 1 shield back for every 15 hearts you catch
• Shooting angry faces gives you 10pts
• A collision with an angry face is -1 shield (you have 4 shields total at the start)
• Collision with enemies makes the red LED flash briefly
• Speed is going up after a certain amount of points and warn you by a green LED flashing once

Special thanks to @filmote and @Pharap for all the help i got from them to learn faster.
And my wife for putting up with me talking about arduboy coding all the time.


(Alex) #2

Very cute! I love how you made it as a gift for your wife.


(Felipe Manga) #3

Certainly is cute!
Horizontal movement feels a bit slow, compared to the other things wizzing by.
ArduboyRecording%20(9)


(Stephane C) #4

True, it’s almost a built-in difficulty thing. i already think the game might be too easy, my HighScore so far is 1200pts and i am sure i can do even more. Plans for future release was to make 2 other levels that are harder every 500pts but i had to stop at some point for now. Thanks for the gameplay clip!


(Felipe Manga) #5

I imagine a faster ship would make the game easier. It might be interesting if the ship was just a bit faster and the other things started off slow and got faster as the game progressed, so you’d have a difficulty curve.


(Stephane C) #6

Yes, i like that idea, just need to learn how to do it. When i started this project, i knew nothing at all about coding on the arduboy.

So basically i started with @crait tutorial’s about having a sprite on a background and move it. And then after that it was all like… What if i move the background instead of the player sprite?.. What if i move more then 1 background at the same time?.. What if they don’t move at the same speed so that what is closer scrolls faster?.. What if… etc… and then you have my first little game.

I got a lot of advices from @filmote and @Pharap as well. i can’t thank them enough for that.


(Felipe Manga) #7

Well, congratulations on a project completed!

If you want, one way of increasing the difficulty could be (I haven’t actually tested it):

// in the beginning...
int8_t speed=1;

// when updating
if( !(arduboy.frameCount%(10*60)) ){ // increase speed every 10 seconds, at 60 fps
 speed++; // increase by 1
}

enemy1y = enemy1y + speed; // add speed instead of 1.
hearty = hearty + speed*2;

(Holmes) #8

That is such an exciting feeling!! It’s a sign that someone really does understand what they’re doing! Glad to see this game come out so nice! I love the artwork!


(Stephane C) #9

Yeah i tried that and it does work but goes really fast too quickly, and i am not sure why but when you are game over and start a new game, with that in, the enemies are stuck to the top of the screen for a while…


(Felipe Manga) #10

Hmm… maybe that should be 30 * 60 instead of 10 * 60. Or something in between.

After a game over, do you set the speed back to 1? Sounds like you’re setting it to 0.


(Stephane C) #11

Release version 1.0.1 now available for download in initial post.

  • Added red led light flash when hit
  • Added speed increase every 40 seconds (it gets hard fast beware!)

(Pharap) #12

Seems we need another everyXFrames overload for uint16_t.

If you don’t mind me asking, why the ! and not == 0?
Seems a bit unintuitive.


(Stephane C) #13

Forgot to include the new sound effects… so here goes v1.0.2 … as usual updated release in initial post…


(Felipe Manga) #14

arduboy.frameCount%(10*60) is true/false in exactly the opposite circumstances as needed, so the intuitive thing for me is to simply negate that.


(Pharap) #15

arduboy.frameCount % (10 * 60) is a uint16_t, not a bool.
You have to force it to be implicitly converted to a bool, which is why I say it seems unintuitive.


(Felipe Manga) #16

I think I just see the zero as falsy, nonzero as truthy, and I don’t think about the cast.
This really gets on my nerves in Java. :stuck_out_tongue:


(Pharap) #17

‘truthy’ and ‘falsy’ are very JavaScripty terms.
I’m afraid I side with Java, C# and Haskell on this one,
being explicit leaves no room for misinterpretation or confusion.


(Felipe Manga) #18

While truthy/falsy can be a bit complicated in Javascript, I never thought they could be confusing with ints in C++.
What I do find confusing is if( 0 == something ).


(Simon) #19

Very cool. My high score is 65535! I do like the use of the LED as well.

In this code >

void initEEPROM() {
  char c1 = EEPROM.read(EEPROM_START_C1);
  char c2 = EEPROM.read(EEPROM_START_C2);

  highScore = 0;
  
  if (c1 != 'L' || c2 != 'Z') {
  EEPROM.update(EEPROM_START_C1, 'L');
  EEPROM.update(EEPROM_START_C2, 'Z');

  ----- here ----

  }
    else {
    EEPROM.get(EEPROM_STORAGE_SPACE_START, highScore);
    }
}

You should set the score and high-scores to 0.

Also,

  highScore = 0;

  ...

    else {
    EEPROM.get(EEPROM_STORAGE_SPACE_START, highScore);
    }

Doesn’t seem to do anything, you retrieve the score into a local variable but do not use it.


(Pharap) #20

It’s confusing because it’s an extra set of rules to remember.
Having to remember that:

  • bool(N) is equivalent to N != 0
  • !bool(N) is equivalent to N == 0
  • int(true) == 1
  • int(false) == 0
  • That bool(N) occurs during any of the following:
    • if(N)
    • while(N)
    • !N (unless ! is overloaded)
    • N && M
    • N || M
    • N ? A : B
    • static_assert(N, "");
    • noexcept(N)

And then there’s the safe bool problem.

All of which can be avoided by just being explicit and saying N != 0 or N == 0 depending on what is actually meant.
Anyone who can understand == and != can read those without needing to know all the implicit conversion rules.