-Thank you-
Edited by Chronic, 28 May 2012 - 02:05 AM.
Posted 27 May 2012 - 06:58 PM
Edited by Chronic, 28 May 2012 - 02:05 AM.
Posted 27 May 2012 - 07:05 PM
I have these 3 "Buttons" that you can move between with the arrow keys. And when you press enter on the corresponding buttons you go to 3 different rooms depending on what button you are on. Well it is not working, and I was wondering if you guys had any like code ideas to do something like this. Here is the code I tried and when I pressed right it skipped the medium button, and it wouldn't go to the room I wanted it to when I pressed enter. So what is a good way to do this? Here is the code I used:
Keyboard Event for Key Enter:
execute code:
if place_meeting(48,224,obj_easy_difficulty)
{
room_goto(Survival_easy_room)
}
execute code:
if place_meeting(208,224,obj_medium_difficulty)
{
room_goto(Survival_room)
}
execute code:
if place_meeting(368,224,obj_hard_difficulty)
{
room_goto(Survival_hard_room)
}
Key Release Event for Key Left:
execute code:
if x=208
{
x=48
y=224
}
execute code:
if x=368
{
x=208
y=224
}
Key Release Event for Key Right:
execute code:
if x=48
{
x=208
y=224
}
execute code:
if x=208
{
x=368
y=224
}
That was copied out of the Show Information Button within the object.
-Thank you-
Posted 27 May 2012 - 07:11 PM
Posted 27 May 2012 - 07:53 PM
Posted 27 May 2012 - 08:05 PM
Posted 27 May 2012 - 08:12 PM
Posted 27 May 2012 - 08:23 PM
//this goes in the step event
if (keyboard_check_pressed(vk_left)) //mostly to move between buttons, select = 0 is easy, select = 1 is medium, select = 2 is hard
{
global.select -= 1;
}
else if (keyboard_check_pressed(vk_right))
{
global.select += 1;
};
if (global.select < 0) //if you have gone to far bellow
{
global.select = 2;
}
else if (global.select > 2) //or to high
{
global.select = 0;
};
if (keyboard_check_pressed(vk_enter)) //when you press enter you'll go to it
{
if (global.select == 0) //checks to see if it is selecting the easy button
{
room_goto(easy_room_level); //please change the room name
}
else if (global.select == 1) //ect...
{
room_goto(medium_room_level);
}
else if (global.select == 2) //more ect...
{
room_goto(hard_room_level);
}
}
Edited by creators124, 27 May 2012 - 09:52 PM.
Posted 27 May 2012 - 08:35 PM
Posted 27 May 2012 - 08:48 PM
Posted 27 May 2012 - 09:55 PM
you're welcome!I tried creators124's way and it worked. Thank you Jake Armstrong and creators124 for your guy's help. This topic is solved.
0 members, 0 guests, 0 anonymous users