diff options
| author | jussi | 2022-06-21 12:36:22 +0300 |
|---|---|---|
| committer | jussi | 2022-06-21 12:36:22 +0300 |
| commit | 36baf4c1222aee409bb62be9770798bfa7fdd302 (patch) | |
| tree | 0b2722bf160178db06bb94df68fd5244affc8986 /examples/snake/main.lua | |
| parent | 6bac1a2c6364886a482530a0ef4cf849ae468806 (diff) | |
| download | reilua-enhanced-36baf4c1222aee409bb62be9770798bfa7fdd302.tar.gz reilua-enhanced-36baf4c1222aee409bb62be9770798bfa7fdd302.tar.bz2 reilua-enhanced-36baf4c1222aee409bb62be9770798bfa7fdd302.zip | |
Removed autoset fps.
Diffstat (limited to 'examples/snake/main.lua')
| -rw-r--r-- | examples/snake/main.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/snake/main.lua b/examples/snake/main.lua index 1fe6ae7..d6e4fa5 100644 --- a/examples/snake/main.lua +++ b/examples/snake/main.lua @@ -158,11 +158,11 @@ end --[[ Check if next segment is on left side. There are more mathematically elegant solution to this, but there is only four possibilities so we can just check them all. ]]-- -local function onLeft( this, next ) - return ( vector2IsEqual( this, { 0, -1 } ) and vector2IsEqual( next, { -1, 0 } ) ) - or ( vector2IsEqual( this, { -1, 0 } ) and vector2IsEqual( next, { 0, 1 } ) ) - or ( vector2IsEqual( this, { 0, 1 } ) and vector2IsEqual( next, { 1, 0 } ) ) - or ( vector2IsEqual( this, { 1, 0 } ) and vector2IsEqual( next, { 0, -1 } ) ) +local function onLeft( this, nextSeg ) + return ( vector2IsEqual( this, { 0, -1 } ) and vector2IsEqual( nextSeg, { -1, 0 } ) ) + or ( vector2IsEqual( this, { -1, 0 } ) and vector2IsEqual( nextSeg, { 0, 1 } ) ) + or ( vector2IsEqual( this, { 0, 1 } ) and vector2IsEqual( nextSeg, { 1, 0 } ) ) + or ( vector2IsEqual( this, { 1, 0 } ) and vector2IsEqual( nextSeg, { 0, -1 } ) ) end local function drawSnake() |
