PDA

View Full Version : Space Jump


Tommy19748
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!!!

debussybunny563
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?

Tommy19748
08-18-2010, 08:02 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?

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
08-18-2010, 08:04 PM
Questions:
And, does it specifically say to use a loop for the amount of times he spins?

Any specific message you want the astronaut to say?

Tommy19748
08-18-2010, 08:07 PM
Questions:




Correct it is specified about the number of times with the loop, and the Astro can say something like Whoooaaaaaa.

Tommy19748
08-18-2010, 08:08 PM
Correct it is specified about the number of times with the loop, and the Astro can say something like Whoooaaaaaa.

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.

debussybunny563
08-18-2010, 08:15 PM
Well, you only need one variable for both the jump height and the spin times, since they will be the same number, and he looks a little weird raising his hand and saying "Whoooaaaaaa.", but here it is.

If you want to change what he says, go to the world.jump method and modify it (it's towards the end of the method).

If anything else needs to be added/changed, let me know.

Tommy19748
08-18-2010, 08:18 PM
Well, you only need one variable for both the jump height and the spin times, since they will be the same number, and he looks a little weird raising his hand and saying "Whoooaaaaaa.", but here it is.

If you want to change what he says, go to the world.jump method and modify it (it's towards the end of the method).

If anything else needs to be added/changed, let me know.

Thanks again.

debussybunny563
08-18-2010, 08:20 PM
Thanks again.

Hey, that's why I'm here.

Any more questions or problems, let me know, but try to post the problem as soon as possible so it can be taken care of as quickly as possible.

:D

jediaction
08-19-2010, 09:25 AM
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?

medinra
10-15-2010, 07:14 PM
I am currently trying to achieve the same thing as Tommy and I watch your example , but it's does the spinning and jumping together and I have to do them with different amount. At the beggining it needs to ask which height i want the astrounaut to jump and the in should ask how many spins? . Based on what the user enters thats the amount the animation will do. I am really lost.

Doctor Who
10-15-2010, 07:18 PM
Go to World -> Functions -> Ask User For Number. You can invent you own code from there.

medinra
10-15-2010, 07:34 PM
thanks for the help,but this is what I am coming up with and is not working.

medinra
10-15-2010, 08:11 PM
can someone help me????

Dameria
10-15-2010, 08:54 PM
I saw what you did with all of the fancy animations that didn't work, and decided to just delete all of it. I started from scratch and made a really simple code that does the bare basics. If you want you can edit it so that there is more animation, like his legs moving to prepare for the jump, etc. Didn't want to do the whole project for you so just did the basics so you can see how it is done as simply as possible.

medinra
10-15-2010, 10:54 PM
Dameria you are really good, thanks for helping with these issue. What you did was really good. Just wanted to ask you, if I wanted for the astronaut to first jump and then do the spinning while it's already in the air, how can I achieve that?? thank you very much for your quick help.

jediaction
10-16-2010, 08:38 AM
You can just put a turn 1 revolution. Or are you saying, just the first jump. I would do a variable with 1 or 0 or true or false. I would use 1 or 0 for this. Make the game start with the number 1. Then add the spin system in a true or false and say if you press the space bar or any button that is jump, make the variable for the spinning number go to 0 and it wont spin anymore because it will be reading the If/else and it should be blank

Dameria
10-16-2010, 09:16 AM
Dameria you are really good, thanks for helping with these issue. What you did was really good. Just wanted to ask you, if I wanted for the astronaut to first jump and then do the spinning while it's already in the air, how can I achieve that?? thank you very much for your quick help.

Like this?

medinra
10-16-2010, 09:53 AM
Dameria that was exactly what I meant..... thank you very much for your help. Just out of curiosity, how did you achieved it? just to have a idea. Thanks I owe you one or a couple lol .:)

Dameria
10-16-2010, 09:57 AM
I had 2 world number variables named "height" and "spin", and in the beginning of "my first method" I asked the user to enter the height, and assigned that to the "height" variable. Then I did the same thing, asked the user to enter the amount of spins, and assigned that to the "spin" variable. Then I simply told the astronaut to move up, and in the amount of meters to move up I dragged the variable "height" in there. That way he moves up the amount of height you previously entered. Then while right after that statement I told the astronaut to turn to the right "spin" times, so that he spins the amount of times you previously entered for him to spin. Then I just made the astronaut move down "height" meters again so he went back to the ground.

I personally like the first way I did it, it looks more realistic, but this way is even easier and it is the correct way to do it from the assignment.

medinra
10-16-2010, 09:59 AM
I know am Pushing it, but I am really new at this and I am just wanting to know, How would I represent this in a Flowchart?? just curious because I have to do the flowchart, thanks all the tips are appreciated.:)

medinra
10-16-2010, 08:59 PM
Is anyone available to help me out with the flowchart, thanks.

Dameria
10-16-2010, 09:53 PM
Ive never liked flowcharts, I always plan things out in my head and never need to have it written down. Basically, just write the statements that are in "my first method" in an English sentence in boxes, going one at a time. For instance the first box would say "Get the height of the jump and the amount of spins from the user", and you would put that in a box. Then draw an arrow down and make another box that says "Move the astronaut up the height needed" and then another arrow, then "Make the astronaut spin the amount of times that the user asked for", and so on (I can't tell you every box or else I would be doing your homework for you).

Its not that hard, and usually you do this first before you make the program. This might actually be helpful to you. Before making your next program, you should make a flowchart describing exactly what you want to do, like I just explained above. Then once you see what you want, you can make that in the program. This is best for people who need instructions on how to do things, but I am the kind of person that likes to fix things and learn as I go along, so I personally do not use flowcharts.

medinra
10-17-2010, 01:45 PM
I wanted to ask you two things, one of them is do you play gaming console like Ps3 call of duty??? just curious and do you think if I post another issue that i'm having can you help me? it's another animation... I will rate your work.:):):)

