Collision with Bump

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
fridays18
Citizen
Posts: 90
Joined: Tue Nov 01, 2022 3:24 pm

Collision with Bump

Post by fridays18 »

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
User avatar
fridays18
Citizen
Posts: 90
Joined: Tue Nov 01, 2022 3:24 pm

Re: Collision with Bump

Post by fridays18 »

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:)
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Collision with Bump

Post by darkfrei »

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
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
fridays18
Citizen
Posts: 90
Joined: Tue Nov 01, 2022 3:24 pm

Re: Collision with Bump

Post by fridays18 »

darkfrei 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
Yeah i alr saw that and I cant really understand whats happening lol
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: Collision with Bump

Post by pgimeno »

Bump is probably not the right tool for this job: viewtopic.php?p=184943#p184943
User avatar
fridays18
Citizen
Posts: 90
Joined: Tue Nov 01, 2022 3:24 pm

Re: Collision with Bump

Post by fridays18 »

pgimeno wrote: Tue Nov 29, 2022 7:21 pm Bump is probably not the right tool for this job: viewtopic.php?p=184943#p184943
Do you know of any other alternatives?
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: Collision with Bump

Post by pgimeno »

fridays18 wrote: Tue Nov 29, 2022 8:15 pm Do you know of any other alternatives?
Do your own physics, or try HC.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests