Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Sentry Cops

Sign in to follow this  


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!

Sign in to follow this  


Recommended Comments

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.

Share this comment

Link to comment

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

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!