(SOLVED) Game logic conflict

Hello Devs,

I have some sort of conflict, that I can’t figure out. I know the issue is with the Logic.

  • I’m trying to make a catcher game.
  • Green balls bounce around and player has to catch them.
    I have a textbox in Delta… which counts up to 10 (based on ballcount var) but I’m not sure how to resolve?

ballcount is restricted to 10 balls. I have tried to play with this without success.

I will keep chipping away until help comes…
Thanks,
Roberto

Seems to be working now BUT, it’s a little intermittent. If I restart the game, sometimes it doesn’t work… which means something else is happening?

I think I figured out the issue… The Random(10) was causing conflict.

image

NOPE - The issue REMAINS :frowning:

There’s the condition ‘number of instances on the scene’ if you want to maintain 10 balls.

…if i remember wel In GDevelop, you do need to start the timer first before using it in a condition like `timer < random(10) seconds…Otherwise, the timer doesn’t exist

Putting the random() expression in the timer condition will usually result in the timer triggering almost immediately. It’s best to save the random number in a variable and choose a new number when the timer triggers or some other time.

A new random number will be picked on each frame and with 60 frames a second. It will usually pick a number lower than the current time. It’s like trying to guess a number by shouting out numbers really quickly. It won’t take long to guess the correct number.

Also, if there’s a chance that more than 1 object can collide with the core then instead of subtracting 1,you could subtract the number of selected instances. Otherwise, it could subtract 1 instead of 2.

Or skip the variable and check how many balls are in the scene.

Thanks everyone for your help. I’ve managed to get it to a sweet place now. This ticket can be RESOLVED.

3 Likes