From 10a0e290ac07524dc129cc2b227b0f9e95df0f8e Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Mon, 16 Apr 2012 09:39:52 -0500 Subject: first commit --- scripts/shot-wave.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 scripts/shot-wave.lua (limited to 'scripts/shot-wave.lua') diff --git a/scripts/shot-wave.lua b/scripts/shot-wave.lua new file mode 100644 index 0000000..758085b --- /dev/null +++ b/scripts/shot-wave.lua @@ -0,0 +1,34 @@ +--parameters +this.actorname = "Bullet: Wave" +this.enemy = enemy_weapon +this.speed = 10 +this.controllable = false +this.physics = false +this.angle = 0 +this.noclip = true + +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 + + this:set_y(this:get_y()+ (10 * math.sin(math.rad(this.angle))) ) + this.angle = this.angle + 45 + + if ( this:get_x() < this:get_map_sx() or this:get_x() > this:get_map_sx() + this:get_cfg_screen_width()) then + this:set_dying(true) + end +end + +function this.act(this) + this:move() +end + +--END \ No newline at end of file -- cgit