Possible Bug - Game works when it is played outside of the merged games

[When my frog touches my fly the program seems to break. The animations ‘bleed’ and the y location stop points stop working. As long as my frog does not touch my fly, frog jumps and responds normally. Ugh! Please help - suggestions.]

Link to the project or level: [https://studio.code.org/projects/gamelab/pa5aVNmnizfUlHaEpS1VfvK3ee88HpLZ9gJDYOuBf7M]
What I expect to happen: [Frog to hop up with the space bar and fall down once he reaches 100y and stops at 350y. I expect frog to touch fly and points are awarded and fly reset location.]
What actually happens: [Frog jumps with the space bar and stops at 100y and 350y as long as it does not touch the fly. When frog touches the fly, frog controls are lost, and fly and frog animation ‘bleed’.]

@melodi_kunn,

Your error is in line 86. The game doesn’t know what to do if the score is between 1 and 4. It only knows what to do if the score is 0 or 5.

Hope this helps!

Mike

Yes - that confirms my other post “I think it is my math.”
How do I write if score is between 0 and 5? I have tried
if score<1 && score<6 but that gives me the same error.

We are trying to combine our three games into 1.

Also, do you think I should use separate if scores, or the if else? I had separate, but this morning I thought maybe it made more sense to say if this then that OR else not that but this.

Thank you for any help you can give me. We are hopefully going to attempt this on Tuesday :crossed_fingers:.
Melodi

How about if 0 < score < 6...

That seems to work when I try it. Also, if else tends to be a little more concise …

if score > 10, ... else if score > 6..., else … etc.

Mike

1 Like

Another thing that may be more simple is just …

If score > 0, hopper…
If score > 5, flyer

etc. Not sure you need the upper limit, but I don’t know your game as well as you do, so maybe there are things you are disabling at the upper limit.

Mike