Skip to content

Commit

Permalink
Added kill
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Apr 30, 2020
1 parent 2f8c367 commit 57d7cad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
22 changes: 22 additions & 0 deletions src/Commands/Player/KillDroids.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#define KillAllDroidsCommand
CommandCreate("killAllDroids", 0, ScriptWrap(KillAllDroids));

#define KillAllDroids()
/// @desc Kills all droids

if (!InGame()) return Trace(global.notInGameMessage)

// Droid variables
var totalDroids = ItemCount(Item.Droid)
var activeDroids = instance_number(objDroid)

// Debug droid data
Trace("Total Droid count: " + string(totalDroids));
Trace("Active Droid count: " + string(activeDroids));

// Drones respawn on reload
instance_destroy(objDroid)

// Message
Trace("Killed " + string(activeDroids) + " Droids");

10 changes: 6 additions & 4 deletions src/Main.gml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#define Main

// Global
globalMessages()
globalMessages();

// Player
GiveItemCommand()
GiveItemCommand();

SetXPCommand()
SetXPCommand();

SetLevelCommand()
SetLevelCommand();

KillAllDroidsCommand();

0 comments on commit 57d7cad

Please sign in to comment.