| sind0o (1) | |
|
i'm trying to code a pacman-like game for my school project and i'm stuck! i made an array of strings and it looks smth like this: x x x x x x x x ("M" is the pacman) x M o o o o o x x o o o o o o x x o o o o o o x x x x x x x x x (<-- tiny version of the whole grid) now every time the player moves the pacman, i clear the screen and edit the array and then display it again. eg: player presses right key and this is displayed, and he ges a point. x x x x x x x x x M o o o o x x o o o o o o x x o o o o o o x x x x x x x x x this part works perfectly. the problem : i can't make the ghosts move because the array is displayed only when the player moves the pacman. i want the ghosts to move on their own, but i can't find a way to make them move when the man is stationary! i've been told to call the function using a timer but idk how i should incorporate that into my code :/ please help!! | |
|
|
|