accelerate actors
zachdrago
Member Posts: 11
Ok so my game is ball popping game in which you pop/break groups of 3+ of the same balls. As you break groups of balls at the bottom of the stack I have the ones up above falling downward (gravity). However, I would like the balls to also move to the center of the screen.
Ex: If I clear the whole 2nd row of balls, I want the first row to move over and touch the 3rd row (which technically is now the second row.) Make sense?
* I can post a pic of what I mean if you don't understand.
Thanks!
Ex: If I clear the whole 2nd row of balls, I want the first row to move over and touch the 3rd row (which technically is now the second row.) Make sense?
* I can post a pic of what I mean if you don't understand.
Thanks!
Comments
My main problem is that if a ball that's on the bottom of a row of 5 balls is pushed, it will go out from under the row. I want the row to stay as a whole and move together. Any ideas?
Thanks!
actor one move to x,y value
Since your just moving them down, for the x value you can plug in self.position.x for the y you just need to figure out what y value you want to move them all down to...
So you'll use the same y value for all of them and the self.position.x for each of them..
Also make sure you move them at the same speed....
Good Luck!
With that said, your best bet would probably be a set of game attributes to denote how many actors are left in a column and then another set of game attributes to denote the X center position of those actors for the column they are in. Then if an inner column goes to zero members, you could, inside a rule, temporarily constrain the ball/bubble actors' X position (the actors in a sliding inward column) to a game attribute that gets updated via an "interpolate" from the column's current X to the destination X of the new column. I think that would keep them in sync and stop where they should. I'd probably add a "ManageColumn" actor to manage the columns' game attribute values.
The downside to this is that an outside column may become an inside column and columns that disappear go from being an inside column to an outside column when they get re-used. So depending on how your ball/bubble actors are setup/controlled, this could create some additional management issues. If GS had arrays, alot of this would be a non-issue.
Edit: Fixed the middle paragraph to read a little more clearly.
My only problem now is that they don't stay at that position. They move to the center of the screen, but if there is nothing there for the balls to run into and stop, they continue past the position and slide all the way to the edge of my screen.
Also they still don't stay in rows(I guess columns is a better term). I'd like them to stay in columns. And move as a whole to the center of the screen(or as close as they can get to it) and then stop.
also you can try rebumps idea
THIS IS A BAD IDEA, BUT THIS SHOULD WORK....
You could time how long it takes for them to get to that spot and then thrown this in there....
when game.move together is true:
timer:after "blankedy blank time" change attribute game.move together to false
Thanks
I bet Jack B. Quick throws together a demo. This seems up his alley! ;-)
Good Luck!
Ok I'm going to try what you suggested a couple post ago. Thanks!
Last thing(for now), I know I've asked already, but does anyone know how to make the actors stop once they reach the position I sent them to?
If you are using "Move To", they are obviously supposed to stop when they reach their destination but "Move To" is flakey at times (and gets flakier the more things you got going on in your scene).
My "temporary constrain" method above would, I believe, keep them in sync and stop upon completion (since the attribute they are constrained to is updated with "interpolate" which is pretty stable). You can substitute the updating of that attribute from using "interpolate" to just some incrementor.
The downside to my idea is you need a "column manager" to manage a few of the items and, like I said, depending on how things are setup, it could get complicated.
;-)
-replumb