williamfiset / FruitFever

Fruit Fever adventure game by Micah Stairs and William Fiset
5 stars 2 forks source link

Falling Blocks #126

Closed williamfiset closed 10 years ago

williamfiset commented 10 years ago

Things that need implementation:

micahstairs commented 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!

williamfiset commented 10 years ago

Perfect! Just what I needed, works like a charm :)

williamfiset commented 10 years ago

I merged the new method of making blocks fall into the development branch.

micahstairs commented 10 years ago

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.

williamfiset commented 10 years ago

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.

micahstairs commented 10 years ago

Ah okay! Do you want me to copy the method over to the other branch or have you already?

williamfiset commented 10 years ago

Sure if you're up for it :P Otherwise I got it. I can see your commit.

micahstairs commented 10 years ago

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.

williamfiset commented 10 years ago

Did you pull? That's strange. Perhaps I forgot to push my local branch. Eitherway I got it.

williamfiset commented 10 years ago

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.

micahstairs commented 10 years ago

Which branch?

williamfiset commented 10 years ago

fallingblocks

micahstairs commented 10 years ago

Ohh.... I spelled it as"fallingBlocks"!

williamfiset commented 10 years ago

So, do we need better collision detection?

micahstairs commented 10 years ago

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);
williamfiset commented 10 years ago

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.