Ive been trying to use Bump.lua lib and I understand just about everything except how collision works, ive looked through the forums and the docs and cant find anything helpful, its all a bit confusing so if someone could explain it id appreciate it
NOTE: I know how to setup the world, add collision boxs, and update the collision just not how it actually works all together
Collision with Bump
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Collision with Bump
Another note: Im using bump since ive heard it works well but if anyone has any alternative collision methods that might work better I would be happy to know:)
Re: Collision with Bump
I've never used this lib but but found it here:
https://github.com/kikito/bump.lua#collision-resolution
https://github.com/kikito/bump.lua#collision-resolution
Code: Select all
function movePlayer(player, dt)
local goalX, goalY = player.x + player.vx * dt, player.y + player.vy * dt
local actualX, actualY, cols, len = world:move(player, goalX, goalY)
player.x, player.y = actualX, actualY
-- deal with the collisions
for i=1,len do
print('collided with ' .. tostring(cols[i].other))
end
end
Re: Collision with Bump
Yeah i alr saw that and I cant really understand whats happening loldarkfrei wrote: ↑Tue Nov 29, 2022 2:51 pm I've never used this lib but but found it here:
https://github.com/kikito/bump.lua#collision-resolution
Code: Select all
function movePlayer(player, dt) local goalX, goalY = player.x + player.vx * dt, player.y + player.vy * dt local actualX, actualY, cols, len = world:move(player, goalX, goalY) player.x, player.y = actualX, actualY -- deal with the collisions for i=1,len do print('collided with ' .. tostring(cols[i].other)) end end
Re: Collision with Bump
Bump is probably not the right tool for this job: viewtopic.php?p=184943#p184943
Re: Collision with Bump
Do you know of any other alternatives?pgimeno wrote: ↑Tue Nov 29, 2022 7:21 pm Bump is probably not the right tool for this job: viewtopic.php?p=184943#p184943
Re: Collision with Bump
Do your own physics, or try HC.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests