Solved

I am using the alice programing enviornment to make a race car game

Posted on 2007-11-28
2
1,560 Views
Last Modified: 2013-12-21
How do i get the while command to work.  I want the car to turn left when the left key is held down. and then similarly to back, forward and right.  I'm just trying, not sure anyone would have reason to know Alice.  This is for a class.

Thanks

Artie
0
Comment
Question by:rpreiss
2 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 20378386
I'm not familiar with Alice. But in the languages I've used to do similar things, you wouldn't use a while statement; instead, one technique would be to start turning left when the left key is pressed; and then stop when either that key is released, or a key to counteract it is pressed.
So it's really a set of state variables, and if-statements.

Hopefully that gives you an idea..?
0
 
LVL 1

Accepted Solution

by:
dukesnoopy earned 500 total points
ID: 20396424
It looks like there are a lot of resources out there:

http://www.alice.org/community/ - Online Foums; good place to find your answer
http://www.dickbaldwin.com/tocalice.htm - Alice Tutorial - Go to http://www.dickbaldwin.com/alice/alice0930.zip for sample files
http://www.developer.com/java/other/article.php/3673761 - Introduction to Alice Programming - this is a really good one-page tutorial

For a car turning left, right, or accellerating/braking, I would check out this page, which has a download link for an Alice file:  "i made this in like 5mins before class, just something to make the time go by, all you do is use the arrow keys to move the car, (spacebar puts a boost in your speed) then once you hit the end of the road (or just when you feel like seeing it) hit N and watch the car turn into something cool."
http://www.alice.org/community/showthread.php?t=978

Hope that helps,
Steve
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you searching for a fun but also medium paced MMORPG game I would highly suggest Ragnarok Online. This MMORPG is a bit older than World of Warcraft and in a way is extremely different. Compared to WoW's 3D environment and massive wor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question