I started following a tutorial for bump and for the most part everything was working smoothly; however, I am having some issues and glitches for when the player interacts with different objects. I've seen issues like this before where the player is unable to jump in bump or after it jumps onto another platform it is unable to fall off and just sort of glides there. My code doesn't have any of those issues, but the player glitches out once it is under the second object or jumps away from it. I am new to bump but I am getting a hang of it so hopefully I can figure out what is causing the issue.
Here is the file so it will be easier for you guys to understand and play around with.
Having trouble with bump when different objects are on the screen
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Having trouble with bump when different objects are on the screen
- Attachments
-
- bump_test.love
- (827.96 KiB) Downloaded 39 times
-
- Party member
- Posts: 563
- Joined: Wed Oct 05, 2016 11:53 am
Re: Having trouble with bump when different objects are on the screen
You are experiencing this behavior because you are using the world:check function, as opposed to the world:move function.
As per bump.lua docs:
Code: Select all
-- change this...
local actualX, actualY, cols, len = world:check(player, futureX, futureY)
-- to this
local actualX, actualY, cols, len = world:move(player, futureX, futureY)
If you use world:check without using world:update alongside it, you'll get this sort of jittery behavior where the movement can behave rather erratically. Generally, you'll be fine with just using world:move, unless you have a specific reason for world:check.It (world:check) returns the position where item would end up, and the collisions it would encounter, should it attempt to move to goalX, goalY with the specified filter.
Notice that check has the same parameters and return values as move. The difference is that the former does not update the position of item in the world - you would have to call world:update in order to do that. In fact, world:move is implemented by calling world:check first, and then world:update immediately after.
Re: Having trouble with bump when different objects are on the screen
Thanks for the advice! I didn’t know there was a difference between the two functionsMrFariator wrote: ↑Sat Aug 26, 2023 2:25 pm You are experiencing this behavior because you are using the world:check function, as opposed to the world:move function.
As per bump.lua docs:Code: Select all
-- change this... local actualX, actualY, cols, len = world:check(player, futureX, futureY) -- to this local actualX, actualY, cols, len = world:move(player, futureX, futureY)
If you use world:check without using world:update alongside it, you'll get this sort of jittery behavior where the movement can behave rather erratically. Generally, you'll be fine with just using world:move, unless you have a specific reason for world:check.It (world:check) returns the position where item would end up, and the collisions it would encounter, should it attempt to move to goalX, goalY with the specified filter.
Notice that check has the same parameters and return values as move. The difference is that the former does not update the position of item in the world - you would have to call world:update in order to do that. In fact, world:move is implemented by calling world:check first, and then world:update immediately after.
Who is online
Users browsing this forum: No registered users and 11 guests