0 Favourites

How do I use IID to store coordinate of sprite respawn

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy 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)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Sprite Font Generator - v3
368 112,259
RetroDaddy's avatar
RetroDaddy
Unread hot topic Locked topic
223 15,823
Tom's avatar
Tom Construct Team Founder
Unread hot topic
86 28,702
St4rDu57's avatar
St4rDu57