Hi, how do I make a game where you have to drag objects to a basket, but they have to be dragged in order (1,2,3,4, etc) for example, if you try to place the object that has the number 3 first, the game will not let you, and an error sound will be played, the game is completed if you place the amount of objects that comes out in the screen and do it in order, then you will receive a congratulations message, but if you do not finish before the time runs out , you will get a message that you failed.
Here are some images so you can understand better:
Give all your number objects the “draggable” behavior.
Assign all the number objects an instance variable named “value” with it’s numerical value.
Create a group called “Numbers” and add all of your number objects to that group.
Create a scene variable a called CurrentNumber with a default value of 1
Add a condition like this:
Box in Collision with ‘Numbers’
And two subconditions
- Numbers.value == Variable(CurrentNumber) => CurrentNumber++; Delete Numbers;
- Numbers.value != Variable(CurrentNumber) => Seperate objects (box will not move); play sad sound;
That should be enough to get you started… although it’s a bit much to ask “Please design my game”, so I’ll leave you to play around and figure out the timer elements.
Would it look like this? sorry if there is any mistake, I am new to this.
Close but you want to compare the object Numbers. value not the scene variable Numbers.value