Here's a PoC of the love.physics approach. Lots of magic numbers everywhere as I fine-tuned the parameters by trial-and-error, sorry.
As I feared, love.physics doesn't do bouncing too well, and balls sometimes stick to the cushions if they are very slow, even when setting restitution to 1.
Search found 3575 matches
- Mon May 20, 2024 4:52 pm
- Forum: General
- Topic: Pool(Billiards) physics (Need help)
- Replies: 4
- Views: 155
- Mon May 20, 2024 10:54 am
- Forum: Support and Development
- Topic: How do you really tell if your game has a memory leak?
- Replies: 5
- Views: 193
Re: How do you really tell if your game has a memory leak?
It's quite uncommon to have a memory leak when you're not using FFI. The most common cause of memory usage growth is not a memory leak; it's allocating objects and then disposing of them without releasing them, as Lua won't bother to garbage-collect them early because it doesn't "see" that...
- Mon May 20, 2024 10:15 am
- Forum: General
- Topic: Pool(Billiards) physics (Need help)
- Replies: 4
- Views: 155
Re: Pool(Billiards) physics (Need help)
Well, it depends on the degree of sophistication you're after. If you just want basic bounces, without considering aspects like friction with the cushions or during ball collisions, or whether the ball is hit off-centre to give it a spinning efect, then you could do with a simple bouncing-based sche...
- Sat May 18, 2024 6:12 pm
- Forum: Support and Development
- Topic: [SOLVED] push.lua and love.graphics.newQuad problem
- Replies: 5
- Views: 272
Re: push.lua and love.graphics.newQuad problem
The images with push use a linear filter, while the images without push use a nearest filter. With the nearest filter the adjacent tiles can bleed into the current tile. Changing to linear should solve it, if that's acceptable for your project. Otherwise, you'll need to fix your tileset by separati...
- Sat May 18, 2024 6:26 am
- Forum: General
- Topic: Polygon is too bitmap.
- Replies: 9
- Views: 461
Re: Polygon is too bitmap.
Have you tried what mön said? Filled polygons and circles are made of OpenGL triangles, which are usually rendered by default without antialiasing. setFilter won't help in this case though.
- Fri May 17, 2024 4:15 pm
- Forum: Support and Development
- Topic: [SOLVED] push.lua and love.graphics.newQuad problem
- Replies: 5
- Views: 272
Re: push.lua and love.graphics.newQuad problem
[Edited to avoid confusion to possible future readers] The images with push use a linear filter, while the images without push use a nearest filter. With the nearest linear filter the adjacent tiles can bleed into the current tile. Changing to linear nearest should solve it, if that's acceptable for...
- Fri May 17, 2024 11:35 am
- Forum: Support and Development
- Topic: Garbage Collector and FFI
- Replies: 17
- Views: 714
Re: Garbage Collector and FFI
This is a modified version of your code that does crash for me (for good reasons), using the image from the .love I posted above: local ffi = require('ffi') local texBuffer local terrainBuffer local backgroundBuffer do local imagedata=love.image.newImageData(640,360, "rgba8") local image =...
- Fri May 17, 2024 10:17 am
- Forum: Support and Development
- Topic: Garbage Collector and FFI
- Replies: 17
- Views: 714
Re: Garbage Collector and FFI
Come on, that's not the entire code. That's true, but i simply can't post my entire game. No one is asking you to do that. What we're asking for is a self-contained test program that can reproduce the problem. I've modified your code by adding this at the beginning of your code: local ffi = require...
- Sun May 12, 2024 12:05 am
- Forum: General
- Topic: [Help] Techniques for scaling
- Replies: 24
- Views: 1162
Re: [Help] Techniques for scaling
Interesting, so I should also deal with the rounding and animation problems. Conceptually, do you know what could be the underlying cause of the rounding and animation issues? I don't know the cause of the animation issues because I haven't looked into how you animate; I just saw the animation to c...
- Sat May 11, 2024 8:45 am
- Forum: Support and Development
- Topic: [Solved] Rectangle collision resolution only works on one axis
- Replies: 3
- Views: 318
Re: Rectangle collision resolution only works on one axis
Once the shapes are interpenetrating, both wasHorizontalAligned and wasVerticalAligned are going to be true, because they only check for interpenetration in one axis, and the shapes are known to be interpenetrating anyway, and the interpenetration affects both axes, so both checks will be true. This...