How to collide with a bouncing object?

huppertatorhuppertator Member Posts: 34
edited February 2013 in Working with GS (Mac)
I have a separate question out about another part of this game, but this issue is also very troublesome.

I have a bouncing actor, a hand on a spring, that I want to collide with a bottle being thrown at a target. I only want the bottle to get smashed by the hand when the hand is sprung up (because of the placement on the scene the bottle is able to hit the hand anywhere, anytime). Because of the way I'm animating the hand (14 frames, 7 frames per sec, hand is up in frames 4-10) it's really hard to match the time the hand is up with a boolean or timer.

Right now I'm using a timer: after .6 seconds... and a nested timer: for 1 second CHANGE ATTRIBUTE boolean hand up to TRUE. But that obviously isn't doing the job right because it isn't keeping track of when hand up is false. Not sure what to do here.

Comments

  • BrackAttackBrackAttack Member Posts: 22
    Having trouble envisioning this - So the actor bounces up and down (Y axis only?) and can collide with the bottle anytime/where - but you only want it to register a collision when the animation of that bouncing actor is ~ half way through its animation? Is the animation looping also? Can the hand not be sprung up while the hand actor is up in the air?

    What about an invisible actor that is placed above the bouncing hand and when the bouncing hand collides with the invisible actor it activates a new "collision with bottle is possible" on/off rule ?
  • huppertatorhuppertator Member Posts: 34
    edited February 2013
    The hand actor is bouncing on a spring. So the actor itself is stationary but it has an animation. When the hand is animated up the y position never changes.

    Maybe I could do if the bottle is beyond a certain y position and the hand is also past the y position then the collision will occur?
  • huppertatorhuppertator Member Posts: 34
    My suggestion above did not work. Even though the bottle is above a defined y position it can still collide with the transparent space of the hand (so if the image of the hand is below the y position there is still transparent space on the actor that extends above the y position). Any other suggestions?
  • huppertatorhuppertator Member Posts: 34
    I still can't get it right. Does anybody know or have an idea that might work?
Sign In or Register to comment.