O
OriginalGrim
Guest
I'm trying to make an inventory but I realized that when I put in a certain combination of inputs it completely throws off the math and results in option = things outside of 0-5 is there an easy way to fix this?
object = 0
maxobject = 4
step:
if keyboard_check_pressed(ord("S"))
option += 1;
else if keyboard_check_pressed(ord("W"))
option -= 1;
else if keyboard_check_pressed(ord("D"))
option += 2;
else if keyboard_check_pressed(ord("A"))
option -= 2;
if option < 0
option = maxoption;
else if option > maxoption
option = 0;
}
if keyboard_check_pressed(vk_enter)
{
switch option
{
//invetory
case 0:
break;
//equipment
case 1:
break;
//status
case 2:
break;
//synopsis
case 3:
break;
//save/load
case 4:
if instop = false {
instance_create_layer(view_xport[0] + 640, view_yport[0] + 73, "SLQ", obj_SLQ)
instop = true;
}
break;
//settings
case 5:
break;
}
}