Qbasicnews.com

Full Version: Pacman larger wall collision
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm doing a pacman game now. i'm design the map by string chars
like lv(1)="0000011100"
lv(2)="0000010000"

number 1 is the wall and number 0 is empty blank where I can move pacman...since I did the game by graphics (from strings to graphics [line/put]) I had a problam.. block size is 30*30
and pacman size is also 30*30.. so moving steps is X=X+30
and using mid$(lv(X),Y,1)="1" is detect the the wall and that works fine.. but I want is X=X+5 steps (means lower steps) so the wall collision will still work correctlly.. how to do that.. what is the formula for lower steps using strings acording to graphics with wall collision in my case (I seen there is some DIVISION/MOD options or something like that.. or maybe there is something else)?
*runs in*
*stabs IS*
*runs out*
???
making a tile x tile pac-man is gonna be ghey, and you should use pixel collision, check the color of the wall - if it's blue you stop, if it's black you move, if it's yellow you eat, and pink/red/etc you die.
tile-based collision would be fine if you used p*p movement. another thing you could do is have sub-tile collision, have a mask for each tile with only black and white, testing by color only in the tile pac's on.

Tile by tile movement is fine if that's what you can pull off. We advance in steps, or soemthing like that.