How do I use IID to store coordinate of sprite respawn

0 favourites
  • 4 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I've asked about this in the forum a while ago. But I still cant figure out of this.

    I have a sprite that can be pushed all the way in a direction (up/down/left/right in a top down view).

    And it will be destroyed if hit a wall.

    I want the sprite to respawn in the previous position (if the sprite previously in x:40,y:50).

    After a sprite is destroyed or a sprite is pushed to a direction/ kicked, it will start respawn in the x:40 , y:50 position.

    I've tried using IID to store the sprite's IID to a global variable, which can be used to "Pick Nth instance" , so after the push, Nth instance will be the sprite's IID which have been pushed. I used IID because it is said that IID still intact even after a sprite is destroyed.

    This method works for the first respawning, but doesnt work in the second respawning.

    I really dont know the problem why this is happened.

    It is hard for me to explain this problem, so see the capx for yourself.

    This is the capx

    s000.tinyupload.com ... 5753272595

    Thanks anyway.

  • Please make sure you tick "Do not automatically parse URLs" in your post to make sure, your link doesn't get shortened.

    Because the way it is now, we can't use it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK here it is.

    s000.tinyupload.com ... 5753272595

    A couple of hours ago, I tried to use pick UID to store the UID of "what would be kicked" sprites.

    I used dynamic text to debug this. And it shows that the UID actually stored in global variable for the first time, but it doesnt work for the second time ( when I move 4 ways and overlapping the "what would be kicked" sprites it shows the sprite UID/ like in UID 1or 2), but it doesnt show the UID for the second time it overlaps.

    I dont understand why this is happened.

  • Check my games on Arcade, there have some of them with sample CAPX to download and learn.

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