]> git.r.bdr.sh - rbdr/pico-engine/blame - scripts/shot-wave.lua
first commit
[rbdr/pico-engine] / scripts / shot-wave.lua
CommitLineData
10a0e290
BB
1--parameters
2this.actorname = "Bullet: Wave"
3this.enemy = enemy_weapon
4this.speed = 10
5this.controllable = false
6this.physics = false
7this.angle = 0
8this.noclip = true
9
10print(">>> Entity Created - "..this.actorname);
11
12function this.move(this)
13
14 if(this:get_currentdirection() == right) then
15 this:set_ownspeed(this.speed)
16 end
17
18 if (this:get_currentdirection() == left) then
19 this:set_ownspeed(-this.speed)
20 end
21
22 this:set_y(this:get_y()+ (10 * math.sin(math.rad(this.angle))) )
23 this.angle = this.angle + 45
24
25 if ( this:get_x() < this:get_map_sx() or this:get_x() > this:get_map_sx() + this:get_cfg_screen_width()) then
26 this:set_dying(true)
27 end
28end
29
30function this.act(this)
31 this:move()
32end
33
34--END