2 Replies - 248 Views - Last Post: 03 December 2017 - 03:22 PM Rate Topic: -----

#1 Bar shitrit   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-December 17

I need help with a game I make

Posted 03 December 2017 - 09:33 AM

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
Is This A Good Question/Topic? 0
  • +

Replies To: I need help with a game I make

#2 ndc85430   User is online

  • I think you'll find it's "Dr"
  • member icon

Reputation: 849
  • View blog
  • Posts: 3,407
  • Joined: 13-June 14

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?
Was This Post Helpful? 0
  • +
  • -

#3 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1467
  • View blog
  • Posts: 4,726
  • Joined: 20-March 10

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 Vi 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.

Posted Image

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...

Posted Image

for all x'


Posted Image

for all y'
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1