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


Sign in to follow this  



I'm so happy with the way things are going. I managed to iron out some bugs aswell as implement simple enemy AI(including shooting). However the AI is not the fancy stuff I made last time. It's all if(enemy > player) enemy.x++ EX.
No AITarget->y here [grin].
This means that I won't be able to do fancy formations and so on, which ultimately means that it won't be like a good Space Invaders clone. I'am sorry but I still remember that 3 day rewrite it took me to refactor the classes so that AITarget was the base class instead of CObject. But, I promise that the next project of mine will include fancy AI [smile](I might even end up rewriting this project's AI, I really don't know what I'll do, depends hugely on your input...).
Anyway there is still one bug which is irritating, but which I know the nature of(I think). I have set up the AI so that it shoots only when it is at the exact same Y-coordinate as the Player. So that means that if the player is at 333 or some other annoying coordinate which is not dividable by 4(I haven't checked if 333 is, however) then the enemy can't reach it, and it will be "lagging" back and forth between 334 and 332.

So yeah, a heck of a weekend, and I was sick today aswell. Will go back to school tomorrow though.

Here are some screens of the enemy shooting at me:

This was without a bugfix(Enemy firing constantly)

And this was with(Enemy fires only one shot)

I'm gonna go and find a solution to that coordinate problem, if you guys(and gals, if any) have any idea, then It is much appreciated [smile].

Sign in to follow this  


Recommended Comments

if enemy.state != cooldown
if (enemy.y > (player.y - 2)) && (enemy.y < (player.y +2))

would this work?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!