aboutsummaryrefslogtreecommitdiff
path: root/scripts/npc_jumper.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/npc_jumper.lua')
-rw-r--r--scripts/npc_jumper.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/npc_jumper.lua b/scripts/npc_jumper.lua
new file mode 100644
index 0000000..f58d1ff
--- /dev/null
+++ b/scripts/npc_jumper.lua
@@ -0,0 +1,20 @@
+--Configuration for the Jumper
+this.actorname = "Enemy: Jumper"
+this.enemy = enemy_evil
+this.controllable = false
+this.jumpstrength = 6
+this.physics = true
+
+print(">>> Entity Created - "..this.actorname);
+
+function this.jump(this)
+ if (this:get_vertical_speed() == 0 and math.random(150) == 50) then
+ this:set_vertical_speed(this:get_vertical_speed()-this.jumpstrength)
+ end
+end
+
+function this.act(this)
+ this:jump()
+end
+
+--END \ No newline at end of file