Ball Breaker: Can't Figure Out Ball Spawning Behavior

Hi all - I'm a newbie, so this is probably a very basic thing (I'm still learning).

I'm working on a ball breaker game, based on a template someone shared in the forums (which itself is based on a template that used to come with GS, as I understand it... it's here, called "noslowdown.zip": http://forums.gamesalad.com/discussion/47326/i-am-having-problems-getting-a-ball-to-move-at-a-constant-speed ).

I'm having trouble with the ball spawning behavior, though. The ball is spawned by a Game Controller actor. The behavior goes like this:

If game.BallOnScreen is false and Mouse is Down
Spawn Ball in Front of Actor
In Direction 0 relative to actor
From position 0,0 relative to actor

I want to make it so that the ball spawn at the paddle's position and then shoots up. Right now the ball spawn at the Game Controller's position and goes down, but I can't figure it out.

Can anyone help?

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Put the same spawning rule/behaviors in the paddle. (And then turn them off in the controller actor.)

    Direction would be '90' instead of '0'. (In GameSalad 'up' is 90 degrees.)

  • wirelesstkdwirelesstkd Member Posts: 75

    Thanks, @RThurman , the problem with this, though, is that the ball always shoots down (I moved the paddle to the middle of the screen so I could see what's going on). When I go in to the ball's behaviors I find a "set initial velocity rule" that reads:

    Change movement to go in direction 0 relative to actor

    I tried changing zero to all different directions, but no matter, the ball always ends up going down (sometimes it moves down and to the side). This means the ball always kills itself on spawn (based on my rule for the ball killing itself when it hits the ground).

  • wirelesstkdwirelesstkd Member Posts: 75

    I got it :) I could have sworn I tried this before posting, but I must have done something wrong. I got it to spawn at a position of several pixels above the paddle and at the paddle's X coordinate (the Paddle's X is constrained to a game level attribute so it always knows where it is).

    Thanks for the help, RThurman!

Sign In or Register to comment.