Create sprites by touching the screen(solved)

Get help using Construct 2

Post » Sun Apr 19, 2015 3:05 am

Hello, everybody.

Objective: To create sprites by touching the screen = done

problem:
- Create the Sprite to drag your finger
- Can not create sprite on top of another (may not be overlapping)

Image

I did it, the more it continues to create the sprite on top of another. And the worst many sprites, I put an accountant to verify this.

Where am I going wrong? Any solution?
Last edited by derikvlog on Sun Apr 19, 2015 4:03 pm, edited 1 time in total.
B
18
S
1
Posts: 89
Reputation: 1,284

Post » Sun Apr 19, 2015 4:17 am

Hi,
I think you should change the layer/z-order of the sprite in the events.

EDIT:
I'm not shure you can do what i said... sorry.
May be you can create a hidden instance of your object in your layout, or place it out of the layout, and then choose it's z-order.
And on click, you've just to show and place your object.
Construct 2, an easy way to do great things.
B
18
S
5
G
2
Posts: 43
Reputation: 1,353

Post » Sun Apr 19, 2015 6:41 am

one method would be to remember the UID (see https://www.scirra.com/manual/130/common-features) and then have a sub event to destroy this sprite if it is overlapping the family (sprites) .
another would be to create a temporary sprite (same size as the required but invisable) at the touch location and then check to see if this is overlapping the already created required sprites - if no overlap then spawn a required sprite at the temporary sprites location. destroy temporary sprite.


edit
https://dl.dropboxusercontent.com/u/143636437/examples%20for%20web/create%20and%20destroy%20if%20overlapping%202%20%28r202%29.capx
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sun Apr 19, 2015 4:04 pm

Solved, thank.
B
18
S
1
Posts: 89
Reputation: 1,284


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests