How do I replace objects in layout edition

Get help using Construct 2

Post » Tue Dec 06, 2016 11:28 am

Hello,

I have 2 objects of same size, OKTouch and NOTouch in the layout, and their place in the layout is specific (grid placement) and object type (OKTouch or NOTouch object) change depending of the level. (I use them for user touch in the event)
So how I can replace an object by another object in the layout editor (for example replace a OKTouch object by a NOTouch object without having to re-enter X Y coordinates of their placement in the grid) ?

Thanks for your understanding.
Image
B
6
S
2
Posts: 42
Reputation: 538

Post » Tue Dec 06, 2016 11:31 am

You can set the collision check on or off as you desire with events.

The collision checks are what trigger the button when a touch is over it.
Image
B
107
S
24
G
18
Posts: 1,362
Reputation: 22,772

Post » Tue Dec 06, 2016 11:33 am

The collision check have to be on for the 2 objects, because the OKTouch object add points and NOTouch object remove points.
Image
B
6
S
2
Posts: 42
Reputation: 538

Post » Tue Dec 06, 2016 11:37 am

Okay, this is a new behavior.

Make an object with two sprite animation, call each one as OKTouch, NOTouch.

Change the animation as necessary.

In the events, check the currently animation and do the desired event for each condition.
Image
B
107
S
24
G
18
Posts: 1,362
Reputation: 22,772

Post » Tue Dec 06, 2016 11:43 am

I can On Touched event with object animation checking ?
Image
B
6
S
2
Posts: 42
Reputation: 538

Post » Tue Dec 06, 2016 11:50 am

For sure
Image

You can use instance variables, and various ways to achieve the same.
Image
B
107
S
24
G
18
Posts: 1,362
Reputation: 22,772

Post » Tue Dec 06, 2016 11:59 am

Thanks for your help ! Very good workaround.
Image
B
6
S
2
Posts: 42
Reputation: 538


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot], yiuyiu6666 and 12 guests