Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Space Jump
Old
Tommy19748
Guest
 
Status:
Posts: n/a
Exclamation Space Jump - 08-18-2010, 07: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 09:57 PM.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 08-19-2010, 09:25 AM

Quote:
Originally Posted by Tommy19748 View Post
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
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Space jump
Old
cedricdosss
Junior Member
 
Status: Offline
Posts: 10
Join Date: Nov 2012
Default Space jump - 11-14-2012, 09: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
File Type: a2w Space Jump.a2w (2.21 MB, 8 views)
   
Reply With Quote
cedricdosss Space Jump
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default cedricdosss Space Jump - 11-15-2012, 10:11 AM

Quote:
Originally Posted by cedricdosss View Post
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.

Download from the link below and tell me what you think of the improvement I made on the animations.
Attached Files
File Type: a2w Space Jump (1).a2w (2.23 MB, 20 views)


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
Jump space
Old
cedricdosss
Junior Member
 
Status: Offline
Posts: 10
Join Date: Nov 2012
Default Jump space - 11-15-2012, 12: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
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 11-15-2012, 01:33 PM

Quote:
Originally Posted by cedricdosss View Post
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:

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
Helicopter Squadron
Old
cedricdosss
Junior Member
 
Status: Offline
Posts: 10
Join Date: Nov 2012
Default Helicopter Squadron - 11-23-2012, 01: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

Help please thanks
Attached Files
File Type: a2w Helicopter Squadron.a2w (1.14 MB, 3 views)
   
Reply With Quote
Specifics?
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Question Specifics? - 08-18-2010, 08: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.
   
Reply With Quote
Old
Tommy19748
Guest
 
Status:
Posts: n/a
Default 08-18-2010, 08:02 PM

Quote:
Originally Posted by debussybunny563 View Post
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.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 08-18-2010, 08: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.

|--------------------------------------------------------------------------------------------------|
|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.
   
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.