hello I'm making a small platformer and I'm using kikito's bump for collisions.
It's going well however right now I can't get jumping right. The problem is that, you can jump up walls indefinitely. I'm trying to make it behave much more traditionally, as it should.
So how do I make the jump not stick to everything essentially?
Use arrows to move, x to jump
Thanks, I attached the love for reference.
Love 0.10.0 is necessary for it to work properly.
BUMP Lib platformer help
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 28
- Joined: Fri Jan 22, 2016 2:48 am
Re: BUMP Lib platformer help
You are setting your y_velocity to zero and flipping your on_ground to True for EVERY collision. So when you are next to a wall, the game thinks you are on the ground. Instead do with goalY being 1 pixel below your current position. player.yvel = 0 only if that throws collisions.
Change:
To:
Code: Select all
local actualX, actualY, cols, len = world:check(item, goalX, goalY, <filter>)
Change:
Code: Select all
for i=1,cols_len do
player.yvel = 0
end
Code: Select all
local actualX, actualY, cols, cl = world:check(player, player.x, player.y+1)
for i=1,cl do
player.yvel = 0
end
Re: BUMP Lib platformer help
I know it wasn't your actual intention, but I find that stickiness fun
Re: BUMP Lib platformer help
zerocoolisgod wrote:You are setting your y_velocity to zero and flipping your on_ground to True for EVERY collision. So when you are next to a wall, the game thinks you are on the ground. Instead dowith goalY being 1 pixel below your current position. player.yvel = 0 only if that throws collisions.Code: Select all
local actualX, actualY, cols, len = world:check(item, goalX, goalY, <filter>)
Change:To:Code: Select all
for i=1,cols_len do player.yvel = 0 end
Code: Select all
local actualX, actualY, cols, cl = world:check(player, player.x, player.y+1) for i=1,cl do player.yvel = 0 end
Great, I see now. this was exactly what I needed, much thanks!
Re: BUMP Lib platformer help
Haha, funny you say that I thought the same thing.pgimeno wrote:I know it wasn't your actual intention, but I find that stickiness fun
Re: BUMP Lib platformer help
Here's an unrelated issue, I'm having a strange problems as a repercussion of my implementation of player velocity
Right now, when the player collides with anything it runs this code
this makes the player move properly, however the issue is that if I set yvel to 0 then every time it touches an object set to cross, the player keeps having his yvel reset, so he very slowly moves through objects with the cross filter.
does anybody have any ideas on how I could make the cross filter work properly with my velocity?
Right now, when the player collides with anything it runs this code
Code: Select all
local actualX, actualY, cols, poop = world:check(player, player.x, player.y+1)
for i=1,poop do
player.yvel = 0
player.onGround = true
end
does anybody have any ideas on how I could make the cross filter work properly with my velocity?
Who is online
Users browsing this forum: Bing [Bot] and 12 guests