Alice - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Alice

Description:

Quantification: assigning values on a scale. 6. 1 Dimensional Space. Scale ... Car is behind the swan, who is in front of the penguin. 11. Two Dimensional Space ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 36
Provided by: academicco2
Category:
Tags: alice

less

Transcript and Presenter's Notes

Title: Alice


1
Alice
  • Chapter 3 61 - 75

2
Objectives
  • To understand Event Driven Programming
  • To understand three dimensional space, in Alice
  • To learn how to use events in Alice

3
Event Driven Programming
  • Events provide users control to manipulate
    objects in 3-dimensional space

4
Event Driven Programming
  • Event trigger
  • A condition causing an event to occur
  • Ex pressing the enter key
  • Event handler
  • Activated based upon a trigger
  • Ex object spins

5
1 Dimensional Space
  • A way of measuring something on a scale
  • Distance from a starting point (-1)
  • Direction negative or positive (negative)
  • -3 -2 -1 0 1 2 3
  • Quantification assigning values on a scale

6
1 Dimensional Space
  • Scale of measurement
  • Absolute direction an object is facing
  • Forward or Backward
  • -3 -2 -1 0 1 2 3
  • Only the race car is forward

7
1 Dimensional Space
  • Point of view in relation to other objects
  • Object Relative direction
  • Forward or Backward
  • -3 -2 -1 0 1 2 3
  • Only the race car is progressing backward
  • Green car is behind cat, race car is in front of
    cat

8
1 Dimensional Space
  • Point of view
  • Orientation location
  • absolute direction object-relative direc

9
1 Dimensional Space
  • Ideas of direction
  • Absolute
  • Known through a scale of measurement
  • Ex the cat is backward -1 0
    1
  • Object-relative
  • In relation to another object
  • Ex the cat is facing forward from the car

10
1 Dimensional Space
  • Ideas of direction
  • -3 -2 -1 0 1 2 3
  • Object relative position (in front and behind)
  • Car is behind the swan, who is in front of the
    penguin

11
Two Dimensional Space
  • Scales of measurement on a flat surface
  • Cartesian coordinates
  • (x, y) ordered pair on x and y axis
  • Dimension (x) is listed first
  • Ex age and height of siblings
  • (9, 4), (14, 5), (18, 6)
  • Examine the next slide

12
Two Dimensional Space
  • Scales of measurement on a flat surface
  • Cartesian coordinates
  • Ex age and height of siblings (9, 4), (14,
    5), (18, 6)
  • Height
  • Age

18, 6
14, 5
9, 4
13
Start Three Dimensional Space
  • Third axis
  • Height (z) above or below the plane
  • Ordered triplet
  • (x, y, z) orientation in 3-dimensional space

14
Three Dimensional Space
  • Euclidean space
  • Wrote about physical world geometry in
    dimensional space
  • This is Alice

15
Three Dimensional Space
  • Alices Euclidean 3D space
  • Six object relative directions
  • x right or left
  • y backward or forward
  • z down or up

16
Three Dimensional Space
  • Alices Euclidean 3D space
  • Six object relative positions
  • x right of or left of
  • y behind or in front of
  • z below or above

17
Events In Alice
  • Open the amusementPark world
  • Welcome screens examples tab
  • Notice the major event tiles
  • Camera arrow key controls
  • When the World starts .

18
Events In Alice
  • The top tile
  • Moving the camera

19
Events In Alice
  • Create a World level method
  • World tile
  • Create new method button
  • Name the new method

20
Events In Alice
  • Create a World level method
  • Drag a tile (Do Together) from bottom of Editor
    area over the new methods Do Nothing

21
Events In Alice
  • Create a World level method
  • Finish creating the new method
  • Drag methods from Details area into Do Together
    tile

22
Events In Alice
  • The event handler
  • Add the new method to the default event tile as
    the event handler
  • Select World
  • Drag the new methods tile over the World.my
    first method in the Events area

23
Events In Alice
  • Remove (delete) the world.my first method from
    the details area

24
Event Types
  • 9 types under Create New Event Button

25
Event Types
  • Choose any event (ex When the world starts)
  • New event tile appears

26
Event Types
  • Changing the form of the event
  • Run continuously (loop)
  • Right click the event tile background
  • Event menu appears

27
Event Types
  • Event menu choices
  • Delete
  • Change to
  • To change the form
  • Disable
  • Non functional to enabled

28
Event Types
  • Event menu
  • Change to
  • To change the form

Becomes
29
Event Types
  • While the world is running event tile
  • 3 different event handler positions (for
    methods) Begin, During, End

30
Event Types
  • The 3 handlers are also known as BDE
  • To establish the handlers
  • Drag method tiles into the BDE areas, over the
    ltnonegt

31
Event Types
  • When a key is typed event
  • Add controls or user interaction
  • Two parameters
  • Ex Trigger pressing a key
  • Ex Handler a method making an object turns
  • Examine the next slide

32
Event Types
  • Click anykey down arrow

Drag a method over Nothing.
When the World runs, a key is typed, and the
method runs
33
Event Types
  • While a key is pressed event
  • Loops while triggering key pressed
  • Changes
  • To

First, right click blue area
34
Event Types
  • While a key is pressed event
  • Drag a method over Durings ltNonegt
  • The method runs as long as B is held down

35
Event Types
  • When the mouse is clicked
  • We can choose a target object to be clicked on

Drag a method to
Write a Comment
User Comments (0)
About PowerShow.com