Simple Game in Alice
Simple Game in Alice
Barb Ericson
Georgia Institute of Technology
June 2008
SimpleGameInAlice
Objectives
Show how to create a simple game in
Alice
Creating methods in Alice
Creating a field or property of an object
Creating a variable
Using a while loop
Creating a Boolean function
Creating a comment
SimpleGameInAlice
Things to Consider
All objects in an Alice movie or game must
be created before the game starts
you can make them invisible to start
click on properties and set the opacity to 0
SimpleGameInAlice
SimpleGameInAlice
SimpleGameInAlice
SimpleGameInAlice
SimpleGameInAlice
10
11
Add a comment
You can add a comment to explain what
you are doing in English
Drag a // tile from the bottom of the
method editing window to where you wish
to place the comment
Click on the down arrow
Select other
Type in the comment
SimpleGameInAlice
12
Click on properties in
the details window
Drag out opacity = 0
change to 1 (100%)
SimpleGameInAlice
13
14
SimpleGameInAlice
15
16
Click on functions
drag out a < b and
drop it on true
select 1 and 1
SimpleGameInAlice
17
SimpleGameInAlice
18
19
SimpleGameInAlice
20
SimpleGameInAlice
21
SimpleGameInAlice
22
SimpleGameInAlice
23
Speeding things up
All animation takes 1
second by default
you can change this
using the more
24
Add instructions
Create 3D text that
tells the user what to
do in the game
When the game starts
wait for 1 second
then make the text
invisible
can set isShowing to
false
SimpleGameInAlice
25
SimpleGameInAlice
26
27
SimpleGameInAlice
28
Other Ideas
Have the zombie play a sound when hit
modify zombie incrementHits method
use play sound in methods
you can also record your own sounds
click on properties for the zombie
click on the + next to Sounds
and record a sound and name it
29
Summary
Alice can be used to create simple 3D
games
Concepts covered
creating methods
creating a property (field)
creating a variable
using a while loop
creating a comment
SimpleGameInAlice
30