Alice Community Space Jump

 Space Jump
 Tommy19748 Guest   Status: Posts: n/a Space Jump - 08-18-2010, 08:02 PM Is it possible that someone instruct me how to have the astronaut jump a specific height. At the top, use a loop to spin the astronaut a specified number of times, using the same function. The astronaut falls down to the surface, raises his or her arm, and says a message. Use variables for the height of the jump and the number of spins. I've started; however, I'm in need of assistance with this assignment, it is due tonight. Instructions please!!! Last edited by Tommy19748; 08-22-2010 at 10:57 PM.
jediaction
Senior Member

Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
08-19-2010, 10:25 AM

Quote:
 Originally Posted by Tommy19748 Is it possible that someone instruct me how to have the astronaut jump a specific height. At the top, use a loop to spin the astronaut a specified number of times, using the same function. The astronaut falls down to the surface, raises his or her arm, and says a message. Use variables for the height of the jump and the number of spins. I've started; however, I'm in need of assistance with this assignment, it is due tonight. Instructions please!!!
Uh, didnt i just help you on this. I sent you an Example project. My JA command system. What happened with that?

Website: www.salokingames.com

 Space jump
cedricdosss
Junior Member

Status: Offline
Posts: 10
Join Date: Nov 2012
Space jump - 11-14-2012, 10:29 PM

Hello, I'm working on this project can someone help me?
Create a world with an astronaut, moon surface, and Lunar Lander (LL). (Web Gallery). Using the “ask the user for a number” function, have the astronaut jump a specific height (but must be visible at all times). The value must be greater than zero, and if not, give and error message and repeat the question until a valid answer is given.

I have the most part, but can't get it to ask again until the valid answer is given.
Can anyone help?
Thanks
Attached Files
 Space Jump.a2w (2.21 MB, 8 views)

 cedricdosss Space Jump
Dameria
Senior Member

Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
cedricdosss Space Jump - 11-15-2012, 11:11 AM

Quote:
 Originally Posted by cedricdosss Hello, I'm working on this project can someone help me? Create a world with an astronaut, moon surface, and Lunar Lander (LL). (Web Gallery). Using the “ask the user for a number” function, have the astronaut jump a specific height (but must be visible at all times). The value must be greater than zero, and if not, give and error message and repeat the question until a valid answer is given. I have the most part, but can't get it to ask again until the valid answer is given. Can anyone help? Thanks
Hey cedricdosss, I looked at your Space Jump program and it looks like you put all of your code into one if/else statement. If you want your code to re-ask the user for a number when they enter anything 0 or less, then you'll have to use a loop. There are two kinds of loops you can use for this. The easiest is a recursive loop which basically just calls the method that you made to run it again. To do this just drag "my first method" to the place right after you have your astronaut say "Error". This should fix your problem.
Recursive loops are not a good habit to get into, though. They give you problems with lag when you recursively loop the same method a few thousand times.

A while loop is much better to use. I made the program for you with a while loop in case you want to see how it will work. I also made your animation MUCH smoother and better looking (I even finished your jump for you, you just had him suspended in mid air). You can download my version and see what I fixed. I made a world number variable called "input" and had it set to 0, and then put a while statement saying that while "input" is less than 0, it keeps asking you for a new number, and then when "input" is over 0, it preforms the animation, and when that is done the program ends.

Attached Files
 Space Jump (1).a2w (2.23 MB, 20 views)

Check out my best projects so far and please comment:

 Jump space
 cedricdosss Junior Member   Status: Offline Posts: 10 Join Date: Nov 2012 Jump space - 11-15-2012, 01:34 PM Thanks you so much Dameria. I tried to use the while loop, but could not really figure out how it works. Thanks you really was a big help. The project I'm doing is a little be longer than that. I will try first and if I run in to any more problem I will appreciate you in put. Thanks again
Dameria
Senior Member

Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
11-15-2012, 02:33 PM

Quote:
 Originally Posted by cedricdosss Thanks you so much Dameria. I tried to use the while loop, but could not really figure out how it works. Thanks you really was a big help. The project I'm doing is a little be longer than that. I will try first and if I run in to any more problem I will appreciate you in put. Thanks again
You should look at my program to see how I did it. The world variable I made is located by clicking the "World" tab in the top left, then pressing the "methods" tab. I'm guessing you also have to make your astronaut spin the number of times that you inputted while he is in the air?

Check out my best projects so far and please comment:

cedricdosss
Junior Member

Status: Offline
Posts: 10
Join Date: Nov 2012
Helicopter Squadron - 11-23-2012, 02:09 PM

Hello,
I have this project I'm working on
"Create a world with a list or array containing four Helicopters (Local Gallery). Each helicopter should have a unique name (in another list). You may have to resize the helicopters to fit in the world’s view. Each helicopter should have its propeller turn, and after a delay, one at a time, rise to a given height (based on a user supplied value), still in the camera’s view. The ground should fall away. The helicopters should tilt forward (one at a time). A message should appear from each (with its name), indicating its readiness for the mission (one at a time). "

I stated the programing , but I'm have issue on couple things.
[I]
.when the user enter a number that is more than 3, I want the program to ask until the right number is enter, but what it does is that he skip the helicopter. When I used "while"[ nothing happen /I]

My second issue is that I don't know how to make propeller turn and have each helicopter to say their name each at the time

Attached Files
 Helicopter Squadron.a2w (1.14 MB, 3 views)

 Specifics?
 debussybunny563 Senior Member     Status: Offline Posts: 852 Join Date: May 2010 Specifics? - 08-18-2010, 09:00 PM Any specific message you want the astronaut to say? Also, are you supposed to use the same variable for the height and number of spins? In other words, if you enter "2" for height, do you also want him to spin 2 times? And, does it specifically say to use a loop for the amount of times he spins? Last edited by debussybunny563; 12-21-2012 at 12:00 AM. |--------------------------------------------------------------------------------------------------| |Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 | |--------------------------------------------------------------------------------------------------| I have been dead for quite some time now; not much hope for resurrection.
Tommy19748
Guest

Status:
Posts: n/a
08-18-2010, 09:02 PM

Quote:
 Originally Posted by debussybunny563 Any specific message you want the astronaut to say? Also, are you supposed to use the same variable for the height and number of spins? In other words, if you enter "2" for height, do you also want him to spin 2 times?
Correct if the number 2 is posted then the Astro should turn two time and so on. I have the spin part down but I'm stuck on the jump with the loop.

debussybunny563
Senior Member

Status: Offline
Posts: 852
Join Date: May 2010
08-18-2010, 09:04 PM

Questions:
Quote:
 And, does it specifically say to use a loop for the amount of times he spins?
Quote:
 Any specific message you want the astronaut to say?

Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.

 Thread Tools Display Modes Hybrid Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge