Reset sprite positions without restarting frame?

Get help using Construct 2

Post » Tue Sep 09, 2014 4:21 pm

Hey Construct Community,

Is there an event that can reset the position of a sprite without restarting the frame? Right now I have spawn points that the sprites can set their positions to, but I need to reset a lot of sprites and can't have too many spawn points in each frame.
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Tue Sep 09, 2014 5:01 pm

Use instance variable call it ID , and then for each sprite (or instance of same sprite) add 1. Add array plugin, and add the following: On start of layout ==> set array XY : X = sprite.ID Y: 1
X value: sprite.X
Y value : Sprite.Y
Hope it helps, try it out
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,431

Post » Tue Sep 09, 2014 6:54 pm

@Naji, Set up the array with relation to the instance variable but couldn't figure out how to reset the values of the array and instance variable.
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Wed Sep 10, 2014 12:41 pm

awmace5 wrote:@Naji, Set up the array with relation to the instance variable but couldn't figure out how to reset the values of the array and instance variable.


When do you want to reset values of the array?? please be specific to help you out
ImageImageImageImageImage
B
56
S
15
G
5
Posts: 852
Reputation: 11,431

Post » Wed Sep 10, 2014 2:31 pm

I'm trying to reset the sprite to it's original position after an event moves it (a platform that falls when the player lands on it, but resets when the player dies).
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Sep 04, 2015 3:32 pm

What about multiple sprite positions from on sprite? I have a cave where I want to reset the stalactites from one sprite. How would I set the array?

What I have so far--

Image
B
16
S
6
G
2
Posts: 164
Reputation: 3,207


Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu, Yahoo [Bot] and 7 guests