Need help with my game

I need help with my game, it's a console arcade game and it's the first game I ever coded.
I only have 2 things left:
1.make enemy spawn every 10 seconds with a maximum of 5 enemies(already coded time counting)
2.make enemies chase the player.
if you're willing to help, send me a DM and tell me if you need the code.

thanks in advance
1.make enemy spawn every 10 seconds with a maximum of 5 enemies(already coded time counting)


Every 10 seconds, spawn an enemy if current number of enemies is less than maximum enemies. So something like this:

// Check if current number of enemies is less than the maximum number of allowed enemies
1
2
3
4
if (numberOfEnemies < MAX_ENEMIES) 
{
   // Allocate new enemy object
}


2.make enemies chase the player.

Steering behaviors helps autonomous characters move in a realistic manner, by using simple forces such as velocity and movement. I recommend you have a look at this article:
https://gamedevelopment.tutsplus.com/tutorials/understanding-steering-behaviors-seek--gamedev-849

Hope this was of some help to you.
2) can be really simple or really hard. You can literally just copy the movements of the player, N steps behind, for a super simple approach. A lot of high end games, the enemy takes a straight line path and in many of them, it cheats (can cross things the player cannot). If you know where the player is going, you can use a crude AI to take a shortcut. You can also do the old "I am here, he is there, I want to be where he is, find that path" approach. If the game involves ranged weaponry, you can also perform a crude AI or pathing algorithm that instead says "get me to a place with line of sight to shoot at target" rather than "get me to the same place". There are others as well, these are just some ideas and commonly used approaches.
Topic archived. No new replies allowed.