accelerate actors

zachdragozachdrago Member Posts: 11
edited November -1 in Working with GS (Mac)
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!

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    use the move to behavior
  • zachdragozachdrago Member Posts: 11
    chosenonestudios said:
    use the move to behavior

    I've tried this and get mixed results.. I have all the balls with the same settings, yet some continue to move and slide passed the position I have them moving to.

    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!
  • chosenonestudioschosenonestudios Member Posts: 1,714
    when game.move together is true

    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! :D
  • rebumprebump Member Posts: 1,058
    As your app gets more convoluted with actors/actions, performance degrades, and the reliability of things happening in unison (and things working correctly within GS for that matter...i.e. erratic "move-to" behavior) also start to slip.

    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.
  • zachdragozachdrago Member Posts: 11
    chosenonestudios said:
    when game.move together is true

    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! :D

    Awesome! Ok that's semi-working!!

    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.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    do they have any sort of velocity thats making them keep going?

    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
  • zachdragozachdrago Member Posts: 11
    is there anyway to have the Physics Movable Boolean turn off when the ball gets to the specific position? I have the rule "When self.Position.X = self.Position.X, and self.Position.Y = 512 (center of screen)......." now what? WHat would i put exactly to make the Physics Movable Boolean for the ball turn off?

    Thanks
  • rebumprebump Member Posts: 1,058
    @zach: I don't believe "Moveable" is changable during scene run time. Even if you add a rule where "if self.Position.X >= NewColumnX then <xxxxx>" where "<xxxxx>" could be "set self.Velocity.X/Y to zero" or "set self.Velocity.X to NewColumnX" etc., then you get into some of the gray areas I allude to in my post above regarding column management (depending on how things are setup).

    I bet Jack B. Quick throws together a demo. This seems up his alley! ;-)
  • chosenonestudioschosenonestudios Member Posts: 1,714
    yeah, unfortunately you can turn it off :/

    Good Luck!
  • zachdragozachdrago Member Posts: 11
    @rebumb
    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?
  • rebumprebump Member Posts: 1,058
    @zach: I've been called "redump" and now "rebumb"...only thing left is "redumb" now. ;-)

    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.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I would do what repump says.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    firemaplegames said:
    I would do what REPUMP says.

    Haha
  • rebumprebump Member Posts: 1,058
    Everyone is a comedian!

    ;-)

    -replumb
  • zachdragozachdrago Member Posts: 11
    yeah i'm new to GS haha so I don't completely understand what all of that means exactly.. so i'll try to figure it out!! thanks!
Sign In or Register to comment.