Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0 animate 0.12 1
- 1 expr self.on_ground 3 2
- 2 state JumpAir
- 3 check Space 7 4
- 4 check MouseLeft 8 5
- 5 expr Monster.checkMovementInput(self) 9 6
- 6 expr self.inputs:check(InputKey.Action1) and entity:onDiggableGround() 11 4294967295
- 7 state JumpStart
- 8 check Down 12 11
- 9 state Move
- 10 state Dig
- 11 state Attack
- 12 state Attack2
- if(self.state == State.Idle) then
- self.frame = self.frame + 0.12 * dt
- if(self.on_ground) then
- if(self.inputs:check(InputKey.Space)) then
- self:setState(entity, State.JumpStart)
- else
- if(self.inputs:check(InputKey.MouseLeft)) then
- if(self.inputs:check(InputKey.Down)) then
- self:setState(entity, State.Attack2)
- else
- self:setState(entity, State.Attack)
- end
- else
- if(Monster.checkMovementInput(self)) then
- self:setState(entity, State.Move)
- else
- if(self.inputs:check(InputKey.Action1) and entity:onDiggableGround()) then
- self:setState(entity, State.Attack)
- end
- end
- end
- end
- else
- self:setState(entity, State.JumpAir)
- end
- end
Add Comment
Please, Sign In to add comment