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

How do you make a reload system in your game (Drag and drop)?

C

chickwnturbo

Guest
Hi,

I was trying to figure out how I can make my gun have a reload system in my game for drag and drop.

Any answers would be appreciated.

P.S ik that dnd is for noobs but could please help me out anyways
 

3dgeminis

Member
I'll show you an example of reloading pretty simple:

CREATE
Code:
reload=false//if it is false you can shoot
bullets=10 ///number of bullets
ALARM
Code:
reload=false///you can shoot
bullets=10 ///reload the bullets
STEP
Code:
if reload=false ///if you can shootr
   {
    if keyboard_check_pressed(vk_space) {bullets-=1} ///if you press space you shoot a bullet
    if bullets=0 ///if there are no bullets left
       {
        reload=true///you can't shoot
        alarm[0]=60///alarm is activated
       }
   }
DRAW (just to show)
Code:
draw_text(10,10,"bullets: "+string(bullets))
draw_text(10,30,"alarm: "+string(alarm[0]))
draw_text(10,50,"reload: "+string(reload))
 
Top