1 --Configuration for the Jumper
2 this.actorname = "Enemy: Walker"
15 print(">>> Entity Created - "..this.actorname);
17 function this.walk(this)
18 if(this:get_currentdirection() == left) then
19 if ( this:can_move(left, this:get_x(), this:get_y()) and
20 not this:can_move(down, this:get_x()+this:get_ownspeed(), this:get_y())) then
21 if this:get_collision(left) then
22 this:set_currentdirection(right)
24 this:set_ownspeed(-this.speed)
28 this:set_currentdirection(right)
29 this:set_ownspeed(this.speed)
33 if(this:get_currentdirection() == right) then
34 if ( this:can_move(right, this:get_x(), this:get_y()) and
35 not this:can_move(down, this:get_x()+this:get_ownspeed(), this:get_y())) then
36 if this:get_collision(right) then
37 this:set_currentdirection(left)
39 this:set_ownspeed(this.speed)
43 this:set_currentdirection(left)
44 this:set_ownspeed(-this.speed)
49 function this.act(this)