Computer Science Canada Getting started. |
Author: | ICS 3M1 [ Mon Dec 04, 2006 8:34 am ] |
Post subject: | Getting started. |
I need to create a program that will show a stickman jumping vertically on a trampoline and coming back down (at the same rate, no increase in height). We have to start with a base program: var n, x, x1, x2, y1, y2 : int := 0 procedure stickman1 drawoval (30 + x, 30, 6, 4, n) drawline (29 + x, 25, 29 + x, 18, n) drawline (29 + x, 23, 40 + x, 22, n) drawline (29 + x, 23, 18 + x, 22, n) drawline (29 + x, 18, 23 + x, 10, n) drawline (29 + x, 18, 35 + x, 10, n) delay(50) end stickman1 for j : 1 .. 40 n := 12 stickman1 n := 0 stickman1 x := x + 5 end for and modify it to show the stickman moving up and down on a rectangle (trampoline). If someone could just start to show me where start it would be greatly appreciated. |
Author: | Clayton [ Mon Dec 04, 2006 3:54 pm ] |
Post subject: | |
Well you've got the general idea, except that you are increasing values to go horizontally as opposed to vertically, so change y values instead of x values, also, use procedures with parameters instead of using global variables within your procedure. Also, please use [code][/code] tags next time you post code. |