diff ai/human.d @ 26:88cca12cc8b9

added ship explode
author zzzzrrr <mason.green@gmail.com>
date Fri, 27 Mar 2009 19:26:01 -0400
parents 7f74e064dad5
children d63faa81a5e4
line wrap: on
line diff
--- a/ai/human.d	Fri Mar 27 16:25:17 2009 -0400
+++ b/ai/human.d	Fri Mar 27 19:26:01 2009 -0400
@@ -34,13 +34,15 @@
 import xf.input.KeySym;
 
 import openmelee.ships.ship;
+import openmelee.melee.melee : Melee;
 
 class Human
 {
-
+    Melee melee;
     Ship ship;
     
-	this(Ship ship) {
+	this(Ship ship, Melee melee) {
+        this.melee = melee;
         this.ship = ship;
 	}
 
@@ -69,6 +71,13 @@
                 break;
             case KeySym.Down:             
                 break;
+            case KeySym.Delete:
+                melee.ship2.explode();
+                melee.objectList.remove(melee.ship2);
+                melee.world.destroyBody(melee.ship2.rBody);
+                melee.ship2 = null;
+                melee.draw.ship2 = null;
+                melee.ai.ship = null;
 			default:
 				break;
 			}