A character fires a bullet and has to wait one second before being able to fire the next bullet.
Load a character sprite and a bullet sprite.
Add an object and use the bullet sprite. Click on add event, create. Drag the red arrows, under the move tab, into the action section. When the popup appears, click only the up arrow. Type how fast you want the bullet to go in the speed section.
Add another object and use the character sprite. Click on add event, create. Drag set the value of a variable, under the control tab, into the action section. When the popup appears, type canshoot into the variable section. Also, type 1 into the value section.
Click on add an event, keypress, space. Drag if a variable has a value, under the control tab, into the action section. When the popup appears, type canshoot into the variable section. Type 1 into the value section, and select equals to in the operation section.
Drag both start and end of block, under the control tab, into the action section. In between them, drag create instance of an object. When the popup appears, select the bullet object in the object section, and click the relative box.
Also between the blocks, drag set the value of a variable. When the popup appears, type canshoot in the variable section, and 0 in the value section.
Also between the blocks, drag set an alarm clock, under the main2 tab. When the popup appears, type 30 in the number of steps. and press ok.
Click on add an event, alarm0. Drag set the value of a variable, under the control tab, into the action section. Type canshoot in the variable section, and 1 in the value section.
Test this by putting the character in a room, and pressing space. You should only be able to shoot a bullet every second.
king helped me as this is in his game
also stefen and that 1945 game sorta helped me