fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
c7d88f9
v2.1.1a
1-- Pac-Man World 2 (NTSC v1.0) 2 3local core =require ( "games.core" ) 4 5local game =core . newGame ( 0x8037B3C0 ) 6 7local abs =math . abs 8 9function game . translateJoyStick ( x , y ) 10x =x / 127 11y =y / 127 12 13local near =1 - ( abs ( abs ( x ) - abs ( y ))) * 0.100 14 15local angle =math . atan2 ( x , y ) 16local mag =math . sqrt ( x * x + y * y ) 17 18-- Reduce the magnitute when x,y values are headed towards a diagonal 19return x + math . sin ( angle ) * mag * near * 0.25 , y + math . cos ( angle ) * mag * near * 0.25 20end 21 22game . translateCStick =game . translateJoyStick 23 24return game