Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
A couple of car game questions
Old
Darkpivot
Guest
 
Status:
Posts: n/a
Question A couple of car game questions - 07-23-2007, 07:07 PM

Hi, this is my first post here. I am new to Alice but am picking it up very quick. I have learned basic things and have learned how to make a car move forward and back and turn left and right with the arrow keys. But I don't know how to keep the car on the ground. When I move the car forward it moves up while it is going forward. When it is going back it moves down through the ground. How do I fix this? Also how do I make collision detections so it will just bump into objects like hills sights and buildings? A couple more things. How do I make it to where when you press the up arrow, instead of jerking strait to full speed it eases to full speed. But if you let go it will ease to a stop. Same with the back arrow and going to reverse. Also, make it stop faster if I hold the back button while it is going forward. A know this is a lot of questions but if you know the answer to one or two of them please tell me. Thank You!

Edit: 1 more thing. How do you disable turning when you are not moving and can only turn at the speed the car is moving at.

Last edited by Darkpivot; 07-23-2007 at 07:22 PM.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 07-23-2007, 08:35 PM

It sounds like you may be able to make good use of the free online Alice tutorials at http://www.dickbaldwin.com/tocalice.htm

Pay particular attention to Appendix A, which contains explanations and illustrations of all of the primitive methods. You may find the answers to some of your questions there.

Dick Baldwin
   
Reply With Quote
Old
islandfever
Guest
 
Status:
Posts: n/a
Default 07-23-2007, 09:21 PM

Quote:
Originally Posted by Darkpivot View Post
...When I move the car forward it moves up while it is going forward. When it is going back it moves down through the ground. How do I fix this?...1 more thing. How do you disable turning when you are not moving and can only turn at the speed the car is moving at.
For the first part, I think, go to the car's methods and click and drag "Stand Up" onto your world. (as in, on the picture) The second part might be a little more complicated.

First off, go to your car's "properties" tab. click "Create new Variable". Click on the "boolean" dot, and name it something like: "moving". And then click on the down arrow next to "true" and change it to false. Hit OK.

Now go to the method on your world that makes the car move forward. At the very beginning of the method, drag the variable "moving" to the start and click "set value" then "true". At the end of that method, drag the variable in and click "set value" to false.

Now, go to your turning method, and create an "if/else" statement. Select "true". Drag any content into the first part of the if/else statement. Then, drag the variable onto "true". Click the down arrow on it and click "logic". Go to "moving==" and then hit true.

Now if "moving" equals true, the car can turn. If not, No turning will occur. If something else goes wrong, just ask anything you need help with!
   
Reply With Quote
Old
Darkpivot
Guest
 
Status:
Posts: n/a
Default 07-24-2007, 04:05 PM

wow thanks! I also figured out the other questions. thanks alot.

Ok, sorry, 2 more questions. How do I make it where if i am driving, ( It goes from 1 meter per second to 10 meters per second as I hold the up arrow down.) if I let go of the arrow key it will check how many meters per second the car is going than it will go from that speed to 0. But if I press up again it will check the current meters per second and will start from there and go up to 10 mps. Also if I am moving forward and than switch to the break button (space bar) It will stop quicker than it would if you just let go of the key. Same thing if i am going backwards than press the forward break button (b) it will stop me from going in reverse. Thanks!

Last edited by Darkpivot; 07-24-2007 at 05:24 PM.
   
Reply With Quote
Old
islandfever
Guest
 
Status:
Posts: n/a
Default 07-25-2007, 06:39 PM

If you could post your game I might be able to help you on that.
   
Reply With Quote
Old
Darkpivot
Guest
 
Status:
Posts: n/a
Default 07-25-2007, 07:30 PM

actually never mind. I am pretty much done with it now. I might want to touch it up a bit and than I am done! (I will post it when it is completely done)
   
Reply With Quote
Old
islandfever
Guest
 
Status:
Posts: n/a
Default 07-26-2007, 12:19 PM

Can't wait to see it!
   
Reply With Quote
Reply

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 ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.