OnLashoc
Member
Ok Im a little confused what is going on here...
I have an image representing the size of the game and when the mouse is over the image, I want to be able to click the image which will change the image representing a different size. It's pretty simple looking but for some reason when I use the following code, it just stays on small if I have more than 2 sizes. See below:
So it starts on Small pre-selected. Move you mouse over the image and left click and it should change to Medium. If it's on Medium and you move your mouse over the new image that says Medium and you left click it should change to Large. If it's on Large and you move your mouse over the new image that says Large and you left click it should change to Small.
I'm sure there is a better way to write / accomplish this, but Im stuck on it not changing from Small. I've tried putting this in the Step event and then tried removing from Step event and adding a Left Pressed Event.
I have an image representing the size of the game and when the mouse is over the image, I want to be able to click the image which will change the image representing a different size. It's pretty simple looking but for some reason when I use the following code, it just stays on small if I have more than 2 sizes. See below:
Code:
if mouse_check_button_pressed(mb_left) && gameSize == 0 {
if collision_point(mouse_x, mouse_y, oChoice1, true, false)
{
gameSize = 1;
}
}
if gameSize == 1 && mouse_check_button_pressed(mb_left) {
if collision_point(mouse_x, mouse_y, oChoice1, true, false)
{
gameSize = 2;
}
}
if gameSize == 2 && mouse_check_button_pressed(mb_left) {
if collision_point(mouse_x, mouse_y, oChoice1, true, false)
{
gameSize = 0;
}
}
I'm sure there is a better way to write / accomplish this, but Im stuck on it not changing from Small. I've tried putting this in the Step event and then tried removing from Step event and adding a Left Pressed Event.