Help with moving actor in Simulated 3d

finalcutbobfinalcutbob Member Posts: 130
edited September 2012 in Working with GS (Mac)
I am making a bowling type game and I am trying to move the ball to the horizon while keeping it on the ground. I already have it set up so that I can launch the ball but I've been pulling my hair out trying to get it to look like its rolling down the road (its a road bowling game).

Its a simulated 3d perspective so the player is at the bottom of the screen where the ball is launched and the ball moves toward the top of the screen (horizon).

Right now when I flick the ball too hard it moves toward the horizon and keeps going up to the sky.
I need the ball to stay on the ground and not go up into the sky. So basically when it gets to the horizon, it doesn't go any higher, it just gets smaller making it appear like its moving further and further away.

The sky is the background which is the full size of the screen, the grass and road are one image which is on top of the background.

Please help!

Thanks a million!

roll ball


  • 3itg3itg Member, PRO Posts: 382
    you could add an actor at the horizon, and add rules to it so when it overlaps that actor, it goes no higher, shrinks or is destroyed or respawned.
    Im not sure I understood where you are at, so if need it to shrink too...
    when the player launches the ball, if you don't already have a boolean for this, make one...
    then the behavior while the ball is traveling would be something like:
    Interpolate self.size.height & self.size.width to smaller size
    I would play with the duration of my attributes so that the interpolate finishes as it hits the horizon line.
    you could also try tracking the speed of the ball in game.attribute, dividing it by something (like 1000) and setting that game attribute to the duration.
    Shooting from the hip here but I hope it helps.
  • finalcutbobfinalcutbob Member Posts: 130
    Thanks 3itg. I'll give it a shot and see what happens.
  • finalcutbobfinalcutbob Member Posts: 130
    Hmmmm. It's not working. This can't be that hard to do, can it? Am I trying to do something that's not doable in GS?
  • finalcutbobfinalcutbob Member Posts: 130
    Sorry for the long delays in responding. I still sometimes have problems logging into the forum.
  • finalcutbobfinalcutbob Member Posts: 130
    I'm not sure I'm doing this right.
    Isn't there a way to constrain an actor to another. Like, constrain the ball to the road, so it can still move around on the road but not go off it to the sky?

    Thanks again for the help!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,861
    Experiment with something like this:

    --Attribute (self.Position.Y) < (200)
    ---- (Do your movement up the scene)
    ---- Change Attribute: (self.Motion.Linear Velocity.Y) To: (0)

    Constrain Attribute: (self.Size.Width) To: (100-( self.Position.Y *.35))
    Constrain Attribute: (self.Size.Height) To: (100-( self.Position.Y *.35))
  • finalcutbobfinalcutbob Member Posts: 130
    Thanks RThurman. It sort of works so I'm going to keep playing with it to see if I can figure it out.

    Also, may I add that I am VERY new to this. Ive been using GameSalad for only a couple of weeks and this is my first game, so its kind of daunting.

    Thanks again.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,861
    Hope you get it working like you want.

    GameSalad is great for people who are new at this. (Its also great for those who have been at it for a while.)
Sign In or Register to comment.