GameSalad

How to get actor to die when squished

stan_mcginnisstan_mcginnis Posts: 4Member, BASIC
edited June 20 in Working with GS (Mac)

I am making a platformer game where the player can ride a moving platform, which travels horizontally, between two still platforms. I want the player to die if he gets crushed in between the moving platform and the still platform, instead of just glitching through the moving platform. I have tried many different ways but can never get the player to consistently die when crushed.

Answers

  • Triangularity GamesTriangularity Games Founder/Owner MarylandPosts: 140Member, PRO

    You could have a rule something like:
    When the two platforms are colliding and the player.Y is below where it should be (i.e. below the platform.Y+(platform.height/2)
    ->Then here you can do whatever you want to the game...

    Something like this. Hopefully this helps.

  • stan_mcginnisstan_mcginnis Posts: 4Member, BASIC

    I already tried that, it makes they player die whenever they is touching the side of thr platform even if he is not getting squished.
    I tried doing this with a platform width too, but it didnt work because the platform width/2 only updates when the player is touching the moving platform so if the player touches it, waits until it moves a bit and then touches it again, they will die before the platform width/2 updates,

Sign In or Register to comment.