How do I move a group of things in unison?

Get help using Construct 2

Post » Sun Mar 22, 2015 11:51 am

Hi there,

I have a test I'm trying to do for a game to test performance. My friend is using phaser an HTML5 framework and I thought I'd take a stab at it with C2 because I can't believe it's actually laggy for him. I had to see if C2 would perform the same or (hopefully) better.

Basically I'm trying something in the vein of don't touch the white tiles.. imagine you have to touch an object to advance all of the objects down the screen. so you hop from object to object..

something like this https://www.youtube.com/watch?v=cqcL1D4DKGc i had trouble finding a video that shows the game modes that stop because everyone is showing their fast games which of course mean no time for pausing.. but the idea is that the units should only advance as a successful touch is made.

I tried some stuff with families and individual logs.. i was able to build the list of tiles with a loop but now its time to set it up so i can touch the bottom tile and they all move down together and stop where they should.

my first attempt was just to see them snap down, but the real goal of course would be to use some kind of tweening effect so it looks smooth with each "step"

Thanks!
Caleb
B
56
S
9
G
1
Posts: 938
Reputation: 6,458

Post » Mon Mar 23, 2015 1:11 am

So are you wanting it to slide each row down only wen you have pressed a black square or just constantly ?
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Mon Mar 23, 2015 5:29 am

@emoeden yea imagine they all slide down say.. 100 pixels each time you touch a certain one.. if i wanted them to all go down continously i could use a bullet behavior or some other "every tick" type of condition that would be continuous.

Now that you mention it.. maybe a bullet behavior could achieve this if i could be turned on / off and all bullet objects

however that still feels like a hack even if that worked. here would be another example... imagine clicking one object.. and dragging that object.. this would be pretty easy either rolling your own or using the drag/drop behavior.. but imagine if there were 10 copies of the same object around it.. not touched.. how could all of them move in unison relative to the position of the drag.. of course in that situation.. pinning an object seems like it might be helpful here, but i'm not sure that's really the most elegant solution..

my prior example in my initial post is what i'm trying to achieve, but it seems ultimately it's about how to interact with one object and have a bunch of others know to move in relation to that object as well.. be it on the x, y or both axis..
B
56
S
9
G
1
Posts: 938
Reputation: 6,458

Post » Tue Mar 24, 2015 10:27 am

The just use the Set Position to Object or Set X or Set Y to WhiteSprite.X + Number or WhiteSprite.Y + Number
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, DrKoala, ketramtu18, XMatrix, Yahoo [Bot] and 10 guests