]>
Commit | Line | Data |
---|---|---|
10a0e290 BB |
1 | --the directions |
2 | up=0 | |
3 | right=1 | |
4 | down=2 | |
5 | left = 3 | |
6 | ||
7 | --parameters | |
8 | this.actorname = "Bullet: Normal" | |
9 | this.enemy = 0 | |
10 | this.speed = 6 | |
11 | this.controllable = 0 | |
12 | ||
13 | print(">>> Entity Created - "..this.actorname); | |
14 | ||
15 | function this.move(this) | |
16 | ||
17 | if(this:get_currentdirection() == right) then | |
18 | this:set_ownspeed(this.speed) | |
19 | end | |
20 | ||
21 | if (this:get_currentdirection() == left) then | |
22 | this:set_ownspeed(-this.speed) | |
23 | end | |
24 | ||
25 | if ( not this:can_move(left, this:get_x(), this:get_y()) or | |
26 | not this:can_move(right, this:get_x(), this:get_y())) then | |
27 | this:set_dying(true) | |
28 | end | |
29 | end | |
30 | ||
31 | function this.act(this) | |
32 | this:move() | |
33 | end | |
34 | ||
35 | --END |