Player Death Glitching [SOLVED]

0 favourites
  • 7 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi, all.

    Not sure what I'm doing wrong.

    Doing a first player death sequence on collision with sprite and it works fine for the most part, but occasionally glitches twice.

    --

    player-on collision with - set to player death animation

    wait 1.0 seconds

    player - set animation default

    player - set position x y

    --

    I tried it also with destroying the player and then system create object again, but it does glitch again when it falls occasionally.

    The player spawn sequence is the default from the Scirra template (if player is outside layout, move player to position x).

    The glitching is the player occasionally falling twice.

    Anybody saw this, solved it?

    Why does it happen?

    What's the proper coding sequence?

    --

    I added the collisions enabled as second flag as recommended by a you tube video (seems better), but still glitches occasionally (falls twice).

    --

    there is the destroy player - restart layout alternative (only foolproof one?) but I wanted to do it without spawning the layout again (or saving the previous one).

    --

    putting everything in a function but but the switching of animation seems to make it glitch the least (like 1 out of 20 tries), but if anyone has a foolproof solution, would very much appreciate it.

    and it seems to happen mostly when holding a key - like simulate platform pressing left etc.

    --

    could it be because the player is colliding with an animated object - 2 frames? and the collision condition only specifies the 1st frame? don't think so.

  • Here is the capx.

    http://www.darksunpictures.com/public/DEATH_GLITCH.capx

    Basically to replicate the glitch, keep pressing the right and up arrows at the same time while aiming at the flashing object.

    Very shortly, you should begin respawning twice intermittently while in the air.

    Can anybody confirm the error?

    Found a fix?

    ----

    This seems solved by RojoHound's portal spawner thingamjiger at another object with associated goodies.

    I've only had it glitch once, but I haven't been able to replicate the glitch since despite my best efforts.

    ---

    I really don't understand it. Now, it's glitching all the time UNLESS u hold both arrow keys, so if you allow the player sprite to fall after collission it almost always falls twice, which is what I don't want as it looks like an obvious glitch.

  • Here's the RojoHound version.

    This one glitches when you release the up and right arrow keys right after collision.

    The player usually falls twice from respawn point.

    http://www.darksunpictures.com/public/r ... h_new.capx

    ---

    Ideally, I would also like to block movement until player falls to ground and have the angle fixed while falling downward, but I dare not even attempt this until the above is solved.

  • Uhm, did I become some sort of a Construct 2 social pariah after my monetisation post?

    I just didn't see the built in objects. They were new to me.

    Before people were helping.

    Now, no one is helping.

    This is very disappointing.

    If this bugginess is a normal part of Construct 2, I really wish I hadn't bought my license as it seems to glitch on the simplest things.

  • I think that wait is the cause of the glitch. I would do it like this:

    isDead is a boolean instance variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes it's because of the wait. You are not destroying the player object when it dies, rather repositioning it so the player can move the sprite whilst the wait is going on. Put the wait outside of the function or don't use a wait at all as in the above example.

  • Thank you, Asmodean.

    That code rules.

    And thank you for the introduction on instance variables.

    I'll be sure to credit you.

    Plinkie, thanks for the input. I did experiment with toggling wait before, but it produced weird results.

    I stopped at Asmodean's code because it really works and is unbreakable.

    A little thing like that would've made the game look really unprofessional.

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