Timer#
ActionTimer#
- class miniworldmaker.tools.timer.ActionTimer(time, method, arguments=None)[source]#
Calls a method after time frames.
Example
Player moves after 48 frames:
miniworldmaker.ActionTimer(48, player.move, 2)
Same as above with decorator:
@miniworldmaker.timer(frames = 24) def moving(): player.move()
Public Methods:
__init__
(time, method[, arguments])- param time:
After time frames, the method is called
act
()Act method for timer.
Inherited from
Timed
__init__
()tick
()unregister
()remove timer from board
Private Methods:
_call_method
()
LoopActionTimer#
- class miniworldmaker.tools.timer.LoopActionTimer(time, method, arguments=None)[source]#
Calls a method after time frames repeatedly until the timer is unregistered.
Example
Player moves after 48 frames:
miniworldmaker.LoopTimer(48, player.move, 2)
Same as above with decorator:
@miniworldmaker.loop(frames = 24) def moving(): player.move()
Public Methods:
act
()Act method for timer.
Inherited from
ActionTimer
__init__
(time, method[, arguments])- param time:
After time frames, the method is called
act
()Act method for timer.
Inherited from
Timed
__init__
()tick
()unregister
()remove timer from board
Private Methods:
Inherited from
ActionTimer
_call_method
()