]> git.r.bdr.sh - rbdr/pico-engine/blob - scripts/shot.lua
Update project so it compiles
[rbdr/pico-engine] / scripts / shot.lua
1 --parameters
2 this.actorname = "Bullet: Normal"
3 this.enemy = enemy_weapon
4 this.speed = 6
5 this.controllable = false
6 this.physics = false
7
8 this:load_clip("./sfx/shot.wav");
9 this:play_sfx("./sfx/shot.wav");
10
11 print(">>> Entity Created - "..this.actorname);
12
13 function 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
27 end
28
29 function this.act(this)
30 this:move()
31 end
32
33 --END