Alice Community  

Go Back   Alice Community > Educators > Teaching with Alice

Thread Tools Display Modes
Alice help
Junior Member
Status: Offline
Posts: 3
Join Date: Nov 2011
Location: Canada
Default Alice help - 11-17-2011, 10:13 PM

hi guys i need help with my project im creating alice racing game but dont know how can someone tell me how or can someone do it for me and i will reward him or her thanks.
Reply With Quote
Mr Kidnapper
Senior Member
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 11-17-2011, 11:03 PM

I hope your teacher didn't just throw you into an assignment. Alice doesn't have a "Make something cool" button. The idea with Alice is to teach you how to program.
First things first: Plan. What do you think you need?
1. Cars.
2. The Finish Line
3. A Victory Scene
4. Anything else you could think of. (Tracks, pedestrians to cause traffic incidents, etc.)
5. ???
6. Profit!
Secondly, what do you know?
Do you know how to:
Create events
Create objects
Make things move
Make things rotate
Use Boolean Variables
Use Number Variables
Use if/else statements
Other miscellaneous things.
If you said 'yes' to all of those things, congratulations. You're ready to make a race.

We move onto creating a method.
Before we do anything, we must make a method that causes the cars to move.. or accelerate. Whichever you like better.
Normal people use "Move [subject] with the arrow keys."
Obviously I'm not normal people, so I did it the boss way.

When I made the Mitsubishi Mirage in the Share Objects forum, I made the car accelerate rather than just move it. I did this by creating a variable that adds onto itself, that being speed. I then set the speed variable to be how much the car moves forward, according to the front set of wheels (This is important in turning)
I also made the car able to turn. I did this by turning the front wheels, because the car's movement is based on the facing direction of the front wheels. I also created a variable that checked what degree the wheels were turned at, limiting it to roughly 45º degrees in either direction.

We move onto making a "Win" scenario.
Do 'ya know how to use Booleans and if/else statements? I hope you do. For this part I'll be ignoring the existence of other cars.
What you need to do is make a variable. Call it whatever you want, but for simplicity's sake, I'll call it "Won", and set it to be either true or false. It doesn't matter yet.
When our car reaches a certain point, we need to set this "Won" variable to True. The point can be described by the functions "[Car]'s Distance away from [Finish Line]" The car being our car, and the finish line being an arbitrary object that stands for our finish line. When the car is a certain distance away (Let's say 5 meters), we set "Won" to be true.

We move onto making a "Victory" scene.
So the car has reached the finish line. Whoopie. We need to make a new method, call it whatever you want but I'm calling it "Victory Scene", if it weren't obvious enough.
In this Victory Scene method you do all your sparkly magic and power to make it seem as if the player has won. You can add 3D text, have the car say "You Won" or whatever you want. It doesn't matter.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.