Initial Progress
May 28th, 2011 10:02 amSo far today I’ve managed to get some base code done that I should have done a long time ago (hooray!) and basic player movement.
The level generation is still just a test thing to see how the tiles look… not great, but they’ll do for now.
I’m currently metaphorically bashing my head against a wall, trying to do collision checking. I’d forgotten how horrible it is.
I think jumping in using hitboxes isn’t a good idea. I’ll have to simplify it, get it working, and then make it horribly complicated.
Not visible is the scrolling view as you move around. (Yay!)
Anyway, not spending enough time on this today, and hitting a block have injured my plans in getting Done. Oh, well.
Heh, collision is what killed my last LD entry. When you complete this, I’d like to know some about how you did it.
the program1
I’m getting there now, I think. But yeah, I had collision detection code in a previous LD that let you climb walls, and sometimes lunched you through the ceiling suddenly, without warning. I don’t think I ever fixed it. XD
EDIT: ARGH! Diagonal ones are being a pain. Actually, that could be to do with not using a hitbox… Oh, I don’t know.
Even pixel-perfect collision uses hitboxes for performance reasons. It first checks if the two hitboxes overlap, then it checks the overlapping portion for any collisions on the masks.
Here’s a clip from some old code to give you the basic idea, although it only returns boolean :
function colliding(BoundingBox checking){
if(x > checking.x + checking.width || x + width checking.y + checking.height || y + height < checking.y) return false;
return true;
}
You'd probably be best to check for slopes in the collision loop. If there is a collision found, check if moving it X pixels up changes that.