Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added surrounding kill area.

Enemies that go super our of bounds are killed. This allows us to make
paths where the enemies do a drive by :D
  • Loading branch information...
commit 4f900959864bbe801d31b4288816bf846465b3d9 1 parent 7d8ad64
@SubSage authored
View
4 GDCalaga/src/org/gdc/gdcalaga/Enemy.java
@@ -122,6 +122,10 @@ public void update(float delta)
RectShape rect = (RectShape)shape;
rect.pos.set(this.pos);
+
+ if(pos.x < -800 || pos.x > 3000 || pos.y < -800 || pos.y >3000){
+ Destroy();
+ }
}
View
4 GDCalaga/src/org/gdc/gdcalaga/Wave.java
@@ -58,12 +58,12 @@ public void update(float delta)
public void draw(Graphics g)
{
-
+ //A wave can not be drawn for it is unimaginable!
}
public void Collide(Entity other)
{
-
+ //other.Destroy(); No body wins in a collision with a wave!
}
private void spawnEnemy(){
Please sign in to comment.
Something went wrong with that request. Please try again.