medinra
10-17-2010, 01:47 PM
I am needing help with the same assignment of big 12 ranking. I have put together a animation, but something it's missing because the animation suppose to ask the user to enter a number from 1 to 12 and after the user enters it, it will re-ask if he wants to continue and if the user press yes it wil continue, if it press no then it will say goodbye, but that's where am stuck. This is what I got, if anyone can help, I will appreciate it greatly.

medinra
10-17-2010, 11:23 PM
It's anyone Available to help me with this Animation Assignment????? Thanks:(

medinra
10-18-2010, 01:01 AM
I corrected my animation and I am still stuck in a section in which I only need for the animation to say Goodbye if the users selects not to continue, but instead it repeats the same question of entering a number from 1-12. Please let me know if you can help, i am pretty sure it's something small that I am not noticing.

Dameria
10-18-2010, 05:39 AM
Here, I fixed it. I changed the boolean variable to "yesPicked" and turned its initial to true. I then put it into the first while statement and first if/else statement so that those would go on when yes is picked, and when it is not picked it would skip over them. I also took out all of the Yes or No options from each if/else and just put one at the bottom of the first if/else, so that after it tells you the number, no matter which number it is, it asks you Yes or No.

Did that help?

medinra
10-18-2010, 10:34 AM
Dameria you are a pro on this, thank you very much for your help. That's what it was missing, It's their anyway that I can contact you throught this forum in case i need your opinion?? I really appreciatte all your help, if you need anything let me know.

cedricdosss
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

Dameria
11-15-2012, 10:11 AM
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.

cedricdosss
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

Dameria
11-15-2012, 01:33 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

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?

cedricdosss
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

Dameria
11-24-2012, 10:53 AM
Try this one. The only thing that I could not fix is that the propellers stop moving when the user is asked to enter a height. This can't be fixed though because when there is an input, all operations in the world pause.

cedricdosss
11-26-2012, 10:18 AM
Hi, thanks that was really helpful
but one question why when I add more (like other things I want the helicopter to do) It won't work?
Like I want them to turn around and move all together about 5 meters

Dameria
11-27-2012, 08:04 AM
Hi, thanks that was really helpful
but one question why when I add more (like other things I want the helicopter to do) It won't work?
Like I want them to turn around and move all together about 5 meters

You have to put everything in the tan "Do one at a time" block. You can't just add it to the bottom, because that really big "Do Together" block will never end from the infinite loop. I moved the code you wanted into the correct block.

jediaction
11-28-2012, 12:51 PM
This is a bit off topic, but I just want to take a second and welcome back Dameria, a long time Alice member. Welcome back, and it's glad to see you back in action and helping others again.

cedricdosss
11-30-2012, 05:58 AM
I have this simple project I'm working, It about recursion. I do not get why the program will not stop when the boat is within 1 meter. And I am also trying to have the camera take a good look at the island. Help please.


Create a sea world with a boat and an island. Position the island some distance away from the boat. Write a method named sailTo, which has an Object parameter. The method should cause the boat to move one meter toward the object and then recursively call itself until the boat has reached the object. Test the method by calling it and passing the island as the argument.

Here are additional requirements:


1. The sailboat must appear to be in the water.
2. It should turn and face the island.
3. The sailboat must reach the island independent of where it is initially placed.
4. The sailboat should move towards the island object until it touches the island (not get beached).
5. The camera should be above the island looking down to verify that the boat touches the island.

Dameria
11-30-2012, 09:10 AM
The reason why it didn't stop when it got to the island is because you were telling the boat to stop when it's coordinates where less than 1 meter away from the coordinates of the island's palm tree, and that never happened.

If you look at the program that I attached, I changed it so that the "my first method" function first turns the boat to face the island (which was one of the questions), and then recursively calls your method to make the sailboat move forward (I made the animation more fluid by making it move "abruptly"). I also changed the distance that it checks to 15 meters, not 1. This will make the boat stop 15 meters away from the coordinates of the island, which makes it stop exactly where you need it too, just touching the beach. The only thing that I didn't fix is the last part. I kept your code in there to just take a good look at the island, but what you're really supposed to do is set the camera to be above the island, looking down. This is easy camera code and you can do it in 2 steps.

cedricdosss
12-04-2012, 11:16 AM
Hello Dameria,
I really appreciate all your help, with all your correction and feedback I am having a better understanding of Alice.
I'm working on this new project, I have it pretty much done, but the animations are not quit smoove. If you have any free time I will appreciate if you can give me your impression and where you think I need to improve.


Here is the story line


The objective of our story is to interact with the user and have fun. It is a simple graphic interface a user can watch and be engaged as the game progresses.
On a beautiful sunny day in a beach, there will be a gathering of two teams to play volleyball. A referee will be moderating the game. He will welcome the user, asking user’s name and personalized the greeting. Each team will be introduced by their bird mascot.
The game will start. When the ball is missed, the coach will stop the game. The user is asked who gets the point. If user replies the correct answer, the team with the point will be jumping with joy. If user gave an incorrect answer, a message will display and the game will not continue. The message will contain the range of possible answers. User will be asked to enter another answer.
After the team jumped in joy, the mascot will touch the net. The net will alter color changing to the team’s color. The game continues and interacting with the user. The team who gets the three points will be declared as the winner. In celebration, the mascot’s friends will join him in a dance.
The coach will thank the user, wishing him a good day