Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Drawing sprite with keyboard input (GM8)

I want to make a mode select menu that looks something like this
Modeselectblueprint.jpg


Modeselectblueprint2.jpg
basically i t starts like the first image and when the player presses a keyboard button (z or spacebar) depending on where the cursor was two sub buttons should appear

now to do this, in the object that controls this I have for the button press event
Code:
if cursor_location == 2 || 3 {

draw_sprite(spr_mb_freeplay_small,-1,128,128)      

draw_sprite(spr_mb_survival_small,-1,128,176)    

}
(initially I had
Code:
switch cursor_location{

case 0: {cursor_location = 2

draw_sprite(spr_mb_freeplay_small,-1,128,128)      

draw_sprite(spr_mb_survival_small,-1,128,176)      

}]
keeping the variable updater and draw event together but i t didnt work)

but when I press the button, while the variable is correct, my buttons aren't drawn. I also tried this in a draw event but i t seemed to ignore my condition and just drew the buttons regardless of the variable's value.

Am I doing something wrong or is Game maker just trolling m e?

ps
can I have an if statment inside of a switch like so?
Code:
 

switch(cursor_location){

case 0:{ 

if move_cursor = 1

move_cursor = 0

cursor_location = 1

alarm[0] = 8

}}
I t doesn't seem to work
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top