How do I change frame from each instance

Just started using Construct 2? Post your questions here

Post » Mon Dec 19, 2016 5:59 pm

ImageImageImage
B
71
S
21
G
220
Posts: 3,649
Reputation: 123,727

Post » Mon Dec 19, 2016 7:27 pm

Hey blackhornet

Actually, I need that each instance changes its frame once and one instance per time. For example: 1st = UID0 > change frame (wait 2 sec) / 2nd = UID1 > change frame / (wait 2 sec) / and so on. Can I change your code to get it in this way? Thanks for your help.
B
4
S
2
Posts: 123
Reputation: 846

Post » Mon Dec 19, 2016 7:46 pm

Braus wrote:I have 50 instances and I need to get some instances and change the frame of them one by one. I am trying to do this using the UID number but it is not working.

My pseudo-code:

Code: Select all
Repeat numTimes
> Pick all Sprite
> For each Sprite order by Sprite.UID ascending
> Sprite AnimationFrame > 0 : Sprite Set AnimationFrame = Sprite.AnimationFrame+1



try using IID - its the numeration of objects that are part of same type. while uid - is numeration of objects all placed in screen (if you have other objects placed your objects you pick wold not have a incremental order like from 1,2,3,4,5,6,7,8,9 but more like sprite uid 1,2,6,12,13,14, etc)
B
70
S
20
G
67
Posts: 1,314
Reputation: 42,301

Post » Mon Dec 19, 2016 9:36 pm

ImageImageImage
B
71
S
21
G
220
Posts: 3,649
Reputation: 123,727

Post » Mon Dec 19, 2016 10:22 pm

gamecorpstudio wrote:
Braus wrote:I have 50 instances and I need to get some instances and change the frame of them one by one. I am trying to do this using the UID number but it is not working.

My pseudo-code:

Code: Select all
Repeat numTimes
> Pick all Sprite
> For each Sprite order by Sprite.UID ascending
> Sprite AnimationFrame > 0 : Sprite Set AnimationFrame = Sprite.AnimationFrame+1



try using IID - its the numeration of objects that are part of same type. while uid - is numeration of objects all placed in screen (if you have other objects placed your objects you pick wold not have a incremental order like from 1,2,3,4,5,6,7,8,9 but more like sprite uid 1,2,6,12,13,14, etc)


Hey GCS

I think it's not the problem I am having. Maybe the UID is not the issue. But I don;t know what I need to do to get this working. It is the smaller part of the game and I cannot solve it. I will be grateful if you can try to change my pseudo-code to try to help me to figure out this feature.
B
4
S
2
Posts: 123
Reputation: 846

Post » Mon Dec 19, 2016 10:23 pm



Hey blackhornet

Thanks. I will give it a try.

Edited: Great! Danke!
B
4
S
2
Posts: 123
Reputation: 846

Previous

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest