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.

how do I do it?

if you're willing to help, send me a DM and tell me if you need the code.

thanks in advance

# I need help with a game I make

Page 1 of 1## 2 Replies - 228 Views - Last Post: 03 December 2017 - 03:22 PM

##
**Replies To:** I need help with a game I make

### #2

## Re: I need help with a game I make

Posted 03 December 2017 - 09:38 AM

You need to post the code here and provide more details about what exactly you need help with. What have you tried and where are you stuck?

### #3

## Re: I need help with a game I make

Posted 03 December 2017 - 03:22 PM

Well I believe its question #2 you are having the difficulty with as question #1 is obvious.

It really comes down to a question of Physics not programming as such.

Real world objects have inititial Velocities V

they then have an angle of rotation theta.

The equation you want is angular velocity which is given over time by the equation.

where omega is angular velocity, theta is the angle in radians and t is time.

You will also have to set a MAX_SPEED for the enemies as you dont want them exceeding reasonable speed ie getting too fast and when they change direction they should have to slow down to do so.

Its just a matter of thinking how real world objects move.

For the actual chasing....

It is a pursuer - evader type problem in what is called Game Theory

A general equation can be given for both pursuer and evader as...

for all x'

and

for all y'

It really comes down to a question of Physics not programming as such.

Real world objects have inititial Velocities V

_{i}and they start with that being 0.they then have an angle of rotation theta.

The equation you want is angular velocity which is given over time by the equation.

where omega is angular velocity, theta is the angle in radians and t is time.

You will also have to set a MAX_SPEED for the enemies as you dont want them exceeding reasonable speed ie getting too fast and when they change direction they should have to slow down to do so.

Its just a matter of thinking how real world objects move.

For the actual chasing....

It is a pursuer - evader type problem in what is called Game Theory

A general equation can be given for both pursuer and evader as...

for all x'

and

for all y'

Page 1 of 1