Computer Science Canada How do i make this ball roll |
Author: | dirk87 [ Sun Apr 13, 2008 6:35 pm ] |
Post subject: | How do i make this ball roll |
proc bowling drawfillbox (100, 100, 550, 200, 115) drawfilloval (110, 150, 20, 20, black) end bowling how can i get my bowling ball to roll to the very right side of my bowling alley |
Author: | Sean [ Sun Apr 13, 2008 7:09 pm ] | ||
Post subject: | Re: How do i make this ball roll | ||
For your ball, you drew it as an oval. The oval is controlled like this.
The x and y variables are your positions on your screen. To go right you will want to minipulate your x variable by increasing it, to go left, decrease the variable. If you are planning on moving the ball, up or down the screen, the y variable controls that. The x_radius and y_radius along with the colour should be left the same, as they won't affect movement, but the style of the ball. |
Author: | A.J [ Sun Apr 13, 2008 8:53 pm ] | ||
Post subject: | Re: How do i make this ball roll | ||
try increasing the x-value by 1 everytime in a loop, and then draw your oval eachtime in a loop. I know I shouldn't help, but here it is anyways:
|
Author: | I Smell Death [ Wed Apr 23, 2008 9:37 pm ] | ||
Post subject: | Re: How do i make this ball roll | ||
here's an other way of doing it similar to how aj did it but using a for loop and maxx. I find that using maxx and maxy is useful when later on you realise that you need more screen space.
|