Professional Documents
Culture Documents
Technoapp2 Book
Technoapp2 Book
Student Workbook
For AppShed
TechnoKids Inc.
TechnoKids is a trademark of TechnoKids Inc. © Copyright 1993 – 2013. All Rights Reserved.
This book may not be duplicated in whole or in part without the expressed written consent of the
publisher, except in the form of brief excerpts or quotations for the purposes of review. The
information contained herein is for the personal use of the reader and may not be incorporated in
any other books, databases, or any kind of software without written consent of the publisher.
Making copies of this book or any portion for any purpose other than your own is a violation of
International copyright laws.
The author and publisher of this book have used their best efforts in preparing the book and the
activities contained in it. These efforts include the development, research, and testing of the
theories and programs to determine their effectiveness. The author and publisher make no warranty
of any kind, expressed or implied, with regard to these programs or the documentation contained in
this book.
The author and publisher shall not be liable in the event of incidental or consequential damages in
connection with, or arising out of, the furnishing, performance, or use of the programs, associated
instructions, and/or claims of productivity gains.
Trademarks
Trademarked names appear throughout this book. Rather than list the names and entitles that own
trademarks or insert a trademark symbol with each mention of the trademarked name, the
publisher states that it is using the names for editorial purposes only and to the benefit of the
trademark owner, with no intention of infringing upon that trademark.
TECHNOKIDS INC.
Session 1:
Game maker basics
In this session, you will get basic knowledge of appshed Game maker
and how important it is. Its importance lies in its ease of handling. So,
we will explain how the Game maker IDE works and what objects can
be used and combined to make it a game.
TECHNOKIDS INC. 6
TechnoApp SESSION 1
The Game Tools is the panel on the right that includes all the available tools
(objects) that can be included in your games.
Setup
Sprites
Events
Graphics
Functions
TECHNOKIDS INC. 7
TechnoApp SESSION 1
2.2 Templates
Game Maker provides many Templates to help build games quickly and with
fewer errors.
The templates are available from a tab/section within the Tools Panel on the
right of the IDE.
TECHNOKIDS INC. 8
TechnoApp SESSION 1
View Objects:
Shows all the game objects. It enables you to add more objects from the
Game Tools (panel).
Play Game:
Allows you to play the game within the IDE.
This includes Game Controls ; Stop, Start, Pause and
Sleep the game.
eval(app.game.run());
preload()
create()
update()
redmder()
TECHNOKIDS INC. 9
TechnoApp SESSION 1
As shown in the image, the functions can be empty. Game Maker will add
code to these functions behind the scenes every time you add an object to
your game.
. Conclusion
Now you know how the game maker IDE works, how to control the
objects, and how to use the tools that make the process easier.
And also, what are the consequences and rules that control it which
make it an application that allows you to create your own game
TECHNOKIDS INC. 10
Session 2:
Breakout Game
In this session, you will learn how to start your first game. so, you are
going to build a game very similar to the popular classic game
breakout and fix some bugs and issues that may occur.
You’ll notice that all of App Builder tools are now replaced with game maker
tools.
Click Save
TECHNOKIDS INC. 12
TechnoApp SESSION 2
Click Preload.
Click Save
From Play Game Menu, click Play. A
loading screen shows as shown in the image which means the preload
is working.
Click Image
TECHNOKIDS INC. 13
TechnoApp SESSION 2
Here you'll see all the properties of the object that you are adding as well as
the image used.
Click Save
The block is sitting at the top left of the screen. If you want to move its position,
you can do that by editing its properties on the properties sheet:
This is where all the customizable properties are. At the top of the screen, you
can see the image used on this object which is a brick from the breakout
game - that you can change it.
Now towards the bottom of the screen, you have all these different
properties, there are main properties that affect the brick as a whole and
deal with things and body properties which are just dealing with things
related to the object's body.
TECHNOKIDS INC. 14
TechnoApp SESSION 2
Click Sprite
Save button
Click Play
There is now a blue ball at the bottom of our
screen. When click, it should shoot off and flies
through the brick and then off screen.
TECHNOKIDS INC. 15
TechnoApp SESSION 2
Click Pointer
Click Save
Play Game
Click on the blue ball
TECHNOKIDS INC. 16
TechnoApp SESSION 2
The values were initially 0 which means the ball wouldn’t bounce off. By
making these values 1, we are giving instructions that the ball will bounce off
with the same velocity as it had before.
Click Sprite 1
Click Edit
Click Bounce under Body Properties
Change the X and Y values to 1
Click Save
Play Game
You should notice that the ball now bounces off all the walls
You want the ball (sprite1) to bounce off the paddle (player). This should
happen every time they overlap each other.
Click Overlap
Click Save
Click Play Game
The ball now bounces off the paddle. This overlap changes the velocity of the
ball, sending it upwards. It simply reverses the y-velocity.
Click Create
Click Save
TECHNOKIDS INC. 17
TechnoApp SESSION 2
Click Save
Start Game
You'll now notice that the ball bounces off the Top, right and left world
bounds but falls through the Bottom.
Click Collider
Click Save
Play Game
TECHNOKIDS INC. 18
TechnoApp SESSION 2
Just like that all of issues are resolved! The ball now breaks the brick when we
hit it. What we did is add a collision between ball and the image.
This collision is similar to the one we added between the ball and the world
bounds.
You'll see if you edit the collision, we added that it has a collision set between
Object A which is the Sprite (Ball) and Object B which is the Image (brick).
TECHNOKIDS INC. 19
TechnoApp SESSION 2
Now, we’ve got most of the basics of the game working perfectly but it's
looking a little plain. We can fix this by adding some Background Images .and
we are going to do this by adding a Tile Sprite.
Click TileSprite
Click Save
Play Game
We only have one block in our game! This makes it a little too easy to win the
game so to change this we are going to add some more. Now you could
manually go copy, paste and change the position of each block but this
takes way too much time.
To save time we are going to use a Static Group. Using a static group allows
you to create a grid of blocks.
Static Group
Save
Now all the properties that allow you to edit the grid of block are in the
properties of this static group that we created.
TECHNOKIDS INC. 20
TechnoApp SESSION 2
Now you'll see the properties for this object are a little different to the other
ones we have used, this is because this object is a group which means all the
properties in it are passed down to the other objects that are in this group.
Scroll down and you should see the options Cols and Rows. These
control how many rows and columns there will be.
If we set both to 2 there will be 4 blocks.
Right now, it's set to 5 and 4 which means there
are 20 blocks. This can be used to make each
level more difficult by adding more blocks.
Place this object below the gameconfig
object
Click Save
After we added the static group object, you should make the image1 object
hidden
Click Image1
Click Edit
tick the checkbox hidden
Save
Still there?
Click Image1
Click Move
Drag the image object below the static group
object
Click Done
Of course, you need a sprite sheet to catch the ball from falling down to win
the game, so let's add sprite sheet object
TECHNOKIDS INC. 21
TechnoApp SESSION 2
Also, you should add an object to control the sheet object called Joystick
Click joystick
Click Save
Play Game
Finally, the sheet start moving when we drag it left and right side.
Click update
Click Save
Play Game
Click Text
Click Save
Play Game
The score object should located be at the top of the game, is it there?
If it does not appear, you need to move the object above the others
TECHNOKIDS INC. 22
TechnoApp SESSION 2
Conclusion
Finally, we learned how to make a fully functioning and customizable
game using AppShed Game Maker! Which is a mix of programming and
drag and drop features helping everyone make awesome games while
still learning about programming.
TECHNOKIDS INC. 23
Session 3:
Phaser 3
In this session, you will have a basic knowledge about the Phaser 3
HTML5 framework, what it is and how to use it.
The HTML <canvas> element is used to draw graphics, on the fly, via
JavaScript, and it is only a container for graphics. You must use JavaScript
to actually draw the graphics.
Also, Canvas has several methods for drawing paths, boxes, circles, text,
and adding images.
TECHNOKIDS INC. 25
TechnoApp SESSION 3
TECHNOKIDS INC. 26
TechnoApp SESSION 3
No, this doesn't mean you can't build your game in a structured way; far
from it. All it means is that we don't enforce it. It also means that Phaser is
internally very easy to hack around with.
Images
Sprite Sheets (fixed-sized frames)
Texture Atlases (including Texture Packer, JSON Hash, JSON Array,
Flash CS6/CC, and Starling XML formats)
Audio files
Data Files (XML, JSON, plain text)
JavaScript files (so you can part-load your games or JS-based
resources)
Tilemaps (CSV and Tiled map formats)
Bitmap Fonts
We routinely export texture atlas files from Flash directly to our Phaser games,
and it supports fully trimmed atlases. Assets can be part-loaded, cached, and
pulled from different URLs (for CDN support), and you can even turn any sprite
into a progress bar with a single line of code.
TECHNOKIDS INC. 27
TechnoApp SESSION 3
Web Audio allows for proper node-based audio support, with multiple
channels, node routing, and all kinds of effects. So Phaser fully supports Web
Audio.
Phaser will swap between the two depending on the device capabilities
and also includes unlocking the audio sub-system automatically for you,
something that catches out a lot of first-time mobile devs!
TECHNOKIDS INC. 28
TechnoApp SESSION 3
Phaser supports keyboard, mouse, touch, MS Pointer (now Pointer under IE11),
and combinations thereof. For example, on Windows Surface devices you
could swap between using a mouse and touch, or indeed use both together.
Using a world-based quad tree to help minimize collision tests, you can
achieve decent results quickly with little processing time required.
However, we understand that this won't suit all types of games, so the physics
system is easy to replace and none of the physics properties are bound to
actual sprites (but rather to a body component), so can be swapped out for
the likes of Box2D or p2.js.
TECHNOKIDS INC. 29
TechnoApp SESSION 3
3.7 Plugins
Phaser provides features for all kinds of games but without causing the core
library to explode in growth. So, they have built a plugin system.
Phaser plugins can register themselves with the core framework, be updated
in line with the core game loop, and perform all kinds of useful additional
tasks.
Conclusion
In this session, we learned what Phaser 3 is, its benefits and how it works,
as well as what platforms it supports, as its importance appears from the
amount of features it provides.
TECHNOKIDS INC. 30
Session 4:
Making a mobile
game without coding
Here you will learn how to import a small game involving a player running and
jumping around platforms, collecting stars and avoiding baddies. While going
through this process, you'll explain some of the core features of the
framework.
1. View the Console in the browser. The Phaser version is written to the
console when the source code loads.
Click Right click, Inspect
TECHNOKIDS INC. 32
TechnoApp SESSION 4
TECHNOKIDS INC. 33
TechnoApp SESSION 4
Templates
search for "game" in the search bar
You'll then see a bunch of different options (these are all different games at
different difficulty levels) we are going to click on:
Once you click, use you should see your app suddenly be filled
with a bunch of images and names, these are all aspects of
our game. You'll see there's a Pipe, character, platforms, and
backgrounds which will later make up the world of the game.
At the very top, you should see a big start game button, go
ahead and double-click it to start the game.
TECHNOKIDS INC. 34
TechnoApp SESSION 4
1 2
3 4
TECHNOKIDS INC. 35
TechnoApp SESSION 4
TECHNOKIDS INC. 36
TechnoApp SESSION 4
From To
Because the ground image has a width value along the width of our
game .
You have to change the size of the ground to fix the problem and make the
game more difficult. because if the player touches the ground, he loses the
game and he can't jump again.
TECHNOKIDS INC. 37
TechnoApp SESSION 4
Yes this may happen because there is another width property that must be
changed in the body properties section.
From To
if you want to change the size, you should change the width and height
value
If you want to change the position of the platform, you should change
the X and Y value
TECHNOKIDS INC. 38
TechnoApp SESSION 4
Why!!
To fix this, change one of the values and then all 4 can be seen.
Click platform 3
Edit
Change X value from 500 to 400
Change Y value from 400 to 320
Save
Play the game
From To
TECHNOKIDS INC. 39
TechnoApp SESSION 4
From To
TECHNOKIDS INC. 40
TechnoApp SESSION 4
You can replace it with a slightly larger image than the default image. You
can choose an image with dimensions of 1920 * 1200 to fill the screen and
remove the black section.
From To
TECHNOKIDS INC. 41
TechnoApp SESSION 4
Done
Bold style
Italic style
Save
From To
TECHNOKIDS INC. 42
TechnoApp SESSION 4
Click Publish
Start
share
QR Code
Web App (in the Share menu) opens the game in another tab.
You can copy this link and email it or type it into your phone.
TECHNOKIDS INC. 43
TechnoApp SESSION 4
Platform Game 6
Use
yes
Conclusion
At this point, you have learned how the game engine works,
how to get to these games and how to make the games more
custom by resizing and moving things. And just like that we've
built a very simple game and put it on our phone.
TECHNOKIDS INC. 44
Appendix A:
Contact Information
We want to be your partner in computer education.
TechnoKids Inc.
2097 Bates Common
Burlington, ON Canada L7R 0A5
information@technokids.com
support@technokids.com
www.technokids.com