A
A
AlexRayn2020-05-15 20:52:37
C++ / C#
AlexRayn, 2020-05-15 20:52:37

winforms. How to add a bot to the game?

I'm making a ping-pong game. How can I add a bot enemy? Can you leave something on this topic?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-05-16
@AlexRayn

Make a game class there will be general parameters. Ball class, player class. The player will have 4 up down drop stop methods, then the game class will broadcast the position of the ball and the motion vector to the players through events, the bot will listen to all this and call up down stop. The bells and whistles like acceleration and deceleration need to be implemented, you can also add the size of the racket, acceleration with a long press, rebounds from the wall and obstacles falling from above

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question