This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- https://cargocollective.com/sagejenson/physarum | |
| -- also [Coding Adventure: Ant and Slime Simulations](https://www.youtube.com/watch?v=X-iSQQgOd1A) | |
| -- "agents" move around and leave behind a trail | |
| -- they also detect others' trail and steer towards it | |
| local m = {} | |
| local agent_count = 1e4 | |
| local iterations_per_frame = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- require this file to have reduced input lag and game logic that runs consistently | |
| -- inspired by https://gafferongames.com/post/fix_your_timestep/ | |
| -- note: this decouples update() from draw(); update() can run multiple times per frame | |
| local m = {} | |
| m.update_delta = 1 / 60 | |
| function lovr.run() | |
| if lovr.timer then lovr.timer.step() end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local lovr = lovr | |
| local dbg = require'debugger' -- https://codeberg.org/slembcke/debugger.lua - tested against 101cab55a4 | |
| dbg.auto_where = 4 | |
| dbg.use_color(true) | |
| local DEFAULT_COLOR = {1, 1, 1} | |
| local ANSI_COLORS = { | |
| ['0'] = {0.933, 0.867, 0.722}, | |
| ['97'] = {0.933, 0.867, 0.722}, |
OlderNewer