Menu
  • HOME
  • TAGS

Problems making enemy follow moving player

javascript,canvas,game-ai

Ok, so it was actually Premier Bromanov who answered this, thanks, but I can't accept a comment, which it was, so I will just do this to make it more clear, if anyone should come by and want the answer too. The math i did was a bit wrong, and...

Create a simple 2D AI C++

c++,random,visual-studio-2013,directx,game-ai

Here are a few things that should help you: 1) In RandomMove, your last else doesn't have braces, since you're performing two operations, you should wrap both of them in braces like you did elsewhere 2) float comparison is tricky. It's very unlikely that your PosX == MapX || PosY...

C++ AI Rotation Issue

c++,rotation,game-ai

There are a couple of problems with your updated code. Firstly, it should be rot2 = 360 - rot1; (rot1 + 360 is exactly the same angle as rot1). The second issue is that you are not taking into account that 1 and 359 degrees are almost the same angle....