How do I can remove the same sprite when i touch them

0 favourites
  • 11 posts
From the Asset Store
Customize the animation of character when item changed
  • How i can remove a same sprite several times, for example I have a wall of partitions which is a same sprite and I want to touch each partition can remove it, there are 100 partitions in total (10x10), no arrays, someone can put me a Example or give me the guide for something similar?

    I need create 100 sprites?

  • Hi Swivels!

    If I understood correctly, you have some Partitions that are identical, and others that are not. And you want a click on a sprite to remove it and all its doubles. If so, then you must add an instance variable to Partitions, for example "type", that is identical between some partitions. Then you could do :

    On Partition clicked (Mouse condition)

    Partition "type" instance variable = something (Partition Condition)

    Destroy Partition (Partition action)

    Maybe you could send a capx of your own that we'd modified to show you in more details if you don't manage to do this on your own with my method?

  • Thanks but i found the solution using arrays (i'm learn yet), well, the other problem is that i need create all objetives (is the same sprite) in one second and then delete them ( but the part of deleting have solution now), if i use system for create is correct but i can't create one a one on X or Y (when create the firts one need to the other create next to the first .In another post in the same game i used global variables for buy a sprite but don't work. How i can found a solution for the 2 problems?

  • Ok, nice then! For the second problem, I'm sorry but I have difficulties to understand what you explained. Especially that part :

    if i use system for create is correct but i can't create one a one on X or Y (when create the firts one need to the other create next to the first

    Would you mind to reformulate this?

  • Ok no problem I need to create those sprite (is the same) in the X axis every second, each sprite when creating will be next to the other (followed), when I use system I can only create it in random or in a position but not in the X axis one Next to the other.

    Can you teach me how to put pictures in the posts to facilitate future questions?

  • Alright! Then maybe you should use a variable, that increase each time you want to create a new sprite, just like this :

    Unless I missed some subtlety, that should be close enough to what you want.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do it with array "push front Tabique1.UID on X axis",

    But I need now that when an object collides with "Partition", a certain amount of them is eliminated within the collision range.

    Teach me to upload pictures in comments please

    Teach me to upload pictures in comments please

    Teach me to upload pictures in comments please

  • Alright, so that worked for the x alignement problem? I'll look for that but you should look about the distance System expression. Uploading picture ? Go on noelshack for example, get your img URL and put it here between the img tag.

  • this was my solution, But now I need that when an object collides with "Partition", a certain amount of them is eliminated within the range of collision.

    Thank u 4 help and teach me about the picture

  • Hi again! You're welcome, I hope you'll manage to do what you want eventually.

    Here's a capx of an impact system. I think that will give you enough event materials to try something by your own.

  • thank you

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