Selecting an Object

Get help using Construct 2

Post » Sat Feb 22, 2014 5:25 pm

Sorry for the simple question but I am having a bit of a problem selecting a specific object.
I have created a series of (Sprite)buttons that will be red or green after an event. I can them to set the frame in order if I use sprite.UID and increase the value of UID incrementally each time. My problem is I have a function to RETRY that starts everything again and adds 20 to the SPRITE.UID when starting again.

It works fine until I restart. I could add 20 every time I restart but I'd need to save the number of RETRY's.

I am sure there is a better way to do this.

Thanks in advance for any help.
B
17
S
7
G
3
Posts: 12
Reputation: 2,798

Post » Sat Feb 22, 2014 6:50 pm

But aren't those buttons the same object ?
If so, just create a function "Spawn button" and give it a parameter : the frame number.
Example
B
17
S
8
G
4
Posts: 461
Reputation: 6,127

Post » Sun Feb 23, 2014 10:48 am

I have created 20 Dots across the bottom of the form. I want to change the animation frame based on a correct answer to 1 or 2.
I have been able to do this fine until I hit a button to retry and the UID increases by 20.
B
17
S
7
G
3
Posts: 12
Reputation: 2,798

Post » Mon Feb 24, 2014 10:41 am

Solved the problem by accessing the x position of the sprite, but there must be a way to call one sprite from a series other than by UID.
B
17
S
7
G
3
Posts: 12
Reputation: 2,798

Post » Mon Feb 24, 2014 11:08 am

B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812


Return to How do I....?

Who is online

Users browsing this forum: ksiads, Magistross, mtnboy22, Rable and 3 guests