1 --Configuration for the Jumper
2 this.actorname = "Enemy: Walker"
3 this.enemy = enemy_evil
4 this.controllable = false
8 print(">>> Entity Created - "..this.actorname);
10 function this.walk(this)
11 if(this:get_currentdirection() == left) then
12 if ( this:can_move(left, this:get_x(), this:get_y()) and
13 not this:can_move(down, this:get_x()+this:get_ownspeed(), this:get_y())) then
14 if this:get_collision(left) then
15 this:set_currentdirection(right)
17 this:set_ownspeed(-this.speed)
21 this:set_currentdirection(right)
22 this:set_ownspeed(this.speed)
26 if(this:get_currentdirection() == right) then
27 if ( this:can_move(right, this:get_x(), this:get_y()) and
28 not this:can_move(down, this:get_x()+this:get_ownspeed(), this:get_y())) then
29 if this:get_collision(right) then
30 this:set_currentdirection(left)
32 this:set_ownspeed(this.speed)
36 this:set_currentdirection(left)
37 this:set_ownspeed(-this.speed)
42 function this.act(this)