Download presentation
Presentation is loading. Please wait.
Published byBarbara Pierce Modified over 8 years ago
1
Alice
2
Terms test 6:30pm Tuesday 8th April, 2003 MLT1 A - J PLT1 K - S PLT2 T - Z
3
Clipboard There is a clip board in the top right corner of the screen. You can drag and drop tags/expressions there to copy them Can drag from the clipboard to paste
4
The World Object The World object is special Its variable list contains properties for how the World will look Its questions list is a toolbox for general programming use
5
World Variables Atmosphere Colour – Changes the background colour of the world Ambient Light Colour – The default light, of course you can add your own Fog Options – To add fog to your world Speed Multiplier – Controls the animation speed of your movie
6
Math Tags Actually boolean expressions Can right click boolean expressions to obtain some of these tags Dragging these tags is easier NB: a and b are placeholders
7
Boolean Logic Tags We have already looked at these Boolean operators NOT (!), AND (&&) and OR (||) The symbols used here are Java symbols (remember to turn on Java-like syntax) Again, can obtain these tags by right clicking
8
Time Many functions for working out what the time is getTimeElapsedSinceWorldStart() – very important for synchronisation and timing events
9
Mouse and Joystick Can find exact position of mouse or joystick Allows for precision mouse control Very useful in Games 40 35
10
Strings Manipulation of Strings Can add/concatenate Strings Can turn various variables into String objects E.g. numbers, objects
11
Advanced Math Many Math functions Min/max – return the minimum or maximum of these two values Abs – Take the absolute values (non- negative) value of this number Sqrt – Square Root Pow – a b Round – Round a to the nearest whole number
12
Random Numbers Can generate a random boolean or number A double is simply a real number Can select extra options by clicking more
13
DEMO
14
Questions vs Methods Methods Can carry out an action or animation Can call methods and change variables Returns nothing to the caller Questions Can change variables, but cannot call methods Usually calculates the answer to some question, but not necessarily Return data (answer) back to caller for processing Restricted to serial processing
15
DEMO
16
Vehicle property The vehicle property stores who you are “attached” to in the 3D world You move with your vehicle in the 3D world All sub-objects are attached to their parent objects We can detach these objects
17
DEMO
18
Lists/Arrays Lists and Arrays store many pieces of data A List allows you to add and remove individuals, whereas Arrays do not Arrays are more efficient to use, but cannot be structurally modified after creation (values can be changed) We cannot use For loops with arrays
19
For Loops We can process a List all in one hit using a For loop This allows us to carry out the same action on every item in the list Very useful when dealing with large numbers of variables
20
Events By creating a list of objects, we can allow users to move these objects around on the screen
21
DEMO
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.