Alice Community  

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

Reply
 
Thread Tools Display Modes
Flight Simulator help (compass + more)
Old
boppy
Guest
 
Status:
Posts: n/a
Question Flight Simulator help (compass + more) - 05-16-2010, 01:50 AM

Hello everyone,
I've recently made a flight simulator that let's you choose from 3 types of helicopters or an airplane. Right now I have 3D text that shows your current altitude when you takeoff. I was just wondering if it was possible to create an on-screen compass that showed N NE NW SE SW E W according to what way you are pointing.

Another question I have:
At the beginning of the program, if you select a helicopter, the propeller starts spinning. This is all fine and dandy, but it interferes with what happens when you hit Enter (when you hit Enter, it automatically lands the helicopter and lets you select a different aircraft). Basically, after it has automatically landed, I can't get the helicopter to stop moving the propeller. Can someone show me how to?

Any help would be appreciated! Thanks!

Last edited by boppy; 05-16-2010 at 01:51 AM. Reason: typo
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-16-2010, 07:45 AM

For the helicopter propellers, you probably have an infinite loop that says "turn propellers left 1 rotation" or whatever, right? If you do, take that out and instead create a boolean variable called "isSpinning" and set it to false. Then, put that "turn propeller" method you had into a "While" statement, and put in "While(isSpinning == true)". Then, in the method where the helicopter automatically lands, right after the part where the helicopter touches the ground, put in a code to set "isSpinning" to false. This way, it will stop spinning once the helicopter lands (you might want to put in another method right after that to make the propellers spin just a little bit longer and then slowly come to and end).


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
boppy
Guest
 
Status:
Posts: n/a
Talking 05-16-2010, 09:24 AM

Thanks! Worked perfectly!

Anyone have any idea about the compass?
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 05-16-2010, 05:29 PM

Have objects in the four corners in the map, and make a loop infinity times method checking to see if the plane is facing one of them. Then make another loop infinity times method checking to see when the plane is facing in between them.


I'm a web developer/ designer now.
   
Reply With Quote
Old
boppy
Guest
 
Status:
Posts: n/a
Unhappy 05-17-2010, 05:26 PM

I get the idea, but can you maybe go into more detail? I'm having trouble.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-18-2010, 02:43 PM

I am actually going to make a post soon that demonstrates a good compass method using basic Trigonometry, I will work on it today and post when I am done. It will probably be complex code though, and there will be about 5 cube objects to check distances and determine rotation based on distance between cubes (hey, I guess we do learn stuff from math in school )


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
boppy
Guest
 
Status:
Posts: n/a
Default 05-18-2010, 02:57 PM

nice! is it going to be a 3d text based compass (displays N, S, E, etc...) or a physical compass? Think you could post a link or a thread title when you're done? thanks!
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-18-2010, 04:28 PM

Quote:
Originally Posted by boppy View Post
nice! is it going to be a 3d text based compass (displays N, S, E, etc...) or a physical compass? Think you could post a link or a thread title when you're done? thanks!
I am planning on making it a 2d compass (well, 3d, but so pressed up to the camera that it will look 2d, it will have the needle and everything though). Yes, I will post the world when I am done, and I am going to start it now.

If you would rather me make the text based compass though, I could do that too (it would be easier) or I could do both, display in text and compass.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
boppy
Guest
 
Status:
Posts: n/a
Default 05-18-2010, 06:23 PM

OH MY GOSH. If you could make a text one and a normal one, that would be awesome. I've spent way too long trying to make one (i've tried both ways) and just ended up failing. If you can only do one, that's cool too, thanks!
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-18-2010, 06:34 PM

I am currently having some troubles with Alice's "arccos" function, but once I find out how to use it correctly, I should be able to finish this. I can probably do the text direction while I wait for yahoo answers people to answer my question.

Don't post yet, because I want the 11th post to be mine so I can publish the compass world on it and be first in the second page, you can comment after I publish the world (it might not be till tomorrow).

Also, the way that I am doing this might take you a few hours to copy into your own world, there are a lot of objects, functions, and a method that you will have to copy exactly.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.