Making A Boat Racing Game in Alice
Making A Boat Racing Game in Alice
By
Jenna
Hayes
Under
the
direc:on
of
Professor
Susan
Rodger
Duke
University,
July
2010
Making
a
Boat
Racing
Game
in
Alice
This
tutorial
will
teach
you
to
make
a
boat
racing
game
in
Alice,
in
which
you
steer
a
boat
with
the
arrow
keys
through
several
arches,
trying
to
beat
the
clock
to
the
nish.
You
must
drive
through
each
arch
before
you
get
to
the
nish
line,
and
a
score
will
keep
track
of
how
many
arches
youve
driven
through.
SeMng
Up
the
Scene
This
tutorial
will
teach
you
how
to
make
a
boat
racing
game
in
Alice.
First,
open
up
a
water
template
world
in
Alice.
Then,
from
the
vehicles
folder
in
the
Object
Gallery,
add
a
motorboat
object
to
your
world.
AQer
youve
posi:oned
your
boat,
drop
a
dummy
object
at
your
camera
and
rename
it
originalView,
to
save
the
camera
view.
SeMng
Up
the
Scene
Using
the
object
posi:oning
buSons,
turn
your
boat
so
that
the
front
of
it
is
poin:ng
away
from
the
camera,
and
move
it
closer
to
the
camera
un:l
it
looks
something
like
this:
SeMng
Up
the
Scene
Next,
go
into
the
Shapes
folder
in
the
object
gallery
and
nd
the
Torus
object.
Click
and
drag
a
torus
into
your
world.
Using
the
object
posi:oning
buSons,
rst
resize
the
torus
un:l
it
is
preSy
large,
then
turn
it
un:l
half
of
it
is
underwater.
Then
move
it
so
that
it
is
a
liSle
in
front
of
your
boat,
as
if
your
boat
is
about
to
drive
through
it.
SeMng
Up
the
Scene
Now,
using
your
purple
camera
moving
arrows,
move
your
camera
forward
for
a
few
seconds,
and
then
drag,
drop,
resize,
and
turn
another
torus.
SeMng
Up
the
Scene
Now
repeat
the
last
step
un:l
you
have
ten
toruss
in
your
world.
The
path
that
you
move
your
camera
along,
and
drop
the
toruss
on,
will
be
the
racing
path
for
your
motorboat.
You
can
make
it
perfectly
straight,
or
put
some
twists
and
turns
in
it
if
you
want.
When
youre
done,
move
your
camera
back
to
originalView.
Making
a
Timer
Now
well
add
a
:mer
to
the
world
that
will
:me
the
boat
as
it
races
through
the
arches.
Add
a
3D
Text
object
from
the
object
gallery
into
your
world,
and
make
it
say
0.0.
Then
rename
it
in
your
object
tree
to
:mer.
Place
it
on
top
of
your
boat.
Making
a
Timer
Since
the
boat
will
move
through
the
world
while
its
racing,
we
want
the
:mer
to
be
able
to
move
with
it.
So,
go
to
the
:mers
proper:es
tab
and
set
its
vehicle
property
to
motorboat.
Making
a
Timer
Now
we
need
to
write
code
to
make
our
:mer
work.
First,
we
need
to
create
world
variable
to
save
the
number
value
of
the
:me
that
is
leQ.
Go
to
the
worlds
proper:es
tabs,
and
create
a
new
variable,
of
the
type
number,
and
name
it
:merValue.
It
should
be
a
world
variable,
because
we
will
be
using
it
in
more
than
one
place
in
Alice.
Making
a
Timer
Now
we
need
to
create
a
method
that
will
count
down
the
amount
of
:me
that
is
leQ.
Create
a
new
world
method
called
:merDecrease.
Making
a
Timer
We
want
the
:mer
to
keep
coun:ng
down
as
long
as
there
is
:me
leQ.
To
put
this
into
code,
get
a
While
loop
and
drag
it
into
the
code,
and
select
true.
If
:merValue
is
greater
than
zero,
that
means
theres
:me
leQ,
so
that
will
be
the
condi:on
of
the
While
loop.
Go
to
the
worlds
func:ons,
get
a>b,
and
drop
it
onto
the
true
part
of
the
While
loop.
Pick
any
two
numbers
from
the
drop
down
menu.
Making
a
Timer