Computer Science Canada cannonball game |
Author: | hossack [ Tue Feb 17, 2009 10:53 am ] | ||
Post subject: | cannonball game | ||
I need to know how to make my arc go up and then down. This is what i've gotten so far
|
Author: | Ktomislav [ Tue Feb 17, 2009 11:23 am ] | ||
Post subject: | Re: cannonball game | ||
It's simple physics. You just have to set speed in x direction an in y direction and acceleration. And after that you just increase your x coordinate for x speed and y coordinate for y speed and increase your y speed for acceleration. You repeat that until x reaches maxx or y reaches 0.
|
Author: | hossack [ Tue Feb 17, 2009 8:47 pm ] |
Post subject: | Re: cannonball game |
We haven't learned Procedures yet. Is there any other way to do it? |
Author: | DemonWasp [ Tue Feb 17, 2009 9:22 pm ] |
Post subject: | RE:cannonball game |
Learn procedures. If you want to just run his code, copy everything between "procedure arc" and "end arc" and run that as a Turing program. You should see what he's talking about. Learn procedures anyway. |
Author: | hossack [ Wed Feb 18, 2009 9:30 am ] |
Post subject: | RE:cannonball game |
I got it work. Thanks edit nvm |
Author: | hossack [ Wed Feb 18, 2009 10:06 am ] | ||
Post subject: | Re: cannonball game | ||
How do i get it so like when it hits the target you win/ if you miss you lose? Also how do you get it so the target is the same size each time?
|
Author: | Ktomislav [ Wed Feb 18, 2009 11:18 am ] | ||||
Post subject: | Re: cannonball game | ||||
You don't have to randomize randx2.
You have to ask if the cannonball is inside the target.
And when cannonball goes out of screen you lose (when y <=0 or x >= maxx). Write the code yourself. And I missed it.. You got it wrong.. Angle is not speed. You could write "y direction speed" or something like that instead of "angle" or you could do something with sin and cos or something like that. |
Author: | hossack [ Thu Feb 19, 2009 9:48 am ] | ||
Post subject: | Re: cannonball game | ||
How do I restart the program after you win? Like
|
Author: | DemonWasp [ Thu Feb 19, 2009 10:34 am ] | ||
Post subject: | RE:cannonball game | ||
|
Author: | A.J [ Thu Feb 19, 2009 10:51 am ] | ||
Post subject: | Re: cannonball game | ||
DemonWasp wrote:
See, since you are going to have you game code in the main loop, you might want to use procedure |
Author: | hossack [ Thu Feb 19, 2009 10:59 am ] |
Post subject: | RE:cannonball game |
thanks for all the help, I got it working and its complete |