Computer Science Canada

moving a stick figure

Author:  dirk87 [ Thu Apr 10, 2008 7:41 am ]
Post subject:  moving a stick figure

Im working on a project in turing for my computer class and i cant figure out how to make my stick person move from the right side of the screen to the middle.

Author:  petree08 [ Thu Apr 10, 2008 10:02 am ]
Post subject:  RE:moving a stick figure

are you using draw commads to draw your stickman? if so you can base where the figuguer is being drawn on an x and y variable.

psudeo code

proc Draw_Stickman (X,Y :int)

%% draw stickman
%%example of a draw command based on X,Y

% spine maybe
drawline (X, Y + 10, X, Y- 10, 7)

end Draw_Stickman

end Draw_Stickman

okay so now you need him to move right?

to do this you need to make some sort of change in the X, Y vars

example

var X, Y : int

X := 1
Y := 100

loop
cls
X := X + 1
Draw_Stickman (X,Y)
end loop


this will cause your stickman to go to the right,


If this doesn't help try looking at the tutorial section. There are lots of threads and topics on various animation technics

- happy coding


: