Alice Community  

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

Reply
 
Thread Tools Display Modes
Motion constraints
Old
Korla Plankton
Guest
 
Status:
Posts: n/a
Default Motion constraints - 01-02-2008, 10:05 AM

Hi forum! I'm a total newb to Alice and OOP. I'm using Alice to get my head around OOP concepts (always been a procedural guy) and I've recommend it to the school's CS teacher to check out.

Anyway, sorry if my question has been asked and answered.... I did a search (using Mr. Baldwin's tips) but didn't find anything. Maybe I'm not using the right keywords.

Anyway, I have a car that I can drive around using arrow key events and I have "Coach" running away from the car, like so.

While true
coach move amount = 2 meters away from target = car

The problem is that Coach gradually sinks under the ground. I may be able to fix this by using one of the collision hacks described in the forum, but it would be much better for this purpose to simply constrain coach's movement so he can't move in the Z (depth) axis. Is there a way to do this?

Thanks for humoring the newb!
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 01-02-2008, 02:13 PM

Quote:
Originally Posted by Korla Plankton View Post
Hi forum! I'm a total newb to Alice and OOP. I'm using Alice to get my head around OOP concepts (always been a procedural guy) and I've recommend it to the school's CS teacher to check out.

Anyway, sorry if my question has been asked and answered.... I did a search (using Mr. Baldwin's tips) but didn't find anything. Maybe I'm not using the right keywords.

Anyway, I have a car that I can drive around using arrow key events and I have "Coach" running away from the car, like so.

While true
coach move amount = 2 meters away from target = car

The problem is that Coach gradually sinks under the ground. I may be able to fix this by using one of the collision hacks described in the forum, but it would be much better for this purpose to simply constrain coach's movement so he can't move in the Z (depth) axis. Is there a way to do this?

Thanks for humoring the newb!
Here is a guess at what is happening. As I recall, the center for the coach is between his feet. The center for the car is probably a little higher. When you cause the coach to move away from the car, his center probably moves along a line that intersects the two centers.

It would probably help, but not totally solve the problem, if you would make the coach move away from the car's wheel or some part of the car for which the center is as close to the ground as possible. That would cause the line that intersects the two centers to be more parallel with the ground and decrease the rate that he sinks into the ground.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Reply


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