Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to touchdevelop events reactive programming Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

Similar presentations


Presentation on theme: "Introduction to touchdevelop events reactive programming Disclaimer: This document is provided “as-is”. Information and views expressed in this document,"— Presentation transcript:

1 introduction to touchdevelop events reactive programming Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

2 introduction to touchdevelop events around you o tap on the shoulder turn head, say “hello”, shake hand o traffic light goes red hit the brakes o hear cool song dance, sing ►find 3 more events and reactions around you

3 introduction to touchdevelop events in phone o special action triggered by sensors or media player state shaking, orientation change active song changed, player paused, resumed o reacts by running the event code, i.e. executes the actions associated to the event

4 introduction to touchdevelop execution model o events run to completion before another event starts running events (and actions) never interleave o scripts with events automatically enter an event loop (“gameloop”) when an action started by the user ends o to stop the event loop, use time→stop user can stop script as well ✿

5 introduction to touchdevelop gameloop o event that triggers every 50ms o update the state of a game board : Board // a global board variable event gameloop … board →evolve board →update on wall

6 introduction to touchdevelop orientation o respond to orientation changes o phone face up/down, landscape left/right event phone face up player→resume event phone face down player→pause

7 introduction to touchdevelop shake o uses accelerometer to detect shake event shake media→songs→random→play

8 introduction to touchdevelop player events o active song changed notifies that a new song is playing o player state changed notifies that the player has started to play, or paused, or resumed, etc… event active song changed player→active song→post to wall

9 introduction to touchdevelop camera buttons o pressed, half-pressed, released events triggered by phone camera button

10 introduction to touchdevelop tap on … o tap event on wall elements o one event per element kind

11 introduction to touchdevelop empty space on wall o event that triggers when new space appears on the wall o typically happens when the user reaches the end of the wall content and allows to fill the wall with more data

12 introduction to touchdevelop title o item 1 o Item 2 song→post to wall ☀ anecdote ☁ (link to sample)http://touchdevelop.com/velk ► an exercise ✿ a reference


Download ppt "Introduction to touchdevelop events reactive programming Disclaimer: This document is provided “as-is”. Information and views expressed in this document,"

Similar presentations


Ads by Google