Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scripts what’s in a script – basic language concepts Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including.

Similar presentations


Presentation on theme: "Scripts what’s in a script – basic language concepts Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including."— Presentation transcript:

1 scripts what’s in a script – basic language concepts 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 what is a script? o a script is an application that runs in touchdevelop o when published gets a unique script id http://www.touchdevelop.com /ynnp

3 what is in a script? o ▷ actions code invoked on script start or called from code o events code invoked when events are triggered o data persistent global variables o ✿ art colors, songs, pictures, … o libraries references to other scripts

4 ▷ actions o actions are composed of statements o statements are composed of expressions o actions can take parameters and return values o actions can be marked as private ☀ running actions with parameters automatically synthesizes UI

5 events o events are raised when predefined triggers happen shaking, song changes, camera buttons, touch o events are a special kind of action fixed arguments, no return values o events are executed atomically touchdevelop scripts are single-threaded

6 data o global variables accessible in all actions/events o saved across multiple script execution local variable are ‘forgotten’ o useful with events ☀ select a local variable and tap ‘promote’ to turn it into a global variable.

7 ✿ art o read-only global variables o mostly designed for game art images/sounds downloaded from the web o nice interactive color picker

8 libraries o call actions from other scripts (known as libraries) o code reuse between multiple scripts o we’ll discuss this later (advanced topic)

9 title o item 1 o Item 2 song→post to wall ☀ anecdote ☁ http://touchdevelop.com/velk (link to sample)http://touchdevelop.com/velk ► an exercise ✿ a reference ▷ actions, events, data, ✿ art, libraries


Download ppt "Scripts what’s in a script – basic language concepts Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including."

Similar presentations


Ads by Google