Friday, March 9, 2012

ALICE Programming! Need Help!?

I am making a simple game in Alice for my programming class. I basically just need a simple game to get an A. I was making a "driving test" game where you have to just stay on the road to win. If the car is off the road the player loses. I ran Into a problem when i move the car to either side it ends : here is my code



When the world starts

Do:

world.my first method





Let move convertibleCorvette





Methods



world.my first method ( )

No variables

world.check





world.check ( )

No variables

convertibleCorvette.roadcheck road = road left wall = road8 right wall = road9





convertibleCorvette



Methods



convertibleCorvette.roadcheck ( [Obj] road, [Obj] left wall, [Obj] right wall)

No variables

Loop infinity times times

If ( convertibleCorvette is above road asSeenBy = convertibleCorvette )

If ( both ( convertibleCorvette is to the right of left wall asSeenBy = convertibleCorvette ) and ( convertibleCorvette is to the left of right wall asSeenBy = convertibleCorvette ) )

Do Nothing

Else

convertibleCorvette move down 20 meters

Else

convertibleCorvette move down 20 metersALICE Programming! Need Help!?
gl
  • racing games online
  • No comments:

    Post a Comment