edogdu / RAM_Cyber_Defenders

Cybersecurity Learning Game in AR/VR Environment
2 stars 1 forks source link

Game Engine in C++ Playing with the Computer #21

Closed edogdu closed 4 months ago

Luk-Er4 commented 4 months ago

On the previous code, I could only play as player vs player game. Since I got the request to make it enable to play as a player vs computer, I had to update the logic.

Here is the comparison of the blueCard function for example. The previous version is the upper one.

image

image

There is no big difference between the two of them. What I could do for the update was to create a vector to store which position options are available for the AI. Then, I created a new function called "AiMakingChoice" function.

AiMakingChoice function

image

I could pass the vector I mentioned earlier to this function, and then randomly choose among the available choices. The function will return one of those choices, and this is how computer can play the game.

LightTheBlues commented 4 months ago

will not fix