GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Variable collision detection

mikewaskiewiczmikewaskiewicz Posts: 1Member
edited December 2011 in Tech Support
I am trying to build something akin to Doodle Jump. The issue I'm bumping into is with collision detection. When a player jumps "through" a platform, no collision is needed. However, when the player "lands" on a platform the player needs to bounce. I could use location of player to turn collision on/off, but there are so many staggered platforms that this isn't practical. Does anyone know an easy way to do this?

Comments

  • CloudsClouds Posts: 1,599Member
    Rather than place the logic on every platform - just place it once on the actor.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    Only collide if the players y position is higher that the platforms

    It's not my fault I never learned to take responsibility for anything. ;)

  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    edited December 2011
    Also open up GameSalad click new and search for Doodle Jump theres some free demos in there I think.

    It's not my fault I never learned to take responsibility for anything. ;)

  • LeonardDeveloperLeonardDeveloper Posts: 4,630Member
    If it helps I thnk DBA offers a doodle jump template or offered a long time ago.... It might help to shoot darren an email or PM so head on over to www.deepblueapps.com
  • CloudsClouds Posts: 1,599Member
    edited December 2011
    ...
  • mikewaskiewiczmikewaskiewicz Posts: 1Member
    I solved this only moments after the original posting. For anyone that wants the solution...here it is. All of the logic is applied to the platform actor. You need to constrain the Player self.Position.Y to a variable. Then, if that constrained variable is greater than the self.Position.Y+(height of player/2) of the platform AND the Motion.Linear Velocity.Y of the Player is negative (<=0), then turn on the collide. The key is to make sure the velocity of the player is negative. You want want to make sure the player is in freefall for the collide. Anyways, it works and it's pretty efficient.
This discussion has been closed.