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

GML Visual [GMS2] [Drag & Drop] Problem with Draw functions

S

Sowatt

Guest
Hello everyone!

So first, let me start by saying that even though I have some knowledge of programming, I'm a big newbie at Game Maker Studio in general.

I'm trying make something very simple: "If I press SPACE then: draw a sprite."
For some reason, when I press space, the sprite appears for like one frame and disappears immediately.
I know this is probably the most easiest thing to fix, but I can't figure it out: how do I make my sprite stay on the screen just after pressing SPACE one time?

Here's how it looks like:


(I used the DrawGUI Event on purpose)

Thank you very much for your help! :)
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
For some reason, when I press space, the sprite appears for like one frame and disappears immediately.
I know this is probably the most easiest thing to fix, but I can't figure it out: how do I make my sprite stay on the screen just after pressing SPACE one time?
Set a variable to `false` when instance is created.
Set a variable to `true` when the key is pressed.
Draw the sprite if variable is set to `true`.
 
Top