Solved

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

Posted on 2007-11-28
2
1,470 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Programming  of  forecasting lottery numbers for self use  on Turbo C++ is done by use of random number generator code by a program algorithm logic. Random numbers usually generates numbers between definite interval. Therefore, when entering the c…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now