• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help

P

Phemus

Guest
I want to make something below:

In first time there will be no object, after I press to number "1" object will appear and when I re-press to 1 object will change and contiune like this, when I press to 1 again object will change again to another one...
 

jo-thijs

Member
You can do this multiple ways.

For example, you could have an invisble empty object
with just a keyboard event for checking when the number 1 gets pressed.
When that gets pressed, you could use instance_change to change the empty object to the first object.
In the first object, you can do the same to change to the second object.
 
P

Phemus

Guest
Given the fact this is your 71st post, you should know better.
Read the forum guidelines: https://forum.yoyogames.com/index.php?threads/its-nice-to-be-nice.30/

As for your question; Did you follow _any_ tutorials or examples? A little thinking and use of a variable should solve this challenge.
I don't think I would post here before doing it.

You can do this multiple ways.

For example, you could have an invisble empty object
with just a keyboard event for checking when the number 1 gets pressed.
When that gets pressed, you could use instance_change to change the empty object to the first object.
In the first object, you can do the same to change to the second object.
Can you help me by give an example?
 

jo-thijs

Member
Empty object:
Keyboard pressed 1 key:
instance_change(object_1, true);

object_1:
...
Keyboard pressed 1 key:
intance_change(object_2, true);

object_2:
...

And put the empty object in your room.
 
P

Phemus

Guest
Empty object:
Keyboard pressed 1 key:
instance_change(object_1, true);

object_1:
...
Keyboard pressed 1 key:
intance_change(object_2, true);

object_2:
...

And put the empty object in your room.
I already tried it. It just shows last item when I press to 1.
 

jo-thijs

Member
My bad, set some variable canChange to false in the create event of every of those objects and set it to true in the end step event.
Only execute the keyboard event if this variable is true.
 
Top