wolf: format lua

This commit is contained in:
Fabien Freling 2026-02-11 21:44:35 +01:00
parent 43cc2a179e
commit 01f27d1076
3 changed files with 54 additions and 22 deletions

30
.luarc.json Normal file
View file

@ -0,0 +1,30 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"workspace.checkThirdParty": false,
"workspace.library": ["~/.local/lib/picotron-definitions"],
"runtime.version": "Lua 5.4",
"diagnostics.disable": ["lowercase-global"],
"runtime.nonstandardSymbol": ["!=", "+=", "-=", "*=", "/=", "%=", "^=", "|=", "&=", "<<=", ">>=", "//"],
"runtime.builtin": {
"basic": "enable",
"bit": "disable",
"bit32": "disable",
"builtin": "enable",
"coroutine": "enable",
"debug": "enable",
"ffi": "disable",
"io": "disable",
"jit": "disable",
"math": "enable",
"os": "disable",
"package": "disable",
"string": "enable",
"table": "enable",
"table.clear": "disable",
"table.new": "disable",
"utf8": "enable"
},
"runtime.special": {
"include": "require"
}
}

10
flake.lock generated
View file

@ -2,12 +2,10 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1728279793,
"narHash": "sha256-W3D5YpNrUVTFPVU4jiEiboaaUDShaiH5fRl9aJLqUnU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f85a2d005e83542784a755ca8da112f4f65c4aa4",
"type": "github"
"lastModified": 0,
"narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=",
"path": "/nix/store/99f9ksfwybf3naavcfs42wjyssqiliq5-source",
"type": "path"
},
"original": {
"id": "nixpkgs",

View file

@ -2,9 +2,9 @@
player = {
origin = {
x = nil,
y = nil
y = nil,
},
dir = nil
dir = nil,
}
col_bg = 1
@ -21,13 +21,13 @@ function _init()
break
end
end
if (player.x) break
if player.x then
break
end
end
end
function cast_ray(origin, angle)
end
function cast_ray(origin, angle) end
function draw_minimap()
local tile_size = 4
@ -58,13 +58,17 @@ end
function _update()
local speed = 0.1
if (btn(0)) player.dir -= speed
if (btn(1)) player.dir += speed
if (btn(2)) then
if btn(0) then
player.dir -= speed
end
if btn(1) then
player.dir += speed
end
if btn(2) then
player.origin.x += math.cos(player.dir) * speed
player.origin.y += math.sin(player.dir) * speed
end
if (btn(3)) then
if btn(3) then
player.origin.x -= math.cos(player.dir) * speed
player.origin.y -= math.sin(player.dir) * speed
end