Again, this works great. Thanks!
Casey Duncan wrote:
Actually if you use tile coordinates you shouldn't need to detect this
ahead of time. Typically an "attack" is the same command as a move
except that the destination square is occupied. So, you can just make
it so that when the monster attem
Actually if you use tile coordinates you shouldn't need to detect
this ahead of time. Typically an "attack" is the same command as a
move except that the destination square is occupied. So, you can just
make it so that when the monster attempts to move into the ninja's
square, it attacks th
Thanks, this works great!
They do have a little trouble with obstacles, but I think I can fix
that. What I want to do now is detect when the Ninja is within a block
size of the monster, so it can stop and attack... Any ideas?
Thanks!
Casey Duncan wrote:
I think it would be easier to understand
I think it would be easier to understand this if instead of assigning
the direction as an arbitrary number, you instead had separate x and
y directions, which could each have only the values -1, 0, or 1.
A naive directional algorithm (which assumes no obstacles between the
monster and the n
I'm working on a sort of RPG/Roguelike game, and right now I'm have
problems with the monster's AI. It works just fine if the Ninja (The
player) is above, below, or to the left of the monster, but if it's tot
he right, the monster just goes up or down, but not right. Here's the
directional code