toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Pong example
swiftskater1
Member
Posts:
97
January 2010
edited November -1
in
Working with GS (Mac)
I need help creating an enemy paddle. to follow the ball up and down. thanks
Comments
scitunes
Member, Sous Chef
Posts:
4,047
January 2010
Create a game integer attribute (call it ball)
In the ball constrain game.ball to self.position.X if you are holding it horizontal or self.position.Y if verticle.
In the enemy paddle constrain self.position.X (or y depending on orientation) to game.ball
I think this should theoretically make the enemy unbeatable. So you may need to try acclerate towards and use the game.ball or move to. Not sure
Sign In
or
Register
to comment.
Comments
In the ball constrain game.ball to self.position.X if you are holding it horizontal or self.position.Y if verticle.
In the enemy paddle constrain self.position.X (or y depending on orientation) to game.ball
I think this should theoretically make the enemy unbeatable. So you may need to try acclerate towards and use the game.ball or move to. Not sure