Search found 1301 matches

by ivan
Thu Jul 12, 2018 2:00 pm
Forum: Support and Development
Topic: Compound Shapes?
Replies: 7
Views: 228

Re: Compound Shapes?

I have one last question about excluding shapes from other shapes hit boxes, like a cookie cutter. No, Box2D works with convex polygons up to 8 vertices max. Box2D has several other limitations too like minimum edge length and vertex angle. In short, you want to avoid long, thin triangles which is ...
by ivan
Tue Jul 10, 2018 5:15 pm
Forum: Support and Development
Topic: Scaling without blurring
Replies: 11
Views: 1660

Re: Scaling without blurring

And here is my result. You can notice a contour as well, which I do not want either (it may be a consequence of the blurring). Sorry for necroposting but I believe there is a possible solution for the contour issue. This works with transparent PNG images (using "indexed color"). You need to set the...
by ivan
Tue Jul 10, 2018 8:12 am
Forum: General
Topic: How can I store cool levels and sweet resources cozily
Replies: 3
Views: 146

Re: How can I store cool levels and sweet resources cozily

Do you have any inputs on how to organize our code better? This is a hard question. I think it's not a problem for small projects. For larger projects I like to divide my code into domains: drawing, input, audio, game logic. There is no "standard" for game level formats. Lua is a good format for st...
by ivan
Sat Jul 07, 2018 4:26 pm
Forum: Support and Development
Topic: Optomizing a Dijikstra Square
Replies: 1
Views: 161

Re: Optomizing a Dijikstra Square

Sure, setting up a profiler is a good starting point. I ran it on your initialization code (love.load) and here are the results for "C" hooks: +-----+----------------------------------+----------+--------------------------+----------------------------------+ | # | Function | Calls | Time | Code | +-...
by ivan
Sat Jul 07, 2018 5:30 am
Forum: Support and Development
Topic: VSync - Half Refresh / Skip Frames
Replies: 5
Views: 163

Re: VSync - Half Refresh / Skip Frames

Oh dear, there are much better ways than using love.sleep. VSync ensures that stuff is drawn whenever the video card is ready. You can't just use love.sleep and expect that everything will work fine. Does Love 2D have a VSync option for half-refresh rate or skip a certain number of frames? And if so...
by ivan
Fri Jul 06, 2018 2:01 pm
Forum: Support and Development
Topic: Send the love.physics world to players (multiplayer game)
Replies: 5
Views: 214

Re: Send the love.physics world to players (multiplayer game)

I've tried with Hero but I can't serialize the output... Bitser warns you right there why your "world" reference can't be serialized. It's because "world.save" returns a table with functions. This part won't be very hard to make. I suppose it depends on the game. Pretty hard to make/debug in my exp...
by ivan
Fri Jul 06, 2018 3:57 am
Forum: General
Topic: [solved] is there a better way to code this?
Replies: 3
Views: 226

Re: is there a better way to code this?

I think more generally, the question is, can multiple blocks occupy the same coordinate? If "yes" then you probably don't want to reference them using coordinates. If the answer is "no" then you need to research how hashing works. This way you can access objects directly: function removeBlock(x, y, ...
by ivan
Thu Jul 05, 2018 5:49 pm
Forum: Support and Development
Topic: Send the love.physics world to players (multiplayer game)
Replies: 5
Views: 214

Re: Send the love.physics world to players (multiplayer game)

The easiest option if your levels are not user generated is to just send the level name and build version. Each of the clients could have a copy of the levels to begin with. Box2D serialization is a good starting point. After that point you would only need to send the changes/input. Determinism (no ...
by ivan
Mon Jul 02, 2018 6:59 pm
Forum: Support and Development
Topic: Save directory different between fused and non-fused games [RESOLVED]
Replies: 5
Views: 230

Re: Save directory different between fused and non-fused games

Munki, it might be possible to use "love/dw" when running in fused mode but not vice versa.
There is no point in supporting both fused and non-fused modes -
you already have control of the binaries and how the game launches.
Also there is "isFused":
https://love2d.org/wiki/love.filesystem.isFused
by ivan
Fri Jun 29, 2018 6:16 am
Forum: Support and Development
Topic: how check AABB between 2 classes?
Replies: 3
Views: 416

Re: how check AABB between 2 classes?

You're almost there, a few things that could be improved: Check every pair of objects only once: for i = 1, #objects do for j = i + 1, #objects do objects[i]:overlaps(objects[j]) end end For classes, try to pass as few parameters as possible: function object:overlaps(b) local a = self if a.x + a.w <...