Pong example

swiftskater1swiftskater1 Member Posts: 97
edited November -1 in Working with GS (Mac)
I need help creating an enemy paddle. to follow the ball up and down. thanks

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    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.