Jump to content
  • Advertisement
  • entries
  • comments
  • views

Waves and Collisions



I wanted the game to have waves of enemies, where 4 or 5 of the same type will appear and move in a predictable pattern towards the player.  I placed some enemies in the stage and it was getting a bit tiresome moving them around if I wanted to move a wave to a different part of the stage.  So instead of placing every individual enemy, I created a 'lead' enemy of just 1 type.  All the enemies are flagged as inactive until they are drawn on screen.  As soon as this enemy is made active, it starts moving and animating.   I also added a spawn code to the lead enemy where it created multiples of itself and sets a speed and direction.  That way if I want to re-position an enemy on the stage, I only have to do it once and move the lead enemy.

I also started adding in a bit of collision detection, to test out the gameplay.  Each bullet fired by the enemy has a 'bounced' flag.  If it is bounced off the players shield, this flag is set.  This way, enemies don't blow each other up with their own bullets.  When a collision occurs, first I check to see if the bullet's bounced flag has been set.  If not do nothing, if yes then create an explosion and destroy the enemy.

I also have some ideas for power-ups, one will make the player move slightly faster, another makes the shield stay active for a longer time.  There's a red bar at the bottom of the screen which measures how long the shield will last.  When I get around to doing some sounds I can put in some cues which alert the player when it is low or about to run out.



Recommended Comments

Looks nice so far! Good job! I really like that deflecting thing.

Share this comment

Link to comment
20 hours ago, ongamex92 said:

Looks nice so far! Good job! I really like that deflecting thing.


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!