Skip to content

Commit

Permalink
updated udebs
Browse files Browse the repository at this point in the history
  • Loading branch information
recrm committed May 13, 2012
1 parent bd7d8bd commit 9746c1c
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 77 deletions.
24 changes: 5 additions & 19 deletions chess.py
Expand Up @@ -135,28 +135,14 @@
#draw the tile
pygame.draw.rect(mainSurface, colour, tile)

#draw any unit on the tile.
unit = udebs.getMap((x, y))

if udebs.getStat(unit, udebs.ID) != 'empty':
if 'black' in udebs.getStat(unit, udebs.GROUP):
sprite_colour = (100, 100, 100)
else:
sprite_colour = (0, 250, 0 )
if unit != 'empty':

#selects sprites

if 'black_pawn' in udebs.getStat(unit, udebs.GROUP) or 'white_pawn' in udebs.getStat(unit, udebs.GROUP):
sprite_symbol = "P"
elif 'rook' in udebs.getStat(unit, udebs.GROUP):
sprite_symbol = 'R'
elif 'bishop' in udebs.getStat(unit, udebs.GROUP):
sprite_symbol = 'B'
elif 'knight' in udebs.getStat(unit, udebs.GROUP):
sprite_symbol = 'N'
elif 'queen' in udebs.getStat(unit, udebs.GROUP):
sprite_symbol = 'Q'
elif 'king' in udebs.getStat(unit, udebs.GROUP):
sprite_symbol = 'K'
colour_list = udebs.getStat(unit, 'colour')
sprite_colour = tuple([int(number) for number in colour_list])
sprite_symbol = udebs.getStat(unit, 'sprite')[0]

mainSurface.blit(basicFont.render(sprite_symbol, True, sprite_colour, colour), (x*50+10, y*50+10))
del colour
Expand Down
55 changes: 48 additions & 7 deletions chess.xml
Expand Up @@ -4,6 +4,11 @@
<revert>5</revert>
</config>

<lists>
<item>colour</item>
<item>sprite</item>
</lists>


<entities>

Expand Down Expand Up @@ -146,6 +151,10 @@

<entity>
<ID>captured</ID>
<effect>
<item>TARGET GETS status SELF</item>
</effect>

<require>
<item>SELF not in TARGET status</item>
<item>CASTER CLASS player not in TARGET group</item>
Expand Down Expand Up @@ -402,6 +411,12 @@
<ACT>1</ACT>
<SPD>1</SPD>
</stats>
<colour>
<item>100</item>
<item>100</item>
<item>100</item>
</colour>
<item>sprite</item>
</unit>

<unit tick='tick'>
Expand All @@ -411,6 +426,11 @@
<ACT>2</ACT>
<SPD>1</SPD>
</stats>
<colour>
<item>0</item>
<item>250</item>
<item>0</item>
</colour>
</unit>

<unit>
Expand All @@ -420,7 +440,10 @@
<item>white_pawn_double</item>
<item>white_pawn_capture</item>
<item>white_pawn_passant</item>
</movelist>
</movelist>
<sprite>
<item>P</item>
</sprite>
</unit>

<unit>
Expand All @@ -430,44 +453,62 @@
<item>black_pawn_double</item>
<item>black_pawn_capture</item>
<item>black_pawn_passant</item>
</movelist>
</movelist>
<sprite>
<item>P</item>
</sprite>
</unit>

<unit>
<ID>bishop</ID>
<movelist>
<item>bishop_travel</item>
</movelist>
</movelist>
<sprite>
<item>B</item>
</sprite>
</unit>

<unit>
<ID>rook</ID>
<movelist>
<item>rook_travel</item>
</movelist>
</movelist>
<sprite>
<item>R</item>
</sprite>
</unit>

<unit>
<ID>queen</ID>
<movelist>
<item>bishop_travel</item>
<item>rook_travel</item>
</movelist>
</movelist>
<sprite>
<item>Q</item>
</sprite>
</unit>

<unit>
<ID>king</ID>
<movelist>
<item>king_castle</item>
<item>king_travel</item>
</movelist>
</movelist>
<sprite>
<item>K</item>
</sprite>
</unit>

<unit>
<ID>knight</ID>
<movelist>
<item>knight_travel</item>
</movelist>
</movelist>
<sprite>
<item>N</item>
</sprite>
</unit>

<!-- white units -->
Expand Down

0 comments on commit 9746c1c

Please sign in to comment.