How do I make a group of sprites move forward a set distance

Get help using Construct 2

Post » Thu Feb 25, 2016 10:04 am

HI, I have made a game in which whenever a button is pressed, the layout will refresh moving sprites forward a set distance. I did this no problem in a test capx. However when I try to do it in my main capx, it doesn't seem to work at all!
Which is weird as originally the code was for the sprites to move to one of 3 random places, and that works!

Please see a screenshot of the capx below to see what I mean:
Image

The code underneath, which has been disabled, works fine! Which is why I am mighty confused!

Any help would be appreciated!
B
6
S
1
Posts: 32
Reputation: 476

Post » Thu Feb 25, 2016 3:41 pm

Have you set the layout event sheet to the correct one, not another sheet?
ImageImage
B
101
S
45
G
22
Posts: 772
Reputation: 21,468

Post » Thu Feb 25, 2016 8:22 pm

Hi, thanks it is the right sheet.
For the life of me I can't figure out why it doesn't work, especially since if I enable the code underneath that executes fine :(
B
6
S
1
Posts: 32
Reputation: 476

Post » Thu Feb 25, 2016 9:08 pm

Well from what I can see that in disabled events the action little bit different but not big deal. You just can send your capx and I will investigate it for you.
ImageImage
B
101
S
45
G
22
Posts: 772
Reputation: 21,468

Post » Sun Mar 13, 2016 12:38 am

Hey

Thanks for the help.
I figured it out - my game loop involved the layout being re-started on each iteration, which meant the sprites would reset to the original position each time!
To get around that I originally changed my code to use the persist function, but now I have re-written most of the game to not need to reset the layout.

Regards
B
6
S
1
Posts: 32
Reputation: 476


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests