[Bump Physics] How to use this?
Posted: Thu Sep 19, 2019 12:18 pm
Hello everyone! I'm making a game and I am using Bump library. When reading the tutorial, I think it is suitable for me. But I get this small problem, and I think it's easy with pro like you.
This is some code in tutorial:
I don't know how to use this: other.isCoin, other.isExit, other.isSpring. How to identify it? We need to make that function? Or we needn't?
Or it have some method to know it is coin or exit,... in the tutorial but I miss it? Let you check it out: https://github.com/kikito/bump.lua . Help me please! Thank you so much. Hope you will help me soon soon! I am so excited to make a game with bump as soon as possible. Sorry because my English is not good. My bad. My bad.
This is some code in tutorial:
Code: Select all
function movePlayer(player, dt)
local goalX, goalY = player.vx * dt, player.vy * dt
local actualX, actualY, cols, len = world:move(player, goalX, goalY, playerFilter)
player.x, player.y = actualX, actualY
for i=1,len do
local other = cols[i].other
if other.isCoin then
takeCoin(other)
elseif other.isExit then
changeLevel()
elseif other.isSpring then
highJump()
end
end
end
Or it have some method to know it is coin or exit,... in the tutorial but I miss it? Let you check it out: https://github.com/kikito/bump.lua . Help me please! Thank you so much. Hope you will help me soon soon! I am so excited to make a game with bump as soon as possible. Sorry because my English is not good. My bad. My bad.