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

Get help using Construct 2

Post » Sat Nov 12, 2016 7:05 am

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?
B
22
S
4
G
2
Posts: 55
Reputation: 2,220

Post » Sat Nov 12, 2016 8:40 am

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?
Image
B
10
S
3
G
2
Posts: 81
Reputation: 1,735

Post » Mon Nov 14, 2016 7:51 am

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?
B
22
S
4
G
2
Posts: 55
Reputation: 2,220

Post » Mon Nov 14, 2016 9:10 am

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

Swivels wrote: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?
Image
B
10
S
3
G
2
Posts: 81
Reputation: 1,735

Post » Mon Nov 14, 2016 4:40 pm

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?
B
22
S
4
G
2
Posts: 55
Reputation: 2,220

Post » Wed Nov 16, 2016 4:11 pm

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

Image

Unless I missed some subtlety, that should be close enough to what you want.
Image
B
10
S
3
G
2
Posts: 81
Reputation: 1,735

Post » Thu Nov 17, 2016 7:41 am

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
B
22
S
4
G
2
Posts: 55
Reputation: 2,220

Post » Thu Nov 17, 2016 9:40 am

Alright, so that worked for the x alignement problem? :P 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.
Image
B
10
S
3
G
2
Posts: 81
Reputation: 1,735

Post » Thu Nov 17, 2016 5:58 pm

Image
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
B
22
S
4
G
2
Posts: 55
Reputation: 2,220

Post » Fri Nov 18, 2016 11:27 am

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.
Image
B
10
S
3
G
2
Posts: 81
Reputation: 1,735

Next

Return to How do I....?

Who is online

Users browsing this forum: alextro, beohs, Blendi1223 and 13 guests