aboutsummaryrefslogtreecommitdiff
path: root/scripts/shot.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/shot.lua')
-rw-r--r--scripts/shot.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/shot.lua b/scripts/shot.lua
new file mode 100644
index 0000000..3077f08
--- /dev/null
+++ b/scripts/shot.lua
@@ -0,0 +1,33 @@
+--parameters
+this.actorname = "Bullet: Normal"
+this.enemy = enemy_weapon
+this.speed = 6
+this.controllable = false
+this.physics = false
+
+this:load_clip("./sfx/shot.wav");
+this:play_sfx("./sfx/shot.wav");
+
+print(">>> Entity Created - "..this.actorname);
+
+function this.move(this)
+
+ if(this:get_currentdirection() == right) then
+ this:set_ownspeed(this.speed)
+ end
+
+ if (this:get_currentdirection() == left) then
+ this:set_ownspeed(-this.speed)
+ end
+
+ if ( not this:can_move(left, this:get_x(), this:get_y()) or
+ not this:can_move(right, this:get_x(), this:get_y())) then
+ this:set_dying(true)
+ end
+end
+
+function this.act(this)
+ this:move()
+end
+
+--END \ No newline at end of file