Finally got the shooting in on bad guys such as Sentry Cops - these basically fly around and if they see you they open fire, at the moment they have an infinite amount of bullets but this could change...
Added some simple math so the cops target player, something like:
angleToPlayer = Math.atan2(Math.abs(y-ty), Math.abs(x-tx));xVel = (float) ((speed) * Math.cos(angleToPlayer));yVel = (float) ((speed) * Math.sin(angleToPlayer));
Of course, more work is needed dependent on which bad guy is shooting, some will fire quicker, others slower, different types of bullets too.
I'm also thinking of allowing some of the flying shooting bad guys shoot other creatures on the ground just for the fun of it...
I've also added an age attribute to the creatures, the older they are, the slower they will move, their jump height will become less, their eye sight will also become worse (eye sight is used in my line of sight). I really want the world in the game to just evolve, making it more and more realistic is what I'm attempting.
I'm hoping to do an early access release via steam Feb 2017, hoping to get some support from here ;-)
Screen shot showing sentry cops firing a simple red bullet in the direction of the player, again, they only do this if they can see the player, so better hide!
Til the next blog, keep developing!