1 / 23

Programming in Alice

Programming in Alice. What is Alice. A modern programming tool purpose of tool, learn how to program, write algorithms 3-D graphics 3-D models of objects Animation Objects can be made to move around virtual world (a simulation or a video game. Alice is free. Alice is written in Java

lolita
Download Presentation

Programming in Alice

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming in Alice

  2. What is Alice • A modern programming tool • purpose of tool, learn how to program, write algorithms • 3-D graphics • 3-D models of objects • Animation • Objects can be made to move around virtual world (a simulation or a video game. • Alice is free. • Alice is written in Java • www.alice.org

  3. Memory Management • Alice automatically manages memory • But, writing and testing an animation is an intense load on the computing system • a crash can occur. • Best solution: • Alice (the program) reminds you every so often so save your work • save your programs often! • if working in lab when you logout the computer is wiped -> save to your account or to a backup system such as a memory stick

  4. World Window– shows world you are building Events Area - when you wants things to happen (when to make objects do things. Object Tree Contains a list of objects in the world Editor Area - put your program code together Details area Shows methods available for objects. You can create new methods

  5. The World • Alice Programs / Movies take place in a virtual world • When you start a new world in Alice you select the background • The world consistsof a sky and the ground • Can’t be changed aftercreating the world • the world is not infinite

  6. Objects in Alice • Objects already exist. Hundreds of them

  7. Objects • What is an object? • collection of data and operations in which data can be accessed and modified. Objects have two things: State & Behavior State - has a name, has properties-width, height, color, location, age, id# Behavior - associated actions it can perform • tasks it can carry out – things it knows how to do ((barking, fetching, wagging tail).

  8. Where Do Objects Come From? • They are pre built • creating 3D objects is another area of computing and graphic design • Sources of 3D objects • the local gallery that comes with the software • Alice web gallery • How are objects added to the world? • http://www.alice.org/index.php?page=gallery/index

  9. Rico Objects are categorized into classes • Each objects is an instance of the class • All objects in a class • have the same properties • generally can perform the same tasks Skipper Penguins Private Snoopy Kowalski Dogs Odie Opus Ren Class is like a cookie cutter Cookie Cutter (class) makes objects Like it.

  10. Classes & Objects • Class - a template that describes the state and behavior associated objects (instances) of that class. • Instance - the actual object created at runtime. Lassie would an instance of the dog class. • instantiate - to create an object from a class

  11. Behaviors of objects penguin class Behaviors of an object are the methods (actions) it can perform. Located under the methods tab.

  12. Properties of objects penguin class Properties of an object are the things it knows about itself and they are stored in variables. Located under the properties tab

  13. Adding Objects • Click on the green “Add Objects” button • World expands and local gallery displayed

  14. Adding Objects • Local gallery divided into a directory based on subject • add instances of objects to world by • dragging and dropping or • click on object and select add instance option

  15. Objects in the World penguin class penguin objects in a virtual world Instances of the penguin class

  16. Objects in the World • The Objects that are present in the current world are listed in the Object Tree • The top left panel in the Alice programming environment • Every world comes with a light, a camera (point of view for the movie whenplayed), and the ground

  17. Object DimensionsProperties it knows: • Objects in Alice worlds are 3 dimensional height width depth

  18. Object Position • Objects • are positioned in 3-D space • Have six degrees of freedom (directions of movement)

  19. Methods: programmed procedure that is defined as part of a class and included in any object of that class. Ice Skater Object Two methods parameter

  20. 1. What is a method: Organized block of code that will perform a specific task. 2. What is a parameter: Extra information that a method needs to execute. Method name Parameter is the ( ) The data inside the parameter is called arguments. (forward, 3)

  21. Changing arguments in the parameter You change the parameter information by clicking on the argument you want to change and selecting the amount or use other to type in an amount.

  22. Exercises Log on to Alice. Complete the ice Skating tutorial in Alice.

  23. Complete Sequential Program • Complete the program Maze Sequential Programming.

More Related