A character can move left and right with arrow keys (you have to keep pressing the key for it to keep moving) and fires a single bullet forward when you press space bar. You have to release and press space bar again for more bullets.
Add a sprite. Load a sprite you would like to use, eg a character or a space ship. Also, load a bullet sprite.
Create an object, and use the character sprite. Add an event, and click on key press, left. Drag the red arrows, under the move tab, into the action section and click only the left arrow when the pop up appears. Type how fast you would like the character to move under the speed section. Add another event and click on key press, right. Drag the red arrow keys, under the move tab, into the action section. When the pop up appears, only click the right arrow.
To make the character stop when the key is released, add an event, then click key release, left. Drag the red arrows, under the move tab, into the action section. Only click the stop button which is square, when the pop up appears. Add an event, then click key release, right. Drag the red arrows, under the move tab, into the action section. Only click the stop button which is square, when the pop up appears.
Test if the character moves by creating a room and putting the character object in it. Play the game and see if it moves.
Add an object and use the bullet sprite. Click on add event, create. Drag the Red arrow pointing down (set the vertical speed) into the action section. When the popup appears, type in the speed you want the bullet to move, with a negative in front. This will make it shoot up.
To make the character shoot bullets, click on add event on the character object. Then click on keypress, space. Drag the yellow light bulb (create the instance of an object), under the main 1 tab, into the action section. When the popup appears, in the object section, locate your bullet object. Then click on relative, so whenever you press space, a bullet will appear where you are.
To test the game, put your character in a room and when it loads, press space to see if it shoots.
I learnt how to do this in class when i started making the 1945 game