]> git.r.bdr.sh - rbdr/pico-engine/blame - scripts/shot.lua
first commit
[rbdr/pico-engine] / scripts / shot.lua
CommitLineData
10a0e290
BB
1--parameters
2this.actorname = "Bullet: Normal"
3this.enemy = enemy_weapon
4this.speed = 6
5this.controllable = false
6this.physics = false
7
8this:load_clip("./sfx/shot.wav");
9this:play_sfx("./sfx/shot.wav");
10
11print(">>> Entity Created - "..this.actorname);
12
13function this.move(this)
14
15 if(this:get_currentdirection() == right) then
16 this:set_ownspeed(this.speed)
17 end
18
19 if (this:get_currentdirection() == left) then
20 this:set_ownspeed(-this.speed)
21 end
22
23 if ( not this:can_move(left, this:get_x(), this:get_y()) or
24 not this:can_move(right, this:get_x(), this:get_y())) then
25 this:set_dying(true)
26 end
27end
28
29function this.act(this)
30 this:move()
31end
32
33--END