1 / 15

Introduction to Alice and Java Programming

Learn the basics of Alice and Java programming, including creating virtual worlds, calling methods on objects, exploring available methods and properties, and interacting with composite objects.

Download Presentation

Introduction to Alice and Java Programming

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. Chapter 1:Objects Programming with Alice and JavaFirst Edition by John Lewis and Peter DePasquale

  2. Objectives • Be introduced to Alice and Java and how they’re used in this book. • Create virtual worlds in Alice. • Call methods on objects to make them behave in particular ways. • Explore the set of methods that are available to all Alice objects. • Set and modify the properties of an object. • Creating new objects from predefined classes. • Cause multiple animation actions to occur at the same time. • Explore composite objects and interact with a composite’s individual parts.

  3. Computer Programming • Object-oriented programming (OOP) – create and manage objects. • Objects: a character in animation, a scoreboard in the game, friends, etc. • Programmers create objects they need and tell them how they should behave

  4. Alice and Java • Alice is a computer environment in which you create virtual worlds containing three-dimensional characters and objects that move and interact. • Both Alice and Java use an object-oriented approach. • Java is a general-purpose programming language.

  5. The Alice Environment • Alice is an integrated development environment (IDE) – a program used to create and run another program. • Versions for Windows and Mac OS are available from theAlice website: www.alice.org. • run a tutorial; • open a world that has been opened recently; • start a new world; • explore several example worlds; • open a world that has been stored.

  6. The Alice Environment (continued) toolbar world view events editor object tree details panel method editor

  7. Objects • All objects contained in the Alice world are listed in the object tree. • All Alice worlds have objects that represent camera and light source. • Most worlds have a ground surface. • There is a collection of templates and collections of objects. • Camera controls set the initial point of view. The object tree The camera controls

  8. Methods • A method is a set of statements that can be called. • Methods define every object’s behavior. • The world object in every animation has a method called my first method. • There are several control statements available in Alice. • Calling a method – sending a messageto an object. • Methods can accept parameters. object parameters method

  9. Methods (continued) • Built-in methods exist for almost all objects in Alice • Other methods can be developed and added. • Some useful methods are: • say • think • sound • Special methods—functions areused to get some information aboutan object

  10. Properties • Properties describe an object’s state at any point in time. • The value of the property can be changed directly or during animation, using method call. • There are hidden properties for the objects.

  11. Classes • An object is created from a class. • Class determines the methods and properties the object has. • Classes are organized into galleries. • There are built-in galleries; they are also available through the Web.

  12. Do Together Statement • The Do Together statement allows several things to be done simultaneously.

  13. Do In Order Statement • The Do In Order statement forces the statements it contains to be executed in order.

  14. Composite Objects • A composite object is an object that contains other objects. • It is possible to control the whole object or any of its parts.

  15. Summary • Programming no longer has to be a complex, arcane experience. • In object-oriented programming, objects and their behavior are created. • Alice and Java use an object-oriented approach. • A development environment is a program used to create and run another program. • To get an object to do something, we call one of its methods. • A method’s parameters provide additional information that tailors its behavior. • All Alice objects have a set of built-in methods. We can add more. • An object’s properties describe its current state. • An object is created from a class. In Alice, classes are organized into galleries. • A composite object is made up of other objects. We can control both the whole object and its parts.

More Related