Computer Science Canada PacMan Help |
Author: | Panphobia [ Mon Apr 01, 2013 8:08 pm ] | ||
Post subject: | PacMan Help | ||
I have been trying to make pacman in processing lately, just trying to get the pacman chomping in the direction of where he is headed, one thing that I am having trouble with is when the pacman stops moving he does not stay in the direction of where he was headed here is my code
|
Author: | nullptr [ Mon Apr 01, 2013 11:04 pm ] | ||
Post subject: | Re: PacMan Help | ||
One way to do it is to store your previous direction and draw using that instead. In each frame you could put:
Then, in your draw() method, you would use prevX and prevY instead of xDir and yDir. For the other problem, it depends how you're determining whether or not to draw the arc. From just looking at your code, it seems like you'll always draw an arc, unless I'm missing something, so there'd be no chomping at all. |
Author: | Panphobia [ Tue Apr 02, 2013 1:48 am ] |
Post subject: | RE:PacMan Help |
Yea thanks, I got the game working, now all I need to do is add the walls. |