Closed williamfiset closed 10 years ago
"I need a level where such blocks exist (Where their boolean flag canFall has been turned on)."
Level 10 in levelDesigner branch!
Perfect! Just what I needed, works like a charm :)
I merged the new method of making blocks fall into the development branch.
I updated the Block.connectedSceneryAtPoint() method. It orginally only included blocks in the fallingBlock list, but we need to look for scenery attached to any block.
Thanks, that's something I would not have caught. That method is still a work in progress though, it shouldn't be in the development branch. I just want you to have access to the latest falling block software.
Ah okay! Do you want me to copy the method over to the other branch or have you already?
Sure if you're up for it :P Otherwise I got it. I can see your commit.
The fallingBlocks branch doesn't even have that method! Have you been working on the development branch by mistake?
I'll let you take it from here.
Did you pull? That's strange. Perhaps I forgot to push my local branch. Eitherway I got it.
On my branch blocks squish scenery. My issue is that I can only detect the actual image of the scenery object (typically 25x25 px ). To get accurate collision detection I would need to be pixel perfect. I know we have a bounding box for the player that we set manually. Do we have a mechanism in place to automatically determine the pixel compartment of an image? For example, the grass image is a 25x25 image but the pixels only account for like 25x12 of the picture. The collision detection is not "that" bad but it's still noticeable. Checkout my branch and tell me what you think.
Which branch?
fallingblocks
Ohh.... I spelled it as"fallingBlocks"!
So, do we need better collision detection?
Alright, I added this following code, it will work for any scenery images that fit within a TILE_SIZE.
// Needed for proper collision detection with scenery since fallingBlock.animate() hasn't been called;
fallingBlock.y += fallingBlock.dy;
for (Thing obj : FruitFever.sceneryBelow)
if (fallingBlock.contains(obj))
obj.changeImage(Data.invisibleImage);
I started working on the exceptions. Check out levels 11 & 13 (13 being for more rigorous one). My coding doesn't fully work but it's in the right direction! I need to go to work, cya.
Things that need implementation: