Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic coding… with TouchDevelop!!

Similar presentations


Presentation on theme: "Basic coding… with TouchDevelop!!"— Presentation transcript:

1 Basic coding… with TouchDevelop!!
Let’s do some gaming! Based on Lawrence Snyder’s slides for UW-Seattle. This notice serves as permission for their use for teaching in public or private (not for profit) schools. © 2014

2 TouchDevelop From Microsoft Research Technical (geeky terms):
An easy-to-learn platform for developers of all expertise levels to build their own video games and apps! Technical (geeky terms): A touch-first IDE built in Type Script Managed Language TouchDevelop contains a gallery of Libraries & Functions!  remember these?

3 Create apps with TouchDevelop

4 Development Support Visit touchdevelop.com for help & tutorials

5 The TouchDevelop Environment

6 Try it yourself!

7 T.D.’s Language The scripting language is statement oriented
Statements are executed sequentially Control flow constructs include if-statements, for and while loops, and functions (actions)

8 Sample Script action main ( ) // Finds songs not played yet.
var found := 0 var songs := media → songs for each song in songs where true do found := found + ▷ display song(song) ("Songs played with this app: " ∥ ◳ played) → post to wall ("Songs never played: " ∥ found) → post to wall private action display song ( song : Song ) returns ( result : Number ) // Post a song to the wall if not played yet and returns 1 // otherwise returns 1. if song → play count = 0 then song → post to wall result := 1 else result := 0 event active song changed ( ) // Increment song played counter. ◳ played := ◳ played + 1 event shake ( ) // Pauses and resume playing. if player → is playing then player → pause player → resume data played : Number

9 Overview of the program
Example Functions- Main() and Shoot(): Where are the names of the functions located in both cases? between action and (…) Where are the bodies of the functions located? between “()“ and “end”

10 Game Loop + Stuff Order: Check out the “art” hub To Quit:
Main() runs once (and only once!!) Gameloop() continues forever! Check out the “art” hub There are a lot of images, audios stored in TouchDevelop’s libraries! To Quit: Click the back button in the top corner to exit the application.

11 Play a TouchDevelop App!

12 Make sense?

13 Coding is ALL detail!! Remember…
int defines an integer (0, 1, 2, -1, -2 …) Int or Integer are undefined Code only goes between brackets or parentheses

14 Make your own Flappy Bird game!

15 Question!

16 Background! Do you remember how to change the background?
Type this line: wall → set background picture(✿ background) Where did it go? In between action main() and end action

17 Error checking … Type something wrong …
and you will receive an error message:

18 Scopes and Variables

19 Variables: Declare Within the “Function Scope”

20 Things to try Test out all the tutorials on the site, and once you feel confident, go ahead and make your own apps!


Download ppt "Basic coding… with TouchDevelop!!"

Similar presentations


Ads by Google