Mercurial > boomslang
diff gamelib/ss_state.py @ 655:c77d6aa29bee pyntnclick
Some code to kinda demonstrate the ever so cunning state handling plan
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sun, 12 Feb 2012 13:56:59 +0200 |
parents | |
children | 5dc866e1d71d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gamelib/ss_state.py Sun Feb 12 13:56:59 2012 +0200 @@ -0,0 +1,16 @@ +"""The Custom state object for Suspended Sentence""" + +from pyntnclick.state import GameState + +class SSState(GameState): + + def get_jim_state(self): + """Check JIM's health""" + return self['bridge']['ai status'] + + def loop_ai(self): + """Make JIM loopy""" + self['bridge']['ai status'] = 'looping' + + def break_ai(self): + self['bridge']['ai status'] = 'dead'