game development with touchdevelop
TRANSCRIPT
Sage Franch | @theTrendyTechie
Building a Game with
TouchDevelop
Meet Sage Franch | @theTrendyTechie
• Technical Evangelist– Interfacing with developers
– Bringing Microsoft’s technology to you!
• Proud geek and “Trendy Techie”– Find me online at my blog trendytechie.ca
• Advocate for equality in technology
• Student at Dalhousie University
Why TouchDevelop?
• It’s a snap to learn.
• You learn coding concepts without worrying about semantics.
• It makes building mobile games and apps easy.
• It runs on anything (laptop, desktop, tablet, phone).
• You can share your code and creations with friends.
• It’s free
• All you need is a browser.
Which browsers can I use?
• TouchDevelop is supported on the latest versions of most
browsers.
• To avoid a delay in your classes, make sure ahead of time that
the browsers are updated
• For a full list of supported browsers, see here:
https://www.touchdevelop.com/app/current.browsers
The Agenda
• TouchDevelop tour
• Important Coding Concepts:– Objects, Functions and Parameters
– Variables
– The TouchDevelop coordinate system
– Conditional statements
– On every frame
– Loops
• Play time! :D
• Resources for teaching and learning
touchdevelop.com
TouchDevelop Tour
build
testsave
sign in
build
testsave
sign in
What You Need to Know
Important Coding Concepts
Objects, Functions and Parameters
object function parameter
• Object: a representation of something in the game
• Function: performs an action on the object it is associated with
• Parameter: specifies the value of the function
Variables
• A variable holds data that can be used throughout a script.
• Every variable has a name, a type, and a value.
• A variable’s type describes the kind of data the variable can hold.– For example: A number, a string, a sprite
• In TouchDevelop, a variable’s type is determined when it is
initialized.
The TouchDevelop coordinate system
(0, 0) x axis
y axis
yIN
CR
EASIN
G1
2 3
4 5
6 7
…
Conditional Statements
A conditional statement is special code for making decisions based
on some condition.
So what’s a condition? Anything statement that can be either true
or false.
If I am hungry, then I eat.
The action taken if the condition is false.
The action taken if the condition is true.
Otherwise, I sleep.
The condition. (It’s either true or false.)
In code, conditional statements are also called if-then-else statements
Condition
Code to execute if the condition is true goes here.
Code to execute if the condition is false goes here.
BUT you have to pay attention to when the condition
is checked…
Computer games are a series of very fast frames
Frame 1 Frame 2 Frame 3
Frame 4 Frame 5 Frame 6
A game frame-by-frame
Use “on every frame” to perform checks continuously
Loops
A loop is a special tool in coding
that lets us write code once and
repeat it as many times as we’d
likeRepeat the following block of code X times:
End of repeated block
You get to specify this value.
Whatever code you put here
gets repeated X times.
Tells the program that any
code after this isn’t part of the
code to be repeated.
The syntax for a loop…
The number of times the code is repeated.
The code that will be repeated.Tells the program that any
code after this isn’t part of the
code to be repeated.
aka.ms/jetpackstarter
Let’s play!
So how do I get started?
It’s easy!
1. Go to http://www.touchdevelop.com
2. Click .
3. And .
Resources for Teaching and Learning
Two Recommended Formats
One-Day Event
• Provide students with a “half-
baked” game to fix and customize
• Jetpack Jumper prompted tutorial
• Estimated time: 2 hours maximum
Multi-Day Event
• Build a side scroller game from
scratch
• Use CODExist MVA as reference
• Estimated time: 6-12 hours
(flexible)
Pre-course checklist
• Will you provide students with devices or will they bring their
own?
• Do you have a reliable internet connection?
• If the students will be watching videos or working with tutorials,
have you asked them to bring headsets?
When teaching TouchDevelop
• Emphasize the excitement of coding
• Be prepared to handle students with different levels of coding
experience
• Make sure to leave time for customization
• Encourage students to share their games, both in show-and-tell
in person and online on social media
• Provide NEXT STEPS – how can they continue once the program
is over? Publish their game to app stores, build more games, etc.
TouchDevelop Resources
• Jetpack Jumper Tutorial with prompts: aka.ms/startcoding
• “Broken” Jetpack game without prompts: aka.ms/jetpackstarter
• Complete Jetpack Jumper: aka.ms/jetpackcomplete
• Hour of Code video: http://channel9.msdn.com/events/Hour-of-
Code/2014/LearningToCode
• CODExist: The Birth of Bot course on Microsoft Virtual Academy
(build a side scroller game from scratch):
http://www.microsoftvirtualacademy.com/training-
courses/codexist-the-birth-of-bot