You are on page 1of 16

1

Lesson 3
Fighting Back! Making the Laser
Open the Construct 2 file that you were working on last lesson.

Select the Projects tab on the right hand side of the screen.

Then click and drag the Laser object onto the Main Layer.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
2

Insert the Laser object. Make sure it is off screen and not on the actual layout.

Object that are created in the game can build up. If there are too many objects in the game it could
start to run slowly and take up processing power. You now need to make sure objects that leave the
screen are removed from the game.

Select Add event. Then select System and Next.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
3

Select On start of layout. Then select Done.

Then select Add action. Select the Laser object and then Next.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
4

Select Destroy. Then Done.

Event 7 should look like this.

Repeat this process for the AsteroidLarge object.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
5

This event now needs to be moved to the start of the Events List.

CLICK HERE TO SELECT ALL

Drag the event and its actions to the top of the list.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
6

Now. To make the Player Ship fire a laser. On the Event Sheet. Click on Add event. Select
Keyboard and then Next.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
7

Select On key pressed. Then Next.

You will then need to select the Space button by clicking on the <click to choose> option.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
8

Press the Space button to select it. Then click on OK and Done.

On this Keyboard Event. Select Add action. Then select the PlayerShip object and Next.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
9

Select Spawn another object. Then Next.

You will then need to select the Laser object by clicking on the <click to choose> option.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
10

Select the Laser object. Then set Layer to 1 and Image point to 1. Click on Done when
finished.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
11

Your Events Sheet (up to this point) should look like this.

Press F5 to test your game. Press space to fire the laser. You should notice that the laser just goes
though the asteroids. You now need to program the collision events for the Laser object.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
12

Laser Collison
On the Events Sheet. Select Add event. Then Laser and Done.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
13

Select On collision with another object. Then Next.

You will then need to select the AsteroidLarge object by clicking on the <click to choose> option.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
14

Select the AsteroidLarge object. Then click on Done.

A collision event should now be set on event 9.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
15

On this event. Select AsteroidLarge. Then Next.

Select Destroy. Then Done.

Bristol Metropolitan Academy Computer Science and ICT Department


2017
16

The events should now should show Laser On collision with AsteroidLarge and the action to this
event should read AsteroidLarge Destroy. Which means when the Laser object touches the
AsteroidLarge object, the AsteroidLarge object should be destroyed.

Repeat this process for the Laser object. The Laser object should be destroyed when is touches the
AsteroidLarge object.

Your instructions should look like this:

Press F5 to test your game.

Bristol Metropolitan Academy Computer Science and ICT Department


2017