tilmah wrote:Any suggestions would be appreciated.
Hi, I don't have any particular suggestion, I have never used ATL yet. Good luck!
tilmah wrote:p.s. Why do you have 't' and 'l' in Bump instead of 'x' and 'y'? What do they stand for?
t,l,w,h => top, left, width, height. I don't call them x and y because sometimes I also need the right and bottom (r and b) and it is weird to have x,r, y,b.
Found a typical collision bug on your demo, dunno if it's just in the demo and I can't really explain it so do this:
Set fly to true.
Go up intil you colide into another object (no the walls, it has to be one of the rectangles).
Once you are coliding go slowly to the left or to the right.
You'll notice the you'll get teleported to the side of the coliding object before ending the colision.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping
Sometimes bump "jumps". It is good, but it is not perfect. The demo does a very simplistic collision response, too. You might see a "jump" here or there, I'm afraid. It was the best I could do in 2-3 months; you should not see them very often.
Indeed, it can be tricky and really glitchy, I'm still trying to code collision for my game and till now I've complitly recoded my player.lua two times and I think I'm going for the third.. But this time I'm gonna use HC, I hope it works out
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping
I'm trying to push other players by jumping or running into them.
Is there any support for that? Or does anyone have any tips/snippets?
I tried quickly but it's pretty screwy. So I decided to ask here before I mess with it for hours.
When looping through cols, does it make sense to call world:move on the player I bump into to push them?
But then wouldn't they have to loop through their cols from that push and push anyone else they just bumped into? Sounds like a mess and potential infinite loop?
The simplest way to move other characters around is by changing their velocity. The explosions do this in the demo. You can modify the velocity of one object when resolving the cols of another (provided that you handle velocity nicely, not resetting it manually on each frame)
Moving other items "as you move", like pushing a block in zelda, is trickier. You must move the other object the exact amount. Too littke and you will tunnel through it. Too far and it will be separated, not touching any more.
There is an example of this in the "platforms" branch on github. The platforms move the player "just the right amount". Have a look at platform.lua (sorry I can't link it)
I'm trying to think about how one would utilize multiple bump worlds to create background and foreground collision layers, and a player that can move between them. Would it be best to have a player hitbox in each layer and just control the one in the active layer, making the appropriate changes with update when switching?
My specific idea is to achieve a 'kinda-3D' ish world in an otherwise traditional sidescrolling platformer, where the player can jump to fore- and backgrounds either arbitrarily or at specific points (if arbitrary movement proves too complex). There will be npcs on these layers, too, moving around and, say, shooting arrows at the player on other layers.
Sarcose wrote:I'm trying to think about how one would utilize multiple bump worlds to create background and foreground collision layers, and a player that can move between them. Would it be best to have a player hitbox in each layer and just control the one in the active layer, making the appropriate changes with update when switching?
My specific idea is to achieve a 'kinda-3D' ish world in an otherwise traditional sidescrolling platformer, where the player can jump to fore- and backgrounds either arbitrarily or at specific points (if arbitrary movement proves too complex). There will be npcs on these layers, too, moving around and, say, shooting arrows at the player on other layers.
I would just put them all in the same world and have one player but change the "filter" value depending on the 2.5D position. For example like this:
world:move(self, newx, newy, function (other)
if other.layer == self.layer then
return "slide" -- slide along obstacles
else
return nil -- do not collide with other objects
end
end)
Of course you will probably have to put a bit more logic in there for other types of things (like powerups, coins etc, you probably don't want to "slide" along those)
Both options can work. Either "1 world per slice" or "everything in one world, and filter by slice". The former will probably be slightly more efficient, but also probably more difficult to work with.
Also, please use the following thread to talk about bump, this one is about a previous version: