• 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!

Trying to make a wave system using a "Start Round" Button.

E

Erizur

Guest
Hello Everyone, i was trying to make a wave system in GM8 Pro for a tower defense game. So i am using timelines and using a code in the sprites but i don't know how to make the start round button becomes green again after i click it.
everything works but i can't understand how to do that to press the start round again.
Objects:
obj_startround: the green start round button.
obj_startroundoff: the red start round button that you can't click.

Events of the objects:
for the green start round:
Set time line timeline_wave1
execute a piece of code:
Code:
if (timeline_running = true)
    {
    instance_change(obj_startroundoff,true)
    }
for the red start round:
Code:
if (timeline_running = false)
    {
    instance_change(obj_startround,true)
    }
please help me!
thanks.
 

StormGamez

Member
if you are spawning the enemies to a path off the screen with the time line then you can just do
Code:
if(!instance_exists(obj_enemy)) {
     instance_change(obj_startround,true);
}
that way once the player has killed all the enemies they can start the next round when they want

but i would also suggest making the start round button into one object and using a variable to turn it off and on e.g
Code:
//Create event
startround = true;
Code:
//draw event
if(startround) {
    draw_sprite(x,y,spr_button_green);
} else if(!startround) {
    draw_sprite(x,y,spr_button_red);
}
 
Top