GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Computer controlled opponents???

QuantumGames94QuantumGames94 Posts: 13Member
edited May 2012 in Working with GS (PC)
Hi is it possible to give actors the ability to be controlled as a CPU so for example I have a paddle on one side of the screen and if I hit the ball forward off my paddle and it moves towards another paddle not controlled by anyone can it hit it back and can it move so it can hit the ball as the ball can move around off the walls at different angles???
How do I do this as am on the windows beta and am relatively new to the software

Best Answer

  • jn2002dkjn2002dk Posts: 102Member
    edited May 2012 Accepted Answer
    What you're looking for is AI, artificial intelligence, one of the most complicated aspects of game design

    Basically you'll need to translate the behavior you want to math and functions

    For a pong like game you'd probably set the linear velocity of the bat to either positive or negative depending on the position of the ball. That would keep the cpu controlled bat moving towards the bat. It's exact speed would vary depending on the difficulty level you want where faster bats equals better opponents

Answers

  • UtopianGamesUtopianGames Posts: 5,686Member
    Yes this is something we have done before with an air hockey game. I will try and dig up the code as im away from the mac ATM.

    Darren.
  • QuantumGames94QuantumGames94 Posts: 13Member
    That would be great if you could find it for me Darren
    Cheers Josh
This discussion has been closed.