Adding a Controllable Plane

advertisement
Scrolling Shooter Game Tutorial 1
Adding a Controllable Plane
Create a Plane
Let’s start by setting up the basic components of our game. First we’ll create the
skeleton for the player controlled plane and add it to the game.
 Create a sprite named spr_Plane. Click on Load Sprite and select the image
called myPlane_strip3.png from the Resources directory.
 Check the Precise Collision Checking button on for the plane sprite.
 Create an object, give it the plane sprite image, and name it obj_plane.
 Movement:

Add Event > Keyboard and then for Left Key and add the action Jump
to Position in move tab under jump section.
Set x = -8, y = 0 and check the relative box.

Add Event > Keyboard and then for Right Key add the action Jump to
Position in move tab under jump section.
Set x = 8, y = 0 and check the relative box.

Add Event > Keyboard and then for Up Key and add the action Jump to
Position in move tab under jump section.
Set x = 0, y = -8 and check the relative box.

Add Event > Keyboard and then for Down Key and add the action Jump
to Position in move tab under jump section.
Set x = 0, y = 8 and check the relative box.
Create the Background
We need a basic background for our game. We’ll start with a stationary background
first and make it more interesting and dynamic in a future tutorial.
 Create a background and call it bg_Ocean.
 Click on Load Background and select water.png as the image.
Pedagogical GAMES
Copyright © 2012 University of Southern California
Sponsored by the U.S. National Science Foundation
1
Create a Room
Our game must include at least one room; otherwise we won’t be able to run it. Let’s
create a room and add our newly created sprite and background.
 Create a room and put the plane object somewhere inside.
 Click on the Background tab and set the background to bg_Ocean by clicking
on <No Background> and selecting accordingly.
Run your Game
 Run your game and make ensure that you see a plane over an ocean background.
Pedagogical GAMES
Copyright © 2012 University of Southern California
Sponsored by the U.S. National Science Foundation
2
Download