Spike damage problem.

0 favourites
  • 11 posts
From the Asset Store
For problem solving, puzzles, bubbles, platforms and other adventures.
  • How do i Make the player get hurt when he hits the TOP of the spikes? it feels like i've tried everything imaginable.

    heres what i left it with:

  • i think that can be related to your hitbox in each of your sprite. The last tool on the image's editor.

  • Tried it, doesn't fix it. anything else?

  • why do you have the player.y>spikes.y ? which is saying is the player below the spikes (as y goes from top to bottom of screen )

    If you only have the hitbox over the top section of the spikes is this needed ?

    Or are you looking to have a "if character is only falling onto the spikes then damage character ?" (maybe with a character.angle is between 0 and 180 ?)

  • Sometimes when you do compare two values and compares the value of a single variable, whatever its type, the system is in loop?

  • why do you have the player.y>spikes.y ? which is saying is the player below the spikes (as y goes from top to bottom of screen )

    If you only have the hitbox over the top section of the spikes is this needed ?

    Or are you looking to have a "if character is only falling onto the spikes then damage character ?" (maybe with a character.angle is between 0 and 180 ?)

    I've also tried < and =, but none of them work either.

    does anybody know what to do?

  • https://db.tt/E0vxe1VT

    edit -

    updated (downdated ? ) to version 178

  • I have r178. It wont open in mine. I refuse to get the updated ones because the node webkit wont work with them.

    Could you snap a screenshot or something of the events?

  • r178 - thats about a year old ? I can't say I have noticed problems with the node webkit. Anyway....

    How to open newer versions of capx files

    unzip the capx and edit the caproj file in a text editor

    find where is says (for example)

    <saved-with-version>21100</saved-with-version>

    and replace with an older number eg

    <saved-with-version>17000</saved-with-version>

    save and try

    Search the forum for more information about opening newer versions in old versions.

    (post above updated)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I did it. But i should've mentioned that my spikes are solid. Could that be a problem?

  • doubt it - I still think it is down to the shape/size of your hitbox (as mentioned by midward ) and the position of the origins of the two sprites and the fact that "Y" goes from top to bottom so to check if falling onto spikes you will need to check

    if player.y < spikes.y then...

    (ie players y position is less than the spikes which makes the player above the spikes)

    If you post your capx then we can have a look.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)