I'm trying to make a pac man game, but first I need a map. I have all the sprites required for it but when the pac man sprite collides with the map sprites it goes straight through. This is all of my code for it, please don't bother with my POS code other than the collision lol
X=90 Y=90 FRAME=0 ACLS LOAD"GRP4:PAC",0 PACLOOP=0 SPSET PACLOOP OUT PAC SPSET 1, 6 SPOFS 1,36,36 SPSET 2,96,16 SPOFS 2,52,36 SPSET 3,6 SPOFS 3,60,60 SPHOME 3,8,8 SPROT 3,90 SPCOL PAC,TRUE SPCOL 1,TRUE @GAMELOOP SPHOME PAC,8,8 SPOFS PAC,X,Y OLDY=Y OLDX=X IF BUTTON()==#UP THEN Y=Y-2: ROT=90:GOSUB @Pac IF BUTTON()==#DOWN THEN Y=Y+2: ROT=270:GOSUB @Pac IF BUTTON()==#LEFT THEN X=X-2: ROT =0:GOSUB @Pac IF BUTTON()==#RIGHT THEN X=X+2: ROT =180:GOSUB @Pac IF X<8 THEN X=392 IF X>392 THEN X=8 IF Y<8 THEN Y=8 IF Y>232 THEN Y=232 'COLLISION???????? IF SPHITSP(PAC, 1)!=-1 THEN SPOFS 0, OLDX, Y IF SPHITSP(PAC, 1)==-1 THEN X=OLDX ENDIF IF SPHITSP(PAC, 1)!=-1 THEN SPOFS 0,X,OLDY IF SPHITSP(PAC, 1)==-1 THEN Y=OLDY ENDIF 'NOPE DOESN'T WORK GOSUB @Blinky GOSUB @Pinky GOSUB @Inky GOSUB @Clyde IF FRAME==15 THEN FRAME=0 FRAME=FRAME+1 VSYNC GOTO @GAMELOOP @Blinky RETURN @PinkY RETURN @Inky RETURN @Clyde RETURN @Pac IF (FRAME==5 OR FRAME==10 OR FRAME==15) THEN IF PACLOOP==2 THEN SPSET PAC, PACLOOP SPHOME PAC,8,8 SPOFS PAC,X,Y SPROT PAC, ROT PACLOOP=0 ELSE SPSET PAC, PACLOOP PACLOOP=PACLOOP+1 SPHOME PAC,8,8 SPOFS PAC,X,Y SPROT PAC, ROT ENDIF ENDIF RETURN