Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

25 Experts available now in Live!

Get 1:1 Help Now