Search found 8 matches

by DannyMcWopper
Wed Jan 10, 2024 6:58 pm
Forum: Support and Development
Topic: windfield physics help for enter and destroy method
Replies: 2
Views: 86614

Re: windfield physics help for enter and destroy method

Correct this 'for' cycle by adding :

Code: Select all

for i = #coins, 1, -1 do
    local coin = coins[i]
    if coin:enter("ball") then
        -- Coin has been collected
        coin:destroy()
        table.remove(coins, i)
        score = score + 1
    end
end
by DannyMcWopper
Fri Dec 01, 2023 4:27 pm
Forum: General
Topic: Collision not being registered
Replies: 10
Views: 28838

Re: Collision not being registered

I think the problem is the call to setPosition. This seems to cause some weirdness in the Box2D internals. I'm not sure exactly why it sometimes works and other times doesn't but I suspect it's not meant to be used to move things into a colliding state. I remove the setPosition and setAngle calls f...
by DannyMcWopper
Fri Dec 01, 2023 1:26 pm
Forum: General
Topic: Collision not being registered
Replies: 10
Views: 28838

Re: Collision not being registered

I've had a mess around with Windfield and while I managed get a similar behaviour as you describe, I believe it was result of using the API incorrectly. It would be best if you could share your .love file so we can properly see how your code works altogether. Hopefully I am sharing the project with...
by DannyMcWopper
Fri Dec 01, 2023 8:48 am
Forum: General
Topic: Collision not being registered
Replies: 10
Views: 28838

Re: Collision not being registered

Just some random thoughts...as first step try to figure out what exactly goes wrong. Is it the collision detection? Or deleting the bullet? As I said before, low speeds increase the probability of the issue. Maybe because with low speeds more bullets are alive at the same time? That might point to ...
by DannyMcWopper
Thu Nov 30, 2023 6:48 pm
Forum: General
Topic: Collision not being registered
Replies: 10
Views: 28838

Re: Collision not being registered

Without having looked much, this looks like the typical case of deleting elements from a table that is being iterated. At least the first loop looks like that. When you're removing an element from a table, all elements after it are renumbered. If you're deleting element 4 in a table of 6 elements, ...
by DannyMcWopper
Thu Nov 30, 2023 3:06 pm
Forum: General
Topic: Collision not being registered
Replies: 10
Views: 28838

Collision not being registered

Sometimes bullets go through the walls despite of the fact that both have colliders and bullets are meant to be destroyed once they enter the wall's collider. Bullets are being added to list_of_bullets {} list on each player or enemy shot and later get updated in love.update() for i,v in ipairs(list...
by DannyMcWopper
Sun Nov 19, 2023 11:57 am
Forum: General
Topic: Windfield and Tiled. Dynamically change tiles
Replies: 3
Views: 3400

Re: Windfield and Tiled. Dynamically change tiles

Would this help? https://love2d.org/forums/viewtopic.php?p=231293#p231293 https://love2d.org/forums/viewtopic.php?p=232236#p232236 Would this help? https://love2d.org/forums/viewtopic.php?p=231293#p231293 https://love2d.org/forums/viewtopic.php?p=232236#p232236 Could not get this method to work but...
by DannyMcWopper
Tue Nov 14, 2023 5:22 pm
Forum: General
Topic: Windfield and Tiled. Dynamically change tiles
Replies: 3
Views: 3400

Windfield and Tiled. Dynamically change tiles

I am working on a copy of Hotline Miami and can't solve the problem with breakable windows tiles. So, idea is simple: draw usual windows on load of level and change them to broken ones once bullet destroys them. I have solved the collisions part of the problem and it works as expected: player can't ...