Goomba style enemy?

SteamworksSteamworks Member Posts: 61
edited November -1 in Working with GS (Mac)
so i read someone else's post about a goomba type enemy where you jump on top of them and the enemy dies. i did what they said:

1. create a second invisible actor thats thinner and taller than the enemy.
2. set it so collision with invisible actor destroys both enemy and invisible actor.
3. constrain the invisible actors x and y to the enemies x and y

if you do this then when you jump on top of the enemy you will touch the invisible actor and they both will die. this works but the hitbox area sucks. i have it set so if you touch the real enemy you die. sometimes when i jump on top of him we both die. also sometimes if i just jump over the enemy they die cause i guess the 2 actors touched. if i make the invisible actor taller than he will die when you jump over him (but i wont die by jumping on top of him). but if i make the invisible actor smaller so you HAVE TO jump on top of the enemy then when you jump on top of him you only kill him 1 out of every 10 tries. the other 9 times you die -.-

Are their any other ways to make a goomba style enemy OR is their a way to adjust the hitboxes so its more accurate?

Comments

  • SteamworksSteamworks Member Posts: 61
    Nevermind i just had to:
    1. create another hitbox and make it fallow the main enemy.
    2. make the new hitbox the right size and position.
    3. set this hitbox to be the one that destroys your character if you touch it.
    4. make it invisble
  • monsterpunchmonsterpunch Member Posts: 37
    I know an easier way.

    Since you bump into the invisible hitbox when you jump into it, make it so make a rule that when the characters Linear Y velocity speed < 0, then it can hit the invisible box. That way, when your main character is falling is the only time when it can jump on the head-hitting box. Tell me if it works.
  • svnsvn Member Posts: 445
    Rather than an invisible hitbox, here's an easier thing to do: Create two REAL attributes. Call them PlayerX and PlayerY. Constrain them to the main character's X and Y positions respectively. Now, in the Goomba actor say: Rule: when (game.PlayerY)/2 is GREATER than Goomba's Y, and collide with Player, Destroy.

    (i'm pretty sure this is how it goes; you can always check GShelper.com for the exact math)
Sign In or Register to comment.