Professional Documents
Culture Documents
Meeting 1
INTRO TO CONSTRUCT AND JUMPING PLATFORM ......................... 1
Meeting 2
NAVIGATE THROUGH THE MAP ....................................................... 18
Meeting 3
ANIMATE INSIDE LAYOUT ............................................................... 32
Meeting 4
ENEMY SCORE AND NEXT LEVEL .................................................... 44
Meeting 5
DRAWING WITH INKSCAPE ............................................................. 62
Meeting 6
BALL, PADLLE, AND BLOCKS ........................................................... 79
Meeting 7
BOUNCING BALL AND FLOATING BLOCKS ..................................... 95
Meeting 8
LIFE AND NEXT LEVEL ...................................................................... 106
Meeting 9
LAYOUT AND BUTTON .................................................................... 114
Meeting 10
DRAWING BIRD AND PIG ............................................................... 120
Meeting 11
AIM AND SHOOT ........................................................................... 130
Meeting 12
PARTICLES AND NEXT STAGE .......................................................... 146
Meeting 13
PICK COLOR AND TRACE ............................................................... 155
Meeting 14
DESIGN EXAM ................................................................................. 164
Meeting 15
PROGRAMMING EXAM 1 ................................................................. 165
Meeting 16
PROGRAMMING EXAM 2 ................................................................. 166
TABLE OF CONTENT - ADVANCE 2
Meeting 1
DRAW WITH GRID AND BEZIER CURVE ............................................ 167
Meeting 2
GLOWING SPRITESHEET .................................................................. 182
Meeting 3
SELECT PLAYER AND SHOOT RANDOM METEOR .............................. 193
Meeting 4
LIFE, SCORE, AND FAMILY FEATURE ................................................. 213
Meeting 5
POWER-UP ITEMS ............................................................................ 228
Meeting 6
INSTANCE VARIABLE AND GAME OVER ........................................... 237
ADVANCE 1
INTRO TO MEETING 1
CONSTRUCT
AND JUMPING
PLATFORM
What are we going to learn today?
Closer Look to Construct 3 Website
1
Meeting 1 - Intro to Construct and Jumping Platform
CONSTRUCT 3
2
Meeting 1 - Intro to Construct and Jumping Platform
STEP 1
Open link : https://editor.construct.net/ > NEW PROJECT
Name it : “Meeting1_[yourName]”
Match the settings to the picture below
Click Create
to start making
your game.
STEP 2
After the project is made, activate the autosave
feature to secure your project.
Click Menu > Setting > Save and Backup
You can save your projects in Timedoor’s GDrive or your own Gdive.
3
Meeting 1 - Intro to Construct and Jumping Platform
STEP 3
On the Properties tab, Set the layout size to 854 x 480
After the layout is done, we need to add sprites into the layout
Do you know what a Sprite is?
Can you give an example of Sprite in a game that you
know?
4
Meeting 1 - Intro to Construct and Jumping Platform
ADDING SPRITE
STEP 1
You will need 3 sprites.
sprite 1 : Platform
sprite 2 : Rabbit
Sprite 3 : Carrot
5
Meeting 1 - Intro to Construct and Jumping Platform
ADDING SPRITE
STEP 2
Select the color Green, and then click Fill (Paint Bucket icon) and click
inside the square
3
2
When you finish, click close to the upper right corner to return to
the layout.
STEP 3
The sprite in the layout display will appear like this
Set the size to 200 x 40
6
Meeting 1 - Intro to Construct and Jumping Platform
ADDING SPRITE
STEP 4
Duplicate your sprite platform by Right
click > copy > paste and set the layout
according to the example below.
STEP 1
Right click > Insert new object > Sprite
Choose Load an image from a file (CTRL + O) on the menu above.
7
Meeting 1 - Intro to Construct and Jumping Platform
ADDING SPRITE
STEP 2
Choose Rabbit and Open
STEP 3
8
Meeting 1 - Intro to Construct and Jumping Platform
BEHAVIOR
We will make the Rabbit to be able to move left and right and also jump
on the platforms. We will also make the carrot moves.
How to make a sprite move in Scratch ?
Can you make a sprite jump in scratch?
How to make a sprite rotates in scratch?
9
Meeting 1 - Intro to Construct and Jumping Platform
ADDING BEHAVIOR
The first behavior that we will use is Solid. We will give this
Behavior to the platform that the Rabbit will stepped on.
STEP 1
Add the behavior to the platform by
Right click on the sprite > Add >
Behavior > Solid
10
Meeting 1 - Intro to Construct and Jumping Platform
ADDING BEHAVIOR
STEP 2
Play your game by clicking the play button on the upper side and
move the rabbit using arrow keys.
11
Meeting 1 - Intro to Construct and Jumping Platform
ADDING BEHAVIOR
STEP 3
We will continue by giving Behaviors to the Carrots
Type Behaviors that we will use are Sine and Rotate
12
Meeting 1 - Intro to Construct and Jumping Platform
EXPLORE
Make the Sun spin and the Clouds move left and right!
2. Add 1 sprite lalu and try to add various behaviors to find out
the functions and what do they do!
No Behavior Function
13
Meeting 1 - Intro to Construct and Jumping Platform
CHALLENGE
Layout size
1
Viewport size
14
Meeting 1 - Intro to Construct and Jumping Platform
CHALLENGE
15
Meeting 1 - Intro to Construct and Jumping Platform
GAME TIME
Planting ground
Carrot seeds must
be pushed until they
reach the planting
ground
16
Meeting 1 - Intro to Construct and Jumping Platform
What is Behavior?
Answer : __________________________________________
____________________________________________________
17
MEETING 2
NAVIGATE
THROUGH
THE MAP
What are we going to learn today?
Arranging The Maze
18
Meeting 2 - Navigate Through the Map
MAZE
19
Meeting 2 - Navigate Through the Map
Player
Click and drag to move the player to
the desired direction.
20
Meeting 2 - Navigate Through the Map
DRAWING MAZE
STEP 1
Prepare your project according to the rules below:
STEP 2
STEP 3
21
Meeting 2 - Navigate Through the Map
ADDING PLAYER
STEP 1
Add player sprite from your computer
Do you still remember how to do it?
22
Meeting 2 - Navigate Through the Map
MOVING PLAYER
STEP 2
Let’s make your player move!
Do you still remember how to make a player move in Scratch?
What codes do you use to make the player move?
Seaweed 1 Seaweed 2
size 91 x 67 size 55 x 60
Do you still remember how to add and multiply a sprite?
23
Meeting 2 - Navigate Through the Map
JELLYFISH
STEP 1
Click the jellyfish, and on the
Properties click Add/Edit
Behavior
STEP 2
After adding Solid behavor, it will
appear as follows
Click back on the Add New
Behavior to add new behaviors
Choose Sine and set as follows
24
Meeting 2 - Navigate Through the Map
STEP 1
We will add Urchin sprite which will appear bigger
and smaller and spin
Set the size to 40 x 40
STEP 2
We will add Worm sprite which will move left and
right
Set the size to 40 x 25
25
Meeting 2 - Navigate Through the Map
EVENT SHEET
STEP 1
Click Add Event to add a new Event
Click Player > Next
26
Meeting 2 - Navigate Through the Map
EVENT SHEET
STEP 2
Click On collision with another object > Next > Click to choose
27
Meeting 2 - Navigate Through the Map
EVENT SHEET
STEP 3
Try to move your player to touch the worm. See what happens!
28
Meeting 2 - Navigate Through the Map
EXPLORE
29
Meeting 2 - Navigate Through the Map
CHALLENGE
30
Meeting 2 - Navigate Through the Map
31
MEETING 3
ANIMATE
INSIDE LAYOUT
What are we going to learn today?
Getting to know Animation Frame
32
Meeting 3 - Animate Inside Layout
ANIMATION FRAME
Today we will learn about Animation frames and we will also learn
about a new behavior called Bound to Layout
As you can see on the picture above, to make the character jumps and
falls, it takes 9 pictures that are shown one after another (sequentially).
These group of pictures is called Animation Frames.
33
Meeting 3 - Animate Inside Layout
ANIMATION FRAME
https://www.youtube.com/watch?v=Njl-uqnmBGA
34
Meeting 3 - Animate Inside Layout
ANIMATION FRAME
STEP 1
We will add a sprite with Animation Frame
Select Add new Object > Sprite
Then select Turtle1 from your computer
Afterwards right click next to frame 0 > Import Frames > From Files
> choose Turtle2
STEP 2
Right click on the right side of the tab on
Animation 1
Then activate the Loop in the Animation
Properties
You can also set the speed of your animations by
adjusting the number in the Speed column
35
Meeting 3 - Animate Inside Layout
STEP 3
Add 8 Direction Behavior to the Turtle and try to play your game.
How does your turtle move?
Edit the frames by clicking the Turtle 2x to open the sprite editor
STEP 4
Try to move the turtle outside the layout.
The turtle still can move inside and outside the layout.
We will make the only to only be able to move around
inside the layout with a behavior.
Add Bound to Layout behavior.
36
Meeting 3 - Animate Inside Layout
RENAME SPRITE
When playing a game there must be obstacles that must be avoided. For
example in the game above, T-rex must avoid the trees so that the game
continues.
What would happen if a T-rex hit a tree?
Give an example of an obstacle that you know in a game!
37
Meeting 3 - Animate Inside Layout
38
Meeting 3 - Animate Inside Layout
CODING
39
Meeting 3 - Animate Inside Layout
EXPLORE
40
Meeting 3 - Animate Inside Layout
EXPLORE
41
Meeting 3 - Animate Inside Layout
CHALLENGE
42
Meeting 3 - Animate Inside Layout
43
MEETING 4
ENEMY SCORE
AND
NEXT LEVEL
What are we going to learn today?
Adding enemies and score
44
Meeting 4 - Enemy Score and Next Level
ADDING ENEMY
In this meeting we will use Rotate behavior and learn new behaviors to
move the enemies in the game
45
Meeting 4 - Enemy Score and Next Level
ADDING ENEMY
STEP 1
Add Shark spritesprite as your enemy, and don’t
forget to rename it!
Set the size to 135 x 50
46
Meeting 4 - Enemy Score and Next Level
ADDING ENEMY
STEP 2
Add Bullet behavior to the Shark.
After that adjust it so that when the Shark bounces
when hitting the rocks by activating the Bounce
off Solids option.
STEP 3
Next we will try to combine 2 behaviors, Bullet dan Rotate
What do you think would be the movement in result of this
combination?
Try to give bullet and rotate to the Urchins and see what happens!
STEP 4
Codes to make the Turtle disappear when it touches shark and urchin
47
Meeting 4 - Enemy Score and Next Level
SCORE
Before creating the scores for the game, let’s try to remember
these below!
1. What is Variable?
STEP 1
Make a Global Variable by right click on event sheet > Add global
variable
Name it Score > OK
Global Variable will be shown at the top part of Event sheet
48
Meeting 4 - Enemy Score and Next Level
SCORE
STEP 2
Add scores everytime the player collect point items
On event of set Turtle on collision with starfish;
Add action > System > Add to > Variable: Score; Value: 1
49
Meeting 4 - Enemy Score and Next Level
SCORE
STEP 3
In Scratch, the Variable that you make will be displayed directly into the
layout, but in Construct, if you want to display your Variable, you have to
use another object called Text
Add Text object into the layout by: Insert new object > Text
50
Meeting 4 - Enemy Score and Next Level
SCORE
STEP 4
STEP 5
On event set Turtle on collision with starfish;
Add action > Text > Set text > “SCORE : “&Score
51
Meeting 4 - Enemy Score and Next Level
SCORE
Add to
Has the similar function with change
score by 1 in Scratch
Subtract from
Has the similar function to change
score by -1 in Scratch
52
Meeting 4 - Enemy Score and Next Level
WATERGATE
Before making the new layout let’s first make a Watergate and place it
corner of the layout (size 140 x 40)
Later we will make the player to switch to the new layout when it touches
this Watergate sprite.
53
Meeting 4 - Enemy Score and Next Level
STEP 1
54
Meeting 4 - Enemy Score and Next Level
STEP 2
Add Background, Turtle, Rock, Starfish dan Text objects.
Since you already have used these objects in the previous layout, you
just need to drag and drop the objects you need from Project Tab
55
Meeting 4 - Enemy Score and Next Level
STEP 3
Add Jellyfish enemy in your game,
Make 2 animation frames (size 39 x 65)
for the jelly fish in your game
Make it moves up and down (adjust the
speed as you wish)
Code to make the Turtle disappear when it
hits the Jellyfish
STEP 4
56
Meeting 4 - Enemy Score and Next Level
CODING
Let’s add some codes so that The turtle are able to switch layout
when it touches the Watergate
STEP 1
On Event Sheet, klik Add event > Turtle > On collision with
another object > Watergate
STEP 2
Add action > System > Go to layout > Layout 2
Try to play the game and see if you can switch between layouts
57
Meeting 4 - Enemy Score and Next Level
EXPLORE
Let’s explore with the new behaviors that we have just learned!
58
Meeting 4 - Enemy Score and Next Level
CHALLENGE
59
Meeting 4 - Enemy Score and Next Level
CHALLENGE
60
Meeting 4 - Enemy Score and Next Level
61
MEETING 5
DRAWING
WITH
INKSCAPE
What are we going to learn today?
Getting to know Inkscape app
62
Meeting 5 - Drawing with Inkscape
In this lesson we will learn how to draw Vector that we will use as sprite
within our game.
Vector can be in the form of pictures or logo that you usually see
everyday.
There are also vector in the form of text!
VECTOR BITMAP
Does not crack when zoomed, Cracked when zoom more than its
because it is made of curves initial size
63
Meeting 5 - Drawing with Inkscape
WHAT IS INKSCAPE?
64
Meeting 5 - Drawing with Inkscape
TOOLS IN INKSCAPE
Command Bar is on
Tools Box is on the the right side of the
left side of the screen, screen, containing
containing set of basic shortcut icons to
utility tools to create certain commands that
and change shapes can be accessed from
the menu or shortcut
button
65
Meeting 5 - Drawing with Inkscape
TOOLS IN INKSCAPE
Choosing tools from the toolbox changes the Control Bar to show
the certain option related to the tools.
66
Meeting 5 - Drawing with Inkscape
STEP 1
To create a Square just pick Rectangle Tools
Now left click while pressing CTRL and then drag it to the bottom
right corner
Left click while
pressing CTRL
Drag towards
this point
The result is a perfectly simetrical square that has the same length on
each side.
STEP 2
To create a random rectangle you just need to use Rectangle Tools
How to create it is similar to creating square but without pressing on
CTRL
Click and drag to the bottom right corner as far as you wish your
rectangle would be.
67
Meeting 5 - Drawing with Inkscape
STEP 3
To create circles you can just use Circles Tools
Try left click while pressing CTRL then drag it to the bottom right
corner
STEP 4
To create a Polygonstry we just need to use Star & Polygons Tools
On the top part of the screen (Control Bar) it will displays Controller
Menu Panel for Star & Polygons Tools, choose Polygons
For Creating
Stars
68
Meeting 5 - Drawing with Inkscape
After choosing Polygon Tools, make sure Corners : 5 so when you make
an object it will have 5 corners
Click and hold while dragging your mouse up while
pressing CTRL
STEP 5
Still using Tools similar to Polygon Tool, but now set the Corner number
to 3
Now try to draw by click and dragging up your mouse cursor while
pressing CTRL
STEP 6
Still using the same Tools but now we will use the Star option.
Choose
Star
Try to click and hold then drag up
your mouse cursor while pressing
CTRL
The result will look like this star on
the right side
69
Meeting 5 - Drawing with Inkscape
TRANSFORMING OBJECT
Now we will learn how to transform and picking colors, the first thing we
should learn is how to transform Transform; Move, Scale and Rotate.
STEP 1
First press Shift + CTRL + M as a shortcut to open Transform panel
Select stars that we have made then set the Horizontal on the
Transform panel to 5 or more and set the metric to cm (Centimeter) >
click Apply
STEP 2
Now we will try to scale the object, scale function is to make the object
bigger or smaller
Pick the menu Scale > check on Scale proportionally
This result in every object you made will be proportional
Choose Scale
Choose Scale
Proportionally
70
Meeting 5 - Drawing with Inkscape
TRANSFORMING OBJECT
Pay attention to what happens to the star that you’ve made when
you change the scale number!
Object will be bigger and smaller based on the number you put on the
scale
STEP 3
Last, we will try to rotate pictures
There is a key to change the rotating axis from left to right exist on
the rotate menu
71
Meeting 5 - Drawing with Inkscape
CHOOSING COLOR
Color
panel
Or you can open this panel Fill & Stroke by (Shift+CTRL+F) to pick a
more accurate color
R = Red
G = Green
B = Blue
A = Alpha (Transparency)
72
Meeting 5 - Drawing with Inkscape
STEP 1
Use Circles tools to make a circle, press and hold CTRL so the Circle are
perfect
Delete the stroke if there is any
Set the color like this below
R = 159
G = 242
B = 255
A = 100
73
Meeting 5 - Drawing with Inkscape
STEP 2
Copy the circle that you have made and set the
position similar to this picture
STEP 3
Copy the moon object into two, then arrange it
similar to this picture and change the color to red so
it is easier for you to tell the difference.
74
Meeting 5 - Drawing with Inkscape
STEP 4
Next step is to change the color of one piece of the moon to be darker.
Choose Export As
then choose a
location where
you want save
the file
Then click Export
75
Meeting 5 - Drawing with Inkscape
EXPLORE
• Try to change the value of Spoke Ratio, and see what happens!
76
Meeting 5 - Drawing with Inkscape
CHALLENGE
77
Meeting 5 - Drawing with Inkscape
78
MEETING 6
BALL,
PADLLE, AND
BLOCKS
What are we going to learn today?
Drawing game assets and batch export
79
Meeting 6 - Ball, Paddle, and Blocks
STEP 1
With using Rectangle tool, make an object as in the picture below
R = 170
G = 170
B = 170
A = 100
STEP 2
Make a circle object with the size of 22px X 22px
Set the Stroke size to 2 px on Stroke style
R = 170 R = 120
G = 170 G = 120
B = 170 B = 120
A = 100 A = 100
80
Meeting 6 - Ball, Paddle, and Blocks
STEP 3
We will use Batch Export to save our objects in form of PNGs
(.png)
Block both Object, set the location to save the objects using Export as,
then check the Batch Export 2 Selected Objects, lastly click Export
81
Meeting 6 - Ball, Paddle, and Blocks
DRAWING BLOCKS
Draw Bezier
Rectangle
STEP 1
Try makin a square similar to
the example. Set the Width and R = 230
G = 230
Height to 64px X 64px and use B = 230
the color shown on the right side A = 100
of the picture.
STEP 2
1
Make a diagonal line using Bezier Click 1X here to
curve, and then block the square and start the line.
the line, and choose Path > Division
The result look like this, the square will diagonally cut
into 2 triangles.
82
Meeting 6 - Ball, Paddle, and Blocks
DRAWING BLOCKS
STEP 3
R = 128
Change one of the object color
G = 128
darker, and use the provided B = 128
color. A = 100
STEP 4
Join both triangles and add one black
square on top of them.
Set the size to 52px X 52px and put it
on the center of the larger square
83
Meeting 6 - Ball, Paddle, and Blocks
DRAWING BLOCKS
R = 59 R = 10 R = 24 R = 30 R = 255 R = 255
G = 254 G = 212 G = 154 G = 187 G = 82 G = 123
B = 184 B = 139 B = 211 B = 215 B = 82 B = 123
A = 100 A = 100 A = 100 A = 100 A = 100 A = 100
These blocks will be stacked and will crack or even vanish when hit by
the ball.
Let’s make a frame for the block’s cracks.
The cracks will be made by using Extension Render Random Tree
STEP 1
Copy the block that you have
made.
On the one block, we ill add
cracking effects
On the menu bar, click Extensions
> Render > Random Tree
84
Meeting 6 - Ball, Paddle, and Blocks
CRACKED BLOCKS
STEP 2
Random Tree window will appear, Check on Live Preview to see the
immediate result, Set the Minimum size to 40, Click apply to create
the random tree.
STEP 3
Put it on top of the box, adjust the Stroke thickness
and change the color into white
Group Object
STEP 4
The smaller the Minimum size the more branches generated
Make 1 more frame with more cracks. Group it when it is done
85
Meeting 6 - Ball, Paddle, and Blocks
FILTER
Filter is a tool in the menu bar to give certain effects to a choosen object
Filter itself has various of effect types that can be used and can be
applied to any object you want. For example Gaussian Blur effect can be
used directly from Fill and Stroke window. It gives blurry effect onto an
object.
The wide range of effects and filter function is to add aesthetic point
onto the object you make.
For example if you want to design a set of objects in which the focus
is on one object and blurred the rest of it, then gaussian blur effect is
perfect to create this effect.
86
Meeting 6 - Ball, Paddle, and Blocks
PRESET FILTER
STEP 1
In the Menu, Click Filter > Bevels
> Neon
The result will be similar to the
picture below
STEP 2
Adjust the Blur on the Fill & Stroke window to 56% by click & drag
Now let’s continue making other filter with using Filter Editor!
87
Meeting 6 - Ball, Paddle, and Blocks
FILTER EDITOR
STEP 1
Create a black square in the size of 52px X 52px
Click Filter > Filter Editor
It will display Filter Editor panel on the right side of your
screen, the display will look like this
Click New
STEP 2
To add effects click on Effect (Blend)
> choose the effect that we need to add
(Turbulence)
> Click Add Effect
88
Meeting 6 - Ball, Paddle, and Blocks
FILTER EDITOR
STEP 3
Add the effect in this order below
1. Turbulance
2. Color Matrix
3. Composite
4. Blend
STEP 4
Now let’s set the object to acquire Steel or Metal look, follow the settings
in these pictures below.
89
Meeting 6 - Ball, Paddle, and Blocks
FILTER EDITOR
STEP 5
Next click the Black Box that we have made before, then check on
Filter Effect to turn on/apply effect on to the Black box
Try to apply the filter on the block that you have made!
STEP 6
Try to create a block similar to this below with the new filter
that you have made
90
Meeting 6 - Ball, Paddle, and Blocks
SPIRAL
STEP 1
Create rectangle with the size of 25px X 300px add the
White color and set stroke : 2px
STEP 2
STEP 3
To create Spirals choose Spirals Tools
Spirals (i)
91
Meeting 6 - Ball, Paddle, and Blocks
SPIRAL
STEP 4
Click and drag to the canvas until resulting to the
picture beside.
STEP 5
Arrange all the objects that you have made into the
shape of a lolypop as shown beside.
You can choose any color you want for your object.
The color of the spiral can be changed in Stroke Paint.
Now make a snail according to the example below.
92
Meeting 6 - Ball, Paddle, and Blocks
CHALLENGE
93
Meeting 6 - Ball, Paddle, and
94
BOUNCING MEETING 7
BALL AND
FLOATING
BLOCKS
What are we going to learn today?
Moving paddle and bouncing the ball
95
Meeting 7 - Bouncing Ball and Floating Blocks
ARKANOID
Add new sprite for background, then adjust the background size
similar to the layout size
96
Meeting 7 - Bouncing Ball and Floating Blocks
STEP 1
After adding background, we will add another Layer to place the sprites
Later, Background will be on Layer 0 and
Moving sprites will be placed on Layer 1
It is needed to help you with the sprite arrangement.
STEP 2
On Layer 1, add Ball dan Paddle Sprite.
You can use the sprite that you have made before.
Ball Paddle
Behavior Behavior
97
Meeting 7 - Bouncing Ball and Floating Blocks
STEP 3
Click Sprite, then adjust the properties as belowbelow
Ball Paddle
STEP 4
Add action
Ball
> Set enabled
> Enable
Try to play your game and see if you can move the paddle or not.
How does the ball move in the game you’ve made?
In this game we will make the ball only able to escape from the layout
from the bottom of the layout.
Do you know how to do it?
Try to code the ball to be able to escape only through the bottom
of the layout!
98
Meeting 7 - Bouncing Ball and Floating Blocks
BOUNCING BALL
To make the ball stay within the layout and unable to escape we will give
some barriers on the left, top, and right side of the layout using these
steps below.
STEP 1
We will create borders on the 3 sides of the layout
Add sprite with the color of your choice and give behavior
STEP 2
Copy and paste into 3 parts and put it as
borders of the left, right, and top side of the
layout.
Now the ball will bounce when hitting the
border and will escape from the layout if
it pass through the bottom part.
99
Meeting 7 - Bouncing Ball and Floating Blocks
ADDING BLOCKS
After adding the border, the Ball and Paddle won’t be able to move out
of the layout, next we will be adding Blocks that has Instance variable
STEP 1
Add Blocks sprite with 3 frame
Add Behavior
100
Meeting 7 - Bouncing Ball and Floating Blocks
ADDING BLOCKS
STEP 2
Add Instance Variable on Blocks
Click on Blocks, then on Properties, choose Instance Variables > Add
new instance variables
STEP 3
101
Meeting 7 - Bouncing Ball and Floating Blocks
ADDING BLOCKS
STEP 4
Code the Blocks to decrease 1 life and change the frame of the Block
everytime the Ball touches the Block
102
Meeting 7 - Bouncing Ball and Floating Blocks
ADDING BLOCKS
103
Meeting 7 - Bouncing Ball and Floating Blocks
CHALLENGE
104
Meeting 7 - Bouncing Ball and Floating Blocks
What is Sub-event?
Answer : __________________________________________
____________________________________________________
105
MEETING 8
LIFE AND
NEXT LEVEL
What are we going to learn today?
Adding Variable and Respawning Ball
106
Meeting 8 - Life and Next Level
If it passes through the bottom of the layout and disappears, can the
Ball show up again?
In Arkanoid game we have few
chances to play depending on
the number of Balls we have.
Now we will learn how to add Ball Life variable, event for respawning,
and level within the game
Let’s open your Arkanoid game file!
107
Meeting 8 - Life and Next Level
RESPAWN BALL
STEP 1
Add this codes on event sheet to decrease the lives of the ball when it falls out
of the layout
STEP 2
To respawn when the amount of Ball_Life = 2 add sub event on the event
that you are currently working on
System
> Compare variable
> Ball_Life = 2
STEP 3
To create a new Ball and control the paddle to come back to its initial position,
on
Add action Add action
System Paddle
> Create object > Set position
108
Meeting 8 - Life and Next Level
RESPAWN BALL
STEP 4
Add evenet to destroy the ball if Life has already runs out
Ball_life = 0 > Destroy
109
Meeting 8 - Life and Next Level
LEVEL UP
STEP 1
Duplicate “Layout 1” 2x by
Right click on Layout 1 > Duplicate
STEP 2
110
Meeting 8 - Life and Next Level
LEVEL UP
STEP 3
Add global variable using the name Points with Value = 72
Add codes similar to these below to advance to the next level on the game
Score = Point (All the blocks have been destroyed)
111
Meeting 8 - Life and Next Level
EXPLORE
To answer those questions, you will have to do some experiments on the ball!
These are the experiment steps:
1. Creat instance variable on Ball Sprite with the name “Ball” value 3
112
Meeting 8 - Life and Next Level
113
MEETING 9
LAYOUT AND
BUTTON
What are we going to learn today?
Adding Start, Win, and Game Over Layouts
114
Meeting 9 - Layout and Button
LAYOUT
When playing a game, do you just directly play the game once it
begins?
What do you usually do before starting to play the game?
How do you start a game?
How do you restart a game after losing the game?
Usually when starting a game, you will find an intial page. In that initial page
you can choose to enter the game by pressing the Play or Start button
When you finish a level, the display where you can choose to play again will
appear with the Replay button
In the previous lesson we have learned how to respawn a ball and level up in
the Arkanoid game
We will add Start, Game Over, and Win Game Layout
On the Start layout, it will display Game Title and Start button
On the Game Over layout, it will display Score and Replay button
115
Meeting 9 - Layout and Button
START LAYOUT
STEP 1
Add new layout without event sheet, give it the
name Start
Position the layout on the top
Add background and adjust the background size similar to the layout.
You can use your background layout on your game (level 1)
Add thes texts such “ARKANOID” and “Let’s Play Game!” below it, place
the texts in the center of the layout
STEP 2
Codes Start Button when clicked so when it is clicked you can switch to
LV1 layout, set score = 0 dan ball_life = 3
Add event > Mouse > On Object Clicked > Mouse button: Left, Clicked
type: Clicked, Object Clicked: Start Button
116
Meeting 9 - Layout and Button
WIN LAYOUT
STEP 1
Add Layout with event sheet, then change the layout
name it to Win Game
Place the layout on the lowest order after LV3 layout
Add Background and adjust the background size similar to the layout.
You can use your game background layout (level 1)
STEP 2
Add codes on Event sheet 2 so when Replay button is clicked it will
switch to the Start layout
117
Meeting 9 - Layout and Button
STEP 1
Add layout without any event sheet, then change the
event sheet on the layout to Event Sheet 2,
Change the name to GameOver
Position the layout on the bottom order after Win
Game layout
Add Background and adjust the background size similar to the layout.
You can use your game background layout (level 1)
STEP 2
Add codes on Event sheet 1 when Ball_Life = 0 the layout will switch to
Game Over layout Add action on sub event when Ball life = 0
System
> go to Game Over layout
118
Meeting 9 - Layout and Button
119
MEETING 10
DRAWING
BIRD AND PIG
What are we going to learn today?
120
Meeting 10 - Drawing Bird and Pig
STEP 1
We will make the body of the bird using
Circle Tools
Make a circle
Set the size to 200px X 200px
Stroke 5px
R = 255
G = 204
B = 0
A = 100
121
Meeting 10 - Drawing Bird and Pig
STEP 2
Now we need to add some accent on it’s body.
By using the duplicate duplicate to the object and then arrange them as
the picture below.
STEP 3
And then add some eyes using Circle tools as well.
Make 3 circles with each size as follows:
64px X 78px (putih, stroke hitam 2px)
30px X 35px (hitam, no stroke)
15px X 20px (putih, no stroke)
Arrange the circlle as the example above and then group them together
to make eye object.
122
Meeting 10 - Drawing Bird and Pig
STEP 4
Now, we will make the beak using Polygon tool,
Set the value to: Corner 3 and Rounded 1
STEP 5
Next, we will make the tail using Rectangle Tool with size: 70px X
15px
After that select this rectangle object and convert it from object to path
by selecting in the menu: Path > Object to Path
STEP 6
Select Tools: Edit Path by Nodes
After selecting Nodes tool, several nodes will appear on the edges of the
rectangle object.
123
Meeting 10 - Drawing Bird and Pig
STEP 7
After turning the object into a cone shape, duplicate it the objects so that
you will have 3 objects.
124
Meeting 10 - Drawing Bird and Pig
STEP 1
Let’s make the body first using Circle Tools
Set the size to: 250px X 250px
Stroke: 5px
R = 128
G = 195
B = 71
A = 100
STEP 2
In order to make the mouth, we will still need to use circle tool but there
are some aditions in the settings.
When selecting Circle Tool, you need to give value: 180 to the Arch
end point which is in the controller menu when choosing Circle tool.
125
Meeting 10 - Drawing Bird and Pig
STEP 3
To return the circle to the normal shape you can choose icon on the
far right, or giving 0 on the value of the start dan end column.
R = 110 R = 34
G = 226 G = 85
B = 73 B = 0
A = 100 A = 100
Don’t forget to group them to ease you when you need to move them
together.
STEP 4
Next, make the ear with the size as follows: 80px X 72px
Also make the inner part of the ear with the size: 45px X 50px
R = 110 R = 56
G = 226 G = 157
B = 73 B = 27
A = 100 A = 100
126
Meeting 10 - Drawing Bird and Pig
STEP 5
Make some eyes using the same ways as making the eye for the bird.
STEP 6
Combine and arrange all the objects you have made until you create the
pig as the example below.
127
Meeting 10 - Drawing Bird and Pig
CHALLENGE
R = 84 R = 213 R = 255
G = 221 G = 246 G = 255
B = 255 B = 255 B = 0
A = 100 A = 100 A = 100
128
Meeting 10 - Drawing Bird and Pig
129
MEETING 11
AIM AND
SHOOT
What are we going to learn today?
Directing the sprite to follow the mouse pointer
130
Meeting 11 - Aim and Shoot
131
Meeting 11 - Aim and Shoot
Beside using the arrow keys on the keyboard, you can also use the
mouse pointer to direct the player in a game, for example in Zuma.
In this game, the player will move following the movements of the
mouse and shoot when the mouse is clicked.
You can use the Bird sprites that you have made
previously.
Don’t forget to change the name of your sprites.
132
Meeting 11 - Aim and Shoot
IMAGE POINT
STEP 1
Add object: Mouse
Insert new Object > Mouse
STEP 2
Set the Image point that will be the axis of the cannon. This axis will
follow the movement of the mouse pointer.
Click 2x on the Cannon sprite > Edit the image points
You will see the image point on the cannon in the middle of the
sprite.
Move the image point backwards by clicking on the place that you
want and the image point will move to the area you click.
133
Meeting 11 - Aim and Shoot
STEP 3
Set the position of the cannon as follows:
134
Meeting 11 - Aim and Shoot
STEP 4
To make the cannon move following the mouse pointer, add new event
in the event sheet System > Every tick
Add action
Sprite Cannon
> Set angle toward position
> Mouse.X ; Mouse.Y
> Done
135
Meeting 11 - Aim and Shoot
PHYSICS
When you throw something upwards, it will come back down. This is one
of the physic laws that we know as gravity.
Gravity is the force that will pull things down. It happens to all
particles that have weight in the universe.
136
Meeting 11 - Aim and Shoot
Previously, we have set the image point as rotation axis of the cannon
to follow the movement of the mouse, now we will add a new image
point where the bird will be launched.
STEP 1
Click 2x on the Cannon1 Sprite and select Edit the image points
On the left side of the screen and then right click on the white
area and select Add a new image point
and then Image Point 1 will appear.
STEP 2
Place the new image point (Image Point 1) in the end of the
cannon.
Next we will use the Physics behavior to the platform and Bird sprite.
Sprites that have physics behavior can touch to each other.
137
Meeting 11 - Aim and Shoot
STEP 1
Add Physics behavior in the Platform
Set the properties as follows:
Immovable locks the sprites that have physics behavior so they don’t
move or fall when the game starts.
STEP 2
Add Physics behavior to the Bird
Set the properties as follows:
138
Meeting 11 - Aim and Shoot
SHOOTING BIRD
STEP 1
Add Event
Mouse
> On click
> Mouse button : Left
> Click type : Clicked
STEP 2
Add an action to place a bird from the top of the cannon:
Sprite Cannon
> Spawn another object
> Object : Sprite Ball
> Image point : 1
139
Meeting 11 - Aim and Shoot
SHOOTING BIRD
STEP 3
Add action to launch the bird:
Sprite Bird
> Apply impulse at angle
> Impulse : distance(Self.X, Self.Y, Mouse.X, Mouse.Y)/20
> Angle : Sprite Ball.Angle
> Image point : 0
140
Meeting 11 - Aim and Shoot
SHOOTING BIRD
The bigger the value of the divider, the slower the ball will be.
The farther the distance, the faster the ball wii be
In the marble game, the players must shoot the marbles with their
fingers to hit and push other marbles out of the arena using the force.
The force from one object to push the other is called Impulse.
141
Meeting 11 - Aim and Shoot
Add more
Blocks and TNT
into your game
In the Block and TNT sprtites, add Physics behavior and set the
Collision mask into Bounding box.
Multiply the Block sprite and arrange them around TNT sprite.
By adding physics behavior to the blocks, these objects will behave like
in real world.
142
Meeting 11 - Aim and Shoot
IMPULSE
STEP 1
Add Event
Bird > On collision with TNT
Add Action 1
TNT > Destroy
Add Action 2
Block
> Apply impulse at angle
> Impulse : 10
> Angle : angle(TNT.X, TNT.Y, Block.X,Block.Y)
> Image point : 0
Try playing your game and see what happens when Bird touches
TNT
143
Meeting 11 - Aim and Shoot
5. Try to add some Blocks and 4 Pig sprites and then stack
them together like in the angry bird game. Feel free to be
creative with the arrangement! Place the Pigs inside the
layout!
6. When the bird hits the Pigs, they will disappear and your
score will increase.
Don’t forget to add the score variable text and call it every
time you make a score!
144
Meeting 11 - Aim and Shoot
What is impulse?
Answer : __________________________________________
____________________________________________________
145
MEETING 12
PARTICLES AND
NEXT STAGE
What are we going to learn today?
Adding Particles Effect
146
Meeting 12 - Particles and Next Stage
WHAT’S NEXT?
__________________________________________________________________
__________________________________________________________________
- What is Spawn?
__________________________________________________________________
__________________________________________________________________
- What is Impulse?
__________________________________________________________________
__________________________________________________________________
147
Meeting 12 - Particles and Next Stage
SPAWN PARTICLES
We will make the particles appear when the Pig sprite touches the Bird sprite
launcehed by the Cannon.
STEP 1
Insert New Object > Particles
Place the particles outside layout
Use Brush tool with size:175
STEP 2
Set Rate, Spray Cone and Type
in the Properties
STEP 3
Add action
Pig
> Spawn another object
> Particles; Layer: 0; Image
point: 0
Place action under:
action Pig >Destroy
148
Meeting 12 - Particles and Next Stage
NEXT STAGE
Now, we will try to make the next level stage for your CannonBird
game!
STEP 1
Make a new variabel and rename “Pig”
Set Initial value > 4
This variable is made to store the values of the stage.
Stage 1 values 4 according to the number of the Pigs in the game.
149
Meeting 12 - Particles and Next Stage
NEXT STAGE
STEP 2
Duplicate Layout 1
And then, in duplicate result (Layout 2)
Add:
- A few Blocks
- 1 TNT
- 2 Pig
STEP 3
Make a new event Add action
System System
> On start of layout > Set value
> Variable: Score; Value: 0
This coding will make the score back to 0 every time the layout
changes or when the player enters a new layout.
150
Meeting 12 - Particles and Next Stage
NEXT STAGE
STEP 4
To be able to compare the variables we need sub event.
A sub event is an additional condition that will run only if the main
condition is met/fulfilled.
Right click on the gray field under the Bird on collision with Pig event
Select Add
> Add sub-event
> System
> Compare Variable
> Score = Equal to Pig
151
Meeting 12 - Particles and Next Stage
NEXT STAGE
STEP 5
Add action to the sub-event
Action 1: System > Wait > 1.0 second
Action 2: System > go to next/previous layout > Next
Action 3: System > add to > Variable: Stage; Value: 2
This code makes the layout change when the score value equals to the value
of the stage (the stage value equals to the number of pigs, which is 4)
Every time the layout changes, the stage value will increase by 2 from the
previous stage (the stage value at level 2 is 6 according to the number of the
pigs in that level).
STEP 6
Add Winn Layout
Right click on the layout
> Add layout
> Add layout only
Set layout size to 854x480
Add Background
Add text: “Congratulations! You win the game!”
Set the alignment to make the text appear on the center of the layout.
Don’t forget to adjust the size and font too.
152
Meeting 12 - Particles and Next Stage
EXPLORE
1. Change the action of the TNT; remove the Fire spawn and
change it to particle for the TNT!
2. Add a few more levels in your game! Remember, every time you
level up there will be some more additional Pigs!
4. Now let’s change the value of the particles into 10 and see what
happens to the Particles.
153
Meeting 12 - Particles and Next Stage
Answer: __________________________________________
____________________________________________________
154
MEETING 13
PICK COLOR
AND TRACE
What are we going to learn today?
Getting to knoe Pick Color tool
155
Meeting 13 - Pick Color and Trace
PICK COLOR
The way to use PICK COLORS is very simple. You just need to point the
cursor to the color sample in the desired part of the image, then click on
that area.
Next, the selected color you choose will be automatically applied to your
object.
Easy, right?
Let’s continue today’s lesson by making a star and give it some glow
effect as the detail.
156
Meeting 13 - Pick Color and Trace
BEZIER CURVE
STEP 1
1
Activate the bezier
4 curve, then click in
order 1,2,3,4,1 so
that it forms a picture
2 like the one on the
side
3
STEP 2 1
STEP 3
Use Edit Path By Nodes to
curve the Lines
157
Meeting 13 - Pick Color and Trace
NODES
158
Meeting 13 - Pick Color and Trace
TRACE ON!
STEP 1
Import Plane images into inkscape
by selecting File > Import (CTRL+I)
> OK
STEP 2
In the Fill and Stroke tab,
set the Opacity into 50%
to make it easier to see the
tracing line.
159
Meeting 13 - Pick Color and Trace
TRACE ON!
STEP 3
Do the tracing on parts of the plane
Trace only on one side, then color the part that you have drawn
Use the pick color tool to get the same color as the example or you can
also choose the color you want
STEP 4
Group your images, then
duplicate so that you have 2
similar images
160
Meeting 13 - Pick Color and Trace
TRACE ON!
STEP 5
161
Meeting 13 - Pick Color and Trace
CHALLENGE
162
Meeting 13 - Pick Color and Trace
What is Tracing?
Answer : __________________________________________
____________________________________________________
163
MEETING 14
DESIGN
EXAM
What will we learn today?
Design test for Advance 1
164
MEETING 15
PROGRAMMING
EXAM (1)
What will we learn today?
Programming test for Advance 1
165
MEETING 16
PROGRAMMING
EXAM (2)
What will we learn today?
Programming test for Advance 1
166
ADVANCE 2
MEETING 1
167
Meeting 1 - Draw with Grid and Bezier Curve
REMEMBER ME ...
Path Division :
Path Difference :
Random Tree :
168
Meeting 1 - Draw with Grid and Bezier Curve
GRID
In this meeting we will draw the Space ship using the grid as a guide to
make it easier for us to draw
STEP 1
Activate Page Grid (#) to help you draw by
clicking the menu: View > check on Page
Grid
STEP 2
Set the grid size in
File > Document
Properties > Grid
STEP 3
1 Select Bezier Curve in the Toolbox
Click once on the canvas from point
1 and then move mouse pointer to
point 2 then click again. Continue
the steps until point 6 and go back to
2 6 point 1.
4
3 5 Set Stroke 1px
169
Meeting 1 - Draw with Grid and Bezier Curve
STEP 4
Add a window on the plane
1 Same as the previous step, start from
point 1 until 5 and then go back to
2 5 point 1.
3 4
STEP 5
Make the shape beside using the same way in
from the previous step.
Draw > Duplicate > Flip
170
Meeting 1 - Draw with Grid and Bezier Curve
STEP 6
STEP 7
Next, add some jet flames using Tools Rectangles with curved
ends.
171
Meeting 1 - Draw with Grid and Bezier Curve
Click Here
and then drag down
172
Meeting 1 - Draw with Grid and Bezier Curve
STEP 1
We continue by creating a Plane for the enemy. Use Polygon Tool to
make the body of the plane in the shape of a hexagon.
Choose Polygon Tools and
set Corners: 6
Click and drag on the canvas until
a shape of hexagon appear. R = 221
set into Size 45px X 60px G = 85
Stroke 1px B = 255
A = 100
STEP 2
Make 3 hexagons with the size of each as follows: 14px X 16px,
Stroke 1px
STEP 3
Make a wing that is proportional to the body of the plane.
1
R = 204
G = 0
B = 255
A = 100
2 3
After that, duplicate the wing and flip it horizontally.
Connect to the body of the plane and place it behind the body.
173
Meeting 1 - Draw with Grid and Bezier Curve
STEP 4
Add some tubes and rectangular objects with size 6px X 16px and
stroke 1px to decorate the wings and as the weapons.
R = 136
G = 0
B = 170
A = 100
STEP 5
For the final touch, we need to make the flame using some circles,
make 3 circles in the different sizes.
1. 10px X 42.500px (Red)
174
Meeting 1 - Draw with Grid and Bezier Curve
CHALLENGE
Try to make the costumes for the plane sprite that you just made!
Create 4 airplane frames with different colors
175
Meeting 1 - Draw with Grid and Bezier Curve
ROTATION
Example
In Inkspace, we need to select the object first and then click Rotate icon
in the Control Bar in order to rotate it.
1 2 3 4
3 Flip horizontally
4 Flip vertically
176
Meeting 1 - Draw with Grid and Bezier Curve
EXPLORE
177
Meeting 1 - Draw with Grid and Bezier Curve
RESCALE
To Scale it, you just need to select and object and open the Transform
(SHIFT+CTRL+M) panel and choose Scale menu.
Set the unit in pixel and then set the value according to how big or how
small you want to scale the object,
Click apply to set your setting.
95px X 93px
125px X 122px
178
Meeting 1 - Draw with Grid and Bezier Curve
We will make WIN & GAME OVER Popups These Popups will be useful
when you win the game or lose in the game and they will appear as a
sign.
STEP 1
STEP 2
179
Meeting 1 - Draw with Grid and Bezier Curve
STEP 3
Add 3 stars under “YOU WIN” text to
complete the look.
STEP 4
Add “GAME OVER” to the duplicated square
without adding the stars.
180
Meeting 1 - Draw with Grid and Bezier Curve
181
MEETING 2
GLOWING
SPRITESHEET
What are we going to learn today?
Making some details in the object
Making Spritesheet
182
Meeting 2 - Glowing Spritesheet
GLOWING EFFECT
STEP 11
STEP
Make 2 star objects with Spoke Ratio 0,380
STEP 2
Select one of the stars and add a different color such as blue, green, or
red.
183
Meeting 2 - Glowing Spritesheet
GLOWING EFFECT
STEP 3
Next, open Fill and Stroke panel, set BLUR into 5% and the opacity to
80% to the star that you just recolore. The star will now look like below.
STEP 4
Next, open Fill and Stroke panel, set BLUR into 5% and the opacity to
80% to the star that you just recolore. The star will now look like below.
184
Meeting 2 - Glowing Spritesheet
STAR TEXTURE
STEP 1
Make a star using Star & Polygon Tool
To add stroke:
• select the star object that you want
to be added with color stroke
• right click on the red color in the
Color Palette below
• select Set stroke
185
Meeting 2 - Glowing Spritesheet
STAR TEXTURE
STEP 2
Change the stroke into
path
Use shortcut
CTRL+ALT+C or
choose in the: Menu
Path > Stroke to Path
This border (stroke) becomes an
independent object (path).
STEP 3
Activate Nodes
And then click 2X between the nodes to create a
new one.
Make sure to make new nodes inside the
path.
186
Meeting 2 - Glowing Spritesheet
STAR TEXTURE
STEP 4
187
Meeting 2 - Glowing Spritesheet
SPRITESHEET
STEP 1
STEP 2
Set the size of the star to 100px X 100px
You still remember the steps, right!
STEP 3
Duplicate the stars to 4!
188
Meeting 2 - Glowing Spritesheet
STAR TEXTURE
STEP 4
Arrange the 4 stars you made into the board size that you have prepared
Delete the green square so that only the star object remains
STEP 5
Select the four star objects and
export to .png
189
Meeting 2 - Glowing Spritesheet
STEP 1
Right click > Import Frames >
From strip
STEP 2
Adjust the number of vertical and horizontal cells > import
190
Meeting 2 - Glowing Spritesheet
CHALLENGE
Try to draw particles that you will use later in the game
You can use the Create Circle, Ellipse and Arcs tools to
create a circle with a size of 100px X 100px each
Don’t forget to hold down the (CTRL) key while drawing to form a
perfect circle
Remove the fill and set the Stroke Paint to make the image like
below
R = 255
G = 255
B = 0
A = 100
Batch export 4 objects that you have drawn into .png form
191
Meeting 2 - Glowing Spritesheet
What is Spritesheet?
Answer: __________________________________________
____________________________________________________
192
SELECT PLAYER
MEETING 3
AND
SHOOT RANDOM
METEOR
Apa yang akan kita pelajari hari ini?
Making scrolling background using tiled background
193
Meeting 3 - Select Player and Shoot Random Meteor
In previous lesson, we have made the space ship and other objects using
Inkscape. Now we will start using these sprites in the game.
194
Meeting 3 - Select Player and Shoot Random Meteor
TILED BACKGROUND
STEP 1
Rename this layout into
Game
Add Tiled Background in the
layout
Insert new object
> Tiled Background
> Click on the layout
> Load image from a file
> darkPurple
> Open
STEP 2
Transparent layer 0
Click on the layer 0
> look at the properties
> tick Transparent box
195
Meeting 3 - Select Player and Shoot Random Meteor
SCROLLING BACKGROUND
STEP 3
Copy and then paste Tiled Background
that you have made earlier and then
place it on top of the layout.
196
Meeting 3 - Select Player and Shoot Random Meteor
SCROLLING BACKGROUND
STEP 4
If the background under the layout at Y coordinate is more than
480, then the background will be returned back above the layout
at: Y = -480 coordinates.
Add event
> TiledBackground
> Compare Y
Add action
> TiledBackground
> Set Y
> -480
STEP 5
197
Meeting 3 - Select Player and Shoot Random Meteor
STEP 1
Add Spaceship Sprite; rename it to Player
Make the Player sprite to hace 3 different
animations
You can use the sprites you drew earlier
Make sure the Sprite is on Layer 1
198
Meeting 3 - Select Player and Shoot Random Meteor
199
Meeting 3 - Select Player and Shoot Random Meteor
STEP 2
Add new objects into
the layout
Right click
> Insert New Object
> Mouse
Add koding to make the player always follow the mouse cursor
In the Event
Add Action
> Player
> Set X
> Mouse.X
200
Meeting 3 - Select Player and Shoot Random Meteor
STEP 1
Add Laser sprite, add behavior: bullet
Set the lazer posisition to face right.
STEP 2
Add some effect while shooting
thge laser.
Add new Object
> Audio
In the project bar on the right, right click on the
Sounds folder
> Import sounds
> Import Audio
> sfx_laser2
201
Meeting 3 - Select Player and Shoot Random Meteor
STEP 3
Code to shoot the lazer
Add event > Mouse > Mouse button is down > Left
STEP 4
Show the laser with the function: Create Object
Add action
> System
> Create object
202
Meeting 3 - Select Player and Shoot Random Meteor
STEP 5
Add some sound effect every time you shoot the laser.
Add action
> Audio
> Play
Next we will make the player to be able to choose the plane to use
before the game starts.
STEP 1
Make a new layout and add new Tiled background object in Layer 0
Lock layer 0 dan and make a new layer on top of it
(Right click > Add layer at top)
On Layer 1 add Game Title and Player Select button
203
Meeting 3 - Select Player and Shoot Random Meteor
PLAYER SELECT
STEP 2
Add a new layout, name it to PLAYER
layout and place it between HOME and
GAME layout
add a Background to the Layer 0 and
connect that layout to Event sheet 1
Add coding so that hen we Click Player
Select > go to PLAYER layout
STEP 3
Add Layer 1
Add a sprite and name it
PlayerOption on Layer 1 with 3
animation as wehn you make
the animation for Player
204
Meeting 3 - Select Player and Shoot Random Meteor
PLAYER SELECT
STEP 4
Copy Paste Sprite PlayerOption to 3 and place it next to each
other
To change the Costume we need to set the Initial animation in the
properties bar as follows:
205
Meeting 3 - Select Player and Shoot Random Meteor
PLAYER SELECT
STEP 1
In the Event sheet 1,
add a Global variable
with type string
String Variable is a
variable used to
store string value
(alphabet characters)
STEP 2
Coding to make PlayerDisplay change color according to
PlayerOption option
206
Meeting 3 - Select Player and Shoot Random Meteor
PLAYER SELECT
Add Action
> System
> Set value
Try to play it and see if you can choose your player in the PLAYER
layout
STEP 3
Coding to move to Game Layout when clicking Play button
207
Meeting 3 - Select Player and Shoot Random Meteor
PLAYER SELECT
STEP 4
Also code to place the player in the position 400,400
STEP 5
Code to make the Player on the GAME layout the show the same color
as selected in PLAYER layout when played
On On start of layout Event, add Action:
> Player
> Set Animation
Try to play your game starting from HOME until GAME layout
Can you play the game using a the different player?
208
Meeting 3 - Select Player and Shoot Random Meteor
RANDOMLY APPEAR
STEP 1
In the GAME layout, add Meteor sprite with
several frames.
In the Animation Properties set Speed to 0
Place the meteor outside the layout on the
left or right side and add Rotate behavior.
STEP 2
Continue with randomly show the Meteor every 5 seconds at X
position.
STEP 3
Add action
> System
> Create object
> X: random(68,700)
Y: -50
209
Meeting 3 - Select Player and Shoot Random Meteor
RANDOMLY APPEAR
Random has the same function as the Random Pick on Scratch, which is
to randomize numbers according to a certain range.
Now, we need to randomize the place where the meteor will appear
horizontally, which is at the X coordinate ranging from 68 - 700 starting
the meteor at the top of the layout, which is at the coordinate: Y=-50.
STEP 4
Now make the meteor move from top to bottom by 1 pixel at a
time
210
Meeting 3 - Select Player and Shoot Random Meteor
Why random(5)?
because we have 5 frames of meteor counting from 0 to 4.
To count the frames we start from number 0 not from 1
211
Meeting 3 - Select Player and Shoot Random Meteor
212
MEETING 4
LIFE, SCORE,
AND FAMILY
FEATURE
What are we going to learn today?
Using Font Sprite for the Score and Life
213
Meeting 4 - Life, Score, and Family Feature
STEP 1
Add global variables and name them Life and Value : 3
Add a new action in gthe event On start of layout
> System
> Set value
> Variable : Life
> Value : 3
STEP 2
Show the life variable using Sprite font
Place it on top right corner of the layout by:
214
Meeting 4 - Life, Score, and Family Feature
STEP 3
STEP 4
Add Coding to show Life Text in the event Every Tick
215
Meeting 4 - Life, Score, and Family Feature
PARTICLES
We will add coding for the Player so that when it touches a meteor it will
be destroyed and become a particle followed by reducing life by 1
If the Player still has Life remaining, it will respawn again to continue the
game.
STEP 1
Add Particles into the layout.
Insert New Object > Particles
Place it outside the layout.
216
Meeting 4 - Life, Score, and Family Feature
SPAWN PARTICLES
STEP 2
The particle sprite will look like this.
Set the particle size to 50x50
STEP 3
Add coding: when touching Meteor, Player will be destroyed.
In the same event, Add Action Player showing Particles:
Add Action
> Player
> Spawn another object
217
Meeting 4 - Life, Score, and Family Feature
RESPAWN PLAYER
STEP 4
Add a new action to reduce the player’s life
> System
> Subtract from
> Life : 1
STEP 5
As long as there is still Life remaining, the Player will respawn and
continue the game even if it is destroyed by a Meteor
Add a sub event and action to respawn as long as the life
remaining is more than 1
And then add another sub event to make the player disappear
when there is no longer remaining life
Code to make the Player respawn with the selected costume and
also to return the animation of the Plane to default ketika when
winning or losing.
218
Meeting 4 - Life, Score, and Family Feature
CREATE ENEMIES
Have you ever played a game where the enemies move towards
the player?
Now, we will create an Enemy Plane that moves towards the player using
Action : Set angle toward position
STEP 1
STEP 2
Code to make the Plane Enemy appears every 2 seconds at
random horizontal position.
Add: Event
System
> Every X seconds
>2
Add: action
System
> Create object
219
Meeting 4 - Life, Score, and Family Feature
CREATE ENEMIES
STEP 3
Code to make the Enemy Plane move towards player’s coordinates.
Add action
> Enemy Plane
> Set angle toward position
So the enemy will appear and point towards the player and also
will move towards the player.
STEP 4
Coding agar Enemy muncul dengan kostum yang berbeda seperti
yang kamu lakukan pada meteor
220
Meeting 4 - Life, Score, and Family Feature
USING FAMILY
When the Player touches Enemy1, The player will be destroyed into
particles and will reappear if there is still life remaining
This Event uses the sama action as when the Player touches the
Meteor
For the objects with the same Action, they can be grouped into a
family so that e don’t need to repeat the similar codes.
221
Meeting 4 - Life, Score, and Family Feature
FAMILIES FEATURE
STEP 1
In the project bar right click in the
Families folder > Add family
STEP 2
Click on the object that will be grouped into 1 family
> click Add >>
Add all the enemies in the Family and the click OK.
Rename the Family 1 to ENEMIES.
222
Meeting 4 - Life, Score, and Family Feature
FAMILIES FEATURE
STEP 3
Change the coding in the event Player on collision with enemy by
tight click on theevent
> replace object
> Meteor
> Enemies
STEP 4
Your coding will look like this
Try to play your game and see if the coding is running
appropriately as you program it.
223
Meeting 4 - Life, Score, and Family Feature
SPRITE FONT
We will use Sprite font to display the score in the shooter game!
STEP 1
Add global variable Score, Value: 0
Set to 0 when the layout starts.
STEP 2
Add Event when the Lazer touches Enemy
Add Action
* Score +1
* Lazer Destroy
* Enemy Destroy, show Particle
* Audio sound: “destroy.webm”
STEP 3
Add new object
> Sprite Font
> Insert
> Add on the layout
> Close
224
Meeting 4 - Life, Score, and Family Feature
SPRITE FONT
STEP 4
STEP 5
Code to show Score in the Sprite font
Add action pada event Every tick
> Sprite font
> Set text
> “SCORE “ & score
225
Meeting 4 - Life, Score, and Family Feature
EXPLORE
Let’s do an exploration with the Enemy and Sprite fonts that we just
studied!
Add Action:
Enemy
> Set speed
> 300
226
Meeting 4 - Life, Score, and Family Feature
227
MEETING 5
POWER-UP
ITEMS
What are we going to learn today?
Adding Items in the Game
228
Meeting 5 - Power-up Items
Life pill is an item that can increase the number of player’s live.
Let’s open again your Shooter game file that you have created in the
previous meeting.
229
Meeting 5 - Power-up Items
SHIELD ITEM
STEP 1
Add Shield item sprite, and then add
behavior: Sine with this setting as the
example beside:
And then place the shield item outside the layout
on the left or right side.
STEP 2
We are going to make the shield item move downward 3 pixels each
time.
To the Every tick event, add action:
> Shield item
> Set Y
> Self.Y + 3
STEP 3
Create shield item every 30-60 seconds randomly on the X
coordinate (Horizontal)
Add action
> System
> Create object
> Shield_Item
As follows:
230
Meeting 5 - Power-up Items
SHIELD ITEM
STEP 4
Add Shield sprite and give Behavior:
STEP 5
When the player obtains Shield Item, the item will disappear
And the the Shield will appear for 10 seconds.
231
Meeting 5 - Power-up Items
SHIELD ITEM
STEP 6
Make a shield to follow player’s coordinates by:
Add new action in the event: Every tick
> Shield
> Set position to another object
> Player
STEP 7
Code to make when touching shield
232
Meeting 5 - Power-up Items
POWER SCORE
STEP 1
To the event: Every tick, add action:
> Power score
> Set Y
> Self.Y + 3
STEP 2
Create Power Score every 50-60 seconds randomly on the X
coordinat (Horizontal)
Add action
> System
> Create object
> PowerScore
Add a code so that when the player obtains the power score,
Power Score disappears and score changed by 5 point
233
Meeting 5 - Power-up Items
STEP 1
To the event Every tick, add action
> Power score
> Set Y
> Self.Y + 3
STEP 2
Create Life Pill every 40-50 seconds randomly on the X coordinat
(Horizontal)
(Horizontal)
Add action
> System
> Create object
Code so that whenever the player gets a Life Pill, Life Pill
disappears and Life changed by 1
234
Meeting 5 - Power-up Items
CHALLENGE
1. The game will start with the Shield active for 5 seconds; after
5 seconds, it will flash for 1 second and then disappears.
235
Meeting 5 - Power-up Items
Answer: __________________________________________
____________________________________________________
Answer: __________________________________________
____________________________________________________
236
MEETING 6
INSTANCE
VARIABLE AND
GAME OVER
What are we going to learn today?
Adding Enemy using Instance Variable
237
Meeting 6 - Instance Variable and Game Over
The enemy that we are going to create will have Instance Variable
“Life” . It means the player needs to shoot them more than one time to
destroy them.
This enemy will also shoot once when it appears.
STEP 1
Add one shoot enemy sprite to the GAME layout and then
place the sprite outside the lay out on the left/right side.
Add Laser enemy sprite to the GAME layout and then place
the sprite outside the lay out on the left/right side.
STEP 2
One shoot enemy will appear when the score is equal or more than
20.
238
Meeting 6 - Instance Variable and Game Over
STEP 3
Make the Enemy2 and Laser Enemy to move downwards
Add the code to the Event Every Tick
STEP 4
Make the Enemy2 to appear with Random Costume
You can also add Enemy2 and LaserEnemy into the Family to make
the enemy destroy when touching with these enemies.
Right click to the Family “Enemies” an d select edit Family
239
Meeting 6 - Instance Variable and Game Over
STEP 5
Give name the variable “enemy_
life” with initial value 4 to create
the enemy to have 4 lifes (must
be shot by the laser 4 times to
destroy)
STEP 6
Add coding to make when the Laser touches One shoot enemy, laser
will destroy and enemy_life decreased by 1
Add action to the sub event to make the score added by 2 when
One shoot enemy destroyed
240
Meeting 6 - Instance Variable and Game Over
STRONG LASER
STEP 1
Add Laser Strong sprite in the GAME layout
Create with frame and Animation properties as follows:
The rare lazer will appear when the score is equal to or more
than 50.
Add action
destroy Laser player
241
Meeting 6 - Instance Variable and Game Over
STRONG LASER
STEP 2
Add sub event to shoot with 0.2 seconds interval.
Add action create object to shoot Rare laser
STEP 3
In the every tick event,
add the following
action to shoot the
laser.
242
Meeting 6 - Instance Variable and Game Over
GAME OVER
STEP 1
Pada event sheet Game
Tambahkan variable baru “highscore”
243
Meeting 6 - Instance Variable and Game Over
HIGHSCORE
Add Event
When value score greater than highscore
Add Action
Value highscore become equal to the score value
STEP 2
Add layout baru > Add
event sheet
STEP 3
Activate the show grid and snap to grid in the layout to arrange
objects so that they are neatly positioned and can be placed in
the middle
For sprite text “SCORE 0”, “HIGH SCORE 0”, “GAME OVER !”, dan
button Replay put on Layer 1
244
Meeting 6 - Instance Variable and Game Over
HIGHSCORE
STEP 4
On event sheet Gameover
Add code untuk show
Score and Highscore
Add event
On start of layout
STEP 5
Add coding on Event Sheet Game Over
Add Event
when button Replay clicked then move to layout “GAME”
STEP 6
Add Coding on event sheet Game
On sub Event
When Life Player < 1
Add Action
go to layout GameOver
245
Meeting 6 - Instance Variable and Game Over
STARDUST
246
Meeting 6 - Instance Variable and Game Over
STARDUST
Play your START layout and see how your particles will look.
247
Meeting 6 - Instance Variable and Game Over
CHALLENGE
248
Meeting 6 - Instance Variable and Game Over
Answer : __________________________________________
____________________________________________________
Answer : __________________________________________
____________________________________________________
249