09-24-2025, 07:52 AM
(09-24-2025, 06:49 AM)johnno56 Wrote: Nicely done! Those tunnels were very handy! The "settings" was a great idea...
Many thanks Johnno.
I have updated the zip file to resolve an issue that Marcus identified, where Pacman could be moved up or down while going through the tunnels - many thanks Marcus for finding this.
If you have already downloaded the original file, you can just update the "move_pacman()" function with this code:
Code:
function move_pacman()
if pacman.x >= 0 and pacman.x <= 1024-32
if keydown(KEY_LEFT) or joyx() < 0
if TM_GetCelAt( pacman.x - 1,pacman.y ) <> 0 ' if the cel is anything but a wall
pacman.dx = - pacman.speed
pacman.dy = 0
pacman.cell = 4
endif
endif
if keydown(KEY_RIGHT) or joyx() > 0
if TM_GetCelAt( pacman.x + pacman.w + 1,pacman.y ) <> 0
pacman.dx = + pacman.speed
pacman.dy = 0
pacman.cell = 0
endif
endif
if keydown(KEY_UP) or joyy() < 0
if TM_GetCelAt( pacman.x ,pacman.y - 1 ) <> 0
pacman.dy = - pacman.speed
pacman.dx = 0
pacman.cell = 2
endif
endif
if keydown(KEY_DOWN) or joyy() > 0
if TM_GetCelAt( pacman.x ,pacman.y + pacman.h + 1 ) <> 0
pacman.dy = + pacman.speed
pacman.dx = 0
pacman.cell = 6
endif
endif
endif
'allow pacman to move through the side tunnel
if pacman.x < 0 then pacman.x = 1024
if pacman.x >1024 then pacman.x = 0
endfunc'============================

