Computer Science Canada

how do i move a guy in turing?

Author:  caldrium [ Tue Jan 17, 2006 10:18 am ]
Post subject:  how do i move a guy in turing?

im taking a turing class and we are doing an assingment, and im making a game but i dont know how to move or collide

how would i move up(on up arrow command),down,left,right and how do i do collissions (example if you run into something, this happens)

Author:  Albrecd [ Tue Jan 17, 2006 10:39 am ]
Post subject: 

code:
var input : array char of boolean
Input.KeyDown (input)
if input (KEY_UP_ARROW) then
CharacterY += 3 %Or whatever number depending on how far you want the character to move.


Put this in a loop and do the same for right, left, and down (you can use the same variable for each)

Author:  Delos [ Tue Jan 17, 2006 10:41 am ]
Post subject: 

You start by reading the tutorials on Movement (specifically Input.KeyDown()) and collision detection. Check the Walkthrough for a complete list.

Then, you do some pseudo- and real- coding. Then, if you're still stuck, you come back here, post your code (using [code] or [syntax] tags), and we'll check it through to see if we can give you any pointers.

It's quite a simple process (both the one described above and what you intend to do). There are hundreds of examples of movement in [Source]. Look at a couple of those for inspiration if you need.


: