Search found 69 matches

by RNavega
Thu Apr 08, 2021 11:55 am
Forum: Support and Development
Topic: If statement and Goto
Replies: 28
Views: 1054

Re: If statement and Goto

Ok, good luck. If you plan on having any screen transition effects then you don't need to make a full state just for them, you can do them from within a preexisting state and undo in the next. For example, say you want this: user hits PLAY on the menu, screen fades to black, then fades in into level...
by RNavega
Wed Apr 07, 2021 11:43 am
Forum: Support and Development
Topic: If statement and Goto
Replies: 28
Views: 1054

Re: If statement and Goto

How much have you read on software programming patterns? Specifically the state pattern, it's very cool: https://gameprogrammingpatterns.com/state.html As I understand it, you're encapsulating logic into separate objects, and at one given moment only one of those objects is controlling the game (bot...
by RNavega
Wed Apr 07, 2021 11:04 am
Forum: General
Topic: Looking for algorithm like flood fill
Replies: 7
Views: 613

Re: Looking for algorithm like flood fill

Will you design the tilemaps manually, with a tile editor? If so then I'd implement a 'tag' attribute so that you can tag tiles that belong to the same room when you're drawing them (ie set tag to "Room 1", start plotting tiles). This way no preprocessing is needed. If the tilemaps are bei...
by RNavega
Thu Apr 01, 2021 1:23 am
Forum: Support and Development
Topic: Enforce just one instance?
Replies: 21
Views: 4232

Re: Enforce just one instance?

It's not even listening. I doubt it consumes CPU. Looking into the source to luasocket, it does seem to be simpler than I was thinking: - https://github.com/diegonehab/luasocket/blob/master/src/wsocket.c#L154 (bind from WinSocket2 on Windows) - https://github.com/diegonehab/luasocket/blob/master/sr...
by RNavega
Wed Mar 31, 2021 2:22 am
Forum: Support and Development
Topic: Enforce just one instance?
Replies: 21
Views: 4232

Re: Enforce just one instance?

My only concern is which method uses less (CPU) resources. I don't know if using a listening socket to behave like a global mutex in this way involves any redundant polling from the OS or not.
by RNavega
Tue Mar 30, 2021 10:19 am
Forum: Support and Development
Topic: Enforce just one instance?
Replies: 21
Views: 4232

Re: Enforce just one instance?

After some more research, instead of using shared memory objects like I suggested before, there's a safer solution based on this library: https://github.com/oblique/named-lock/tree/master/src It uses a named mutex on Windows (so your program can lock that mutex, which is a memory object, and if any ...
by RNavega
Thu Mar 25, 2021 10:59 am
Forum: Support and Development
Topic: Enforce just one instance?
Replies: 21
Views: 4232

Re: Enforce just one instance?

What the Qt libraries use for this is a 'shared memory object', something used with IPC ("interprocess communication"). It's a named block of memory that different processes can access and read/write to like a file that exists in system memory. It's got a unique name, that's how different ...
by RNavega
Tue Mar 16, 2021 6:18 am
Forum: General
Topic: Fast Rope Physics for bump.lua?
Replies: 21
Views: 4469

Re: Fast Rope Physics for bump.lua?

You could port some Verlet engine into Lua, the rope would consist of several linked segments (like 100 total), each with a distance constraint. There are tons of live Verlet physics demos online using HTML5: - https://subprotocol.com/system/tree.html - https://codepen.io/guerrillacontra/pen/XPZeww ...
by RNavega
Sat Mar 13, 2021 4:40 pm
Forum: General
Topic: Apps for Animation?
Replies: 5
Views: 2073

Re: Apps for Animation?

Maybe a browser-based tool: http://tmtg.nl/tinyspriteeditor/

Google also suggested PiskelApp, but its website was offline when I tried to visit it: viewtopic.php?t=83198
by RNavega
Mon Mar 01, 2021 3:26 am
Forum: Support and Development
Topic: AABB Collision help?
Replies: 8
Views: 1498

Re: AABB Collision help?

Code: Select all

if (px1 < bx2) and (px1 > bx2)
Hi. How can px1 be both smaller and bigger than the same value?

I think you meant...

Code: Select all

if (px1 >= bx1) and (px1 <= bx2)