Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Stopping object from going underground. (http://www.alice.org/community/showthread.php?t=4264)

zackpier 04-20-2010 08:10 AM

Stopping object from going underground.
 
1 Attachment(s)
Ok so I'm trying to make just a basic plane flying simulation. I've got all the controls mapped out but i can't seem to keep the plane from flying under the ground. Can someone give me a suggestion on an if/else statement to use? It'd be appreciated.


Zack

flats 04-20-2010 10:57 AM

[QUOTE=zackpier;20012]Ok so I'm trying to make just a basic plane flying simulation. I've got all the controls mapped out but i can't seem to keep the plane from flying under the ground. Can someone give me a suggestion on an if/else statement to use? It'd be appreciated.


Zack[/QUOTE]

There is a "distance above [object]" function you can call for any given object. I'd incoporate that and some sort of inequality (>, <, etc.) in an if statement.

Dameria 04-20-2010 11:41 AM

1 Attachment(s)
Hey, I'm sorry but I took your program and just got a little carried away while fixing it ;)

Its not much but I think it makes your game a little smoother and more life-like. There is more that I could incorporate such as a steady decrease in speed instead of an abrupt stop, and a few other things that have to do with speed.

Here is what I have done:

zackpier 04-21-2010 07:35 AM

Thanks for the help.
Nice job on that world, it's fun to play with.



Zack


All times are GMT -5. The time now is 09:15 PM.

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.