FruitFalling game

How do I…

I am trying to create a fruit falling game. There was goinna be multiple fruit falling from the sky and into a basket to delete it. I copied this tutorial and did everything they did and I added “greater then 1 second” which was in the tutorial i did that but no apples came spawning. I then changed it to “less then 1 second” and multiple apples started spawing. so i was getting a variation of zero apples to 10000000 apples. How can i make it only one apple spawn out of the sky and how can i also spawn other fruits randomly. Can someone please help me and explain what I’ve done wrong and how I fix it?

This event:

Will only get actioned if the scene has just started, the timer (which doesn’t yet exist) is greater than 1 second and there are no apple objects in the scene. i.e., it won’t happen.

Instead, split that event into 2 separate events, both with the Start (or reset) the timer action. Have one event with just the beginning of scene condition, the second event with the other two conditions.

1 Like

Is there anyway you could show me a ss of that so I understand what you mean?

1 Like


I’m assuming @MrMen means to do this.

Edit: Never mind. He most likely means this:

1 Like


Like this? I clicked preview but it still doesnt fall

You need to have them next to each other, instead of the second one being a subevent. See how to 2nd event is indented? Make sure they are flat next to each other :smile:

Ohhhhh, Okay I will try it out

Nope, that’s a subevent. I never mentioned that.


Correct. Those are 2 separate events.

1 Like

It doesn’t really work but I’m rewatching the tutorial to see if i did anything wrong

What does this event do, what are you trying to achieve here?

Why are you picking a random apple and orange and chicken and banana and blueberry? Those conditions pick a random object that’s already in the scene. If there isn’t one of each of those objects, then the actions won’t be processed.

Are you trying to create a random fruit when the timer reaches 1 second? In that case, you need the apple object creation in the second event (or as a subevent off it) from this screen snip:

Maybe use this instead to generate replacement fruit:


BTW, Random(950) is the same as RandomInRange(0,950). Use RandomInRange when the first number isn’t 0.

OMG thank you I’m going to try that right now!

1 Like

Ok so it ended up falling but how do i make it fall like multiple times but one fruit at a time?? You know what I mean

Also how do I stop my fruit from following me when it falls like I just want one fruit to fall from the sky at random and I want to add a bomb so if you catch it in the basket game over or you loose points

I have changed my game coding around and right now only one fruit falls which is chicken and I can’t colelct it with the basket because it follows me everywhere I go. I was wondering to make more fruit drop 1 at a time and how to stop the fruit from following me?

My first thought was to choose a random fruit from an array but then I thought “why not add a fruit just outside of view and then every x seconds add force to one of them.”

Something like this.

IDKW the chicken is following you unless it has the platform behavior and the keys aren’t disabled for the behavior.

I decided to spawn the objects slightly away from the edges and -100 for the y.

Is this your work? Does it actually work for you if you did that?

Yes, I created this. It works for me. It creates an object out of view and then adds a force with the timer.

A more complicated version would use variables and maybe an array but this does the sane thing.

Are your fruits using any behaviors?

Yes it works thank you so much

1 Like