• entries
11
24
• views
10838

# Sentry Cops

944 views

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!

You'll need a graphical effect to go with the age attribute.  Maybe the older something is, the more tinted gray it is.  Otherwise it's just going to be confusing as to why certain creatures of the same type aren't as effective as others.

I like the idea of your AI shooting creatures on the ground for the fun of it, gives them personality, and it will make them seem alive when the player can see them, but the AI doesn't see the player.

Thanks for the comments and a great suggestion, thanks for this :-) May give them walking stick or something lol.

## Create an account

Register a new account