← Construct games

A first game in Construct

Build Spell Caster, a small top-down game, with Construct 3's own guided tour (or its written Beginner's guide), then work out what makes each part happen. A behaviour is something the engine does for an object every moment, such as moving it with the arrow keys or flying it forward. An event is a row that says when something happens and what to do then, such as spawning a spell when the mouse is clicked.

Game engines like Construct let you make a working game in an hour, because the engine does the hard, repeated work. Your job is to say what should happen, and when.

Construct 3 is a game engine that runs in your browser. People use it to make games, and also to try out ideas for apps and websites before anyone builds them for real.

In Construct you don't write code line by line. You do two things:

Here are three of the events from the game you'll build, Spell Caster:

When (condition) Do (actions)
Every tick Player: set angle toward the mouse
Mouse: on left button clicked Player: spawn a Spell
Spell: on collision with Goblin Goblin: subtract 1 from health · Spell: destroy
How this lesson works: Predict, Try, Investigate, Modify, Make, Practise
Extra examplesYour teacher may tell you which.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.

Do the arrow keys work?

Spell Caster's event sheet has ten events. Not one of them mentions the arrow keys. When you play the game, what will the arrow keys do?

TryTry it on the board and compare the result with your prediction.

Build it: Spell Caster

Open Construct at editor.construct.net. It runs in the browser: nothing to install, and you don't need to sign in.

Choose one way to build the same game:

When you're done, press Preview (the play button) and play. Shoot some goblins. Try the arrow keys.

Before you close the tab, save a copy of your project to your computer. You'll use it again later in this lesson.

Was your guess right? Nothing on the event sheet mentions the arrow keys, and the player still moves. That's the 8 Direction behaviour.

When you've finished, your event sheet should look like this. Each yellow line is a comment saying what the event below it is for. Check yours against it, top to bottom. Keep it open: you'll use it in the next steps.

Spell Caster's event sheet, events 1 to 6: two global numbers, GoblinSpeed and Score, then On start of layout, Every tick, Mouse on left button clicked, Spell on collision with Goblin, Goblin health 0 or less, and Goblin is outside layout. Conditions are on the left, actions on the right.

Spell Caster's event sheet, events 7 to 10: for each Goblin within 200 pixels of the player, rotate toward the player; every 3 seconds, create a Goblin; Goblin on collision with Player, destroy the player and show Game Over; on Space pressed when there is no player, reset and restart.

Spell Caster is the demo game from Scirra's Beginner's guide to Construct 3 (CC BY 4.0). Screenshots of the finished event sheet in Construct 3.

InvestigateWork out why it happens, one step at a time.

Behaviour or event?

What makes each of these happen in Spell Caster: a behaviour, or an event?

The player moves with the arrow keys
A spell flies forward after it appears
A goblin walks across the screen
The player turns to face the mouse
A spell appears when you click
A new goblin arrives every 3 seconds

Some events have a green arrow beside the condition, such as "On left button clicked". "Every tick" doesn't have one. What's the difference?

Nib's player drifts forward on its own. Click the line where Nib first goes wrong.

ModifyChange the problem on purpose and see what happens.

Change one thing

To change a number in an event, double-click it on the event sheet, type the new value, and press Enter. Then press Preview to play.

Event 8 says: Every 3 seconds, create a Goblin. You change the 3 to 1. What will happen?

MakeMake your own problem using what you have learned. Expect a few tries; that is normal.

Stronger spells

Ideas for your own change: make the player faster (click the Player, then find the 8 Direction behaviour's speed in the Properties panel), give goblins more health, or score more points per goblin.

You want each spell to do 2 damage instead of 1. Which part of Spell Caster do you change?

Practise More · widerA few on your own, to check you have it.

Wider: which goblins lose health?

Construct calls this picking. Events pick the objects their conditions are true for, and the actions only touch those.

Five goblins are on the screen. A spell hits one of them. The event runs: Goblin, subtract 1 from health. How many goblins lose health?

Now you can
Finished the course?Go over it: Construct games recapEvery idea in one place, to check you've got it.You reached the endBack to Construct games
For teachers

Students build Spell Caster with Construct 3's guided tour or its written Beginner's guide (the same game either way), then sort what the game does into behaviours (the engine moves the object every moment) and events (a condition, then actions). They change one event, find where damage is set, and make a change of their own. About 60 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Try it first on a student laptop: open editor.construct.net and choose Take a guided tour. Construct needs WebGL (graphics support in the browser). Without it the editor loads but warns that it can't open any layout views, and nothing can be built. Locked-down or old laptops are the usual cause; try another browser or an updated one.

The free edition is enough: no sign-in, no seats. Spell Caster uses 10 events, and the free edition allows 50. Students should save a copy of their project to their device before closing the tab (Construct keeps nothing for them unless they sign in), so a second lesson can carry on from it.

Two routes, one game: the guided tour, inside the editor, points at each thing to click; the Beginner's guide on construct.net is the written version. Students who were away, or who want to go back over a step, can use the guide. Construct updates itself, so a step may look slightly different from the guide's screenshots.

The one idea: a behaviour is something the engine does for an object every moment; an event says when something happens and what to do then. Picking (the wider step) is the next big idea and gets its own lesson later; here it's only a first look.

The Beginner's guide is by Scirra (Construct's makers), licensed CC BY 4.0. This lesson links to it and does not copy it.

Running the lesson

  1. Predict: most students say nothing happens because no event uses the keys. Leave it open until they play.
  2. Build it: circulate during the first event. Ask which side is when and which side is what to do.
  3. Investigate: for each sorted item, ask where in Construct you'd look to change it: the object's behaviours, or the event sheet.
  4. Modify: insist on a prediction before they change the 3. Then ask them to change it back.
  5. Make: ask each student to name their own change as a behaviour change or an event change.

The hard part (on purpose)

The build takes most of the lesson, and fast builders click through the tour without reading what each step is for. Stop the class once the first event is added and ask what the left side and the right side of the row each mean.

When students get stuck

Stretch and support

Stretch: Make a goblin that's harder to beat (more health) and worth more points, without adding a new event. Which existing events and properties do you change?

Support: Pair students for the build: one reads the step, one clicks, swapping each event.

Where it leads

Next in Construct games (planned): Objects and layouts, then Behaviours, which is the home of the idea planted here. Students who did App Builder apps already know events, variables, sub-events and picking.

For students who did MakeCode Arcade: Arcade moves sprites with velocity blocks and a controller block, where Construct uses behaviours. Same job, different tool.

What each step is for