X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fconstants.py;h=25a8cfcb45c9348773f3c35fac1bc67514d2ed01;hb=18eaa15b16160df3dcd23dd2773603d1f2e179ce;hp=faa8c55b14cac16ed99e0459f773c8f7e4039230;hpb=39f49f9579bdee2ad449246d1370a0be27186ed9;p=naja.git diff --git a/naja/constants.py b/naja/constants.py index faa8c55..25a8cfc 100644 --- a/naja/constants.py +++ b/naja/constants.py @@ -1,3 +1,6 @@ +from naja.attrdict import AttrDict + + SCREEN = (800, 600) FPS = 40 FONT = 'DejaVuSans.ttf' @@ -16,3 +19,19 @@ CHANNELS = 2 # 1 == mono, 2 == stereo BUFFER = 1024 # audio buffer size in no. of samples DEFAULT_SOUND_VOLUME = 1.0 # sound volume DEFAULT_MUSIC_VOLUME = 0.3 # music volume + +# Player bits +BITS = AttrDict({ + # Direction bits + 'NORTH': 0, + 'SOUTH': 1, + 'EAST': 2, + 'WEST': 3, + # Condition bits + 'CYAN': 4, + 'MAGENTA': 5, + 'YELLOW': 6, + 'MSB': 7, +}) +DIRECTION_BITS = AttrDict((k, v) for k, v in BITS.items() if v < 4) +CONDITION_BITS = AttrDict((k, v) for k, v in BITS.items() if v >= 4)