Ross
Ross Grams - Semi-hobbyist indie game dev using #Love2d, here to see & post about game dev stuff.
Long-time #Defold user, professional digital & traditional artist, cow caretaker, handyman.
@fossapps@mastodon.social Thanks, I'm definitely working on it! Most of the basic gameplay is functional: all the ship stations, various different weapons, the map, minimap, fog-of-war, a few basic enemies, enemy spawning, and some "jails" that you destroy to rescue friends.
Gotta love #love2d.
Normally I'm not a fan of coroutines in #lua, they tend to just make the code confusing.
However, when you have a long, looping process that would normally be run in one go (pathfinding, recursive tree iteration, proc. gen., etc.), coroutines let you run it step-by-step *without changing the code structure at all*, which is awesome for debugging.
Wherever you want to pause your loop, just add:
if coroutine.running() then
coroutine.yield(coroutine.running())
end
...
I love #Box2D. :)
I'm considering making a "Lovers in a Dangerous Spacetime"-like (tiny characters moving around inside a spaceship to manually control it using various workstations) and after 30 minutes I've got the basic physics working without a hitch. 🥳
At first the player could push the ship around from the inside, but with a few lines of code in the postSolve callback I apply the reverse of the impulse from each resolved contact back to the ship. Problem solved.
@fossapps@mastodon.social Thanks! Yeah, I think Lovers is still one of the best local co-op games out there.
