diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-06-19 19:28:04 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-06-19 19:28:04 +0000 |
| commit | a370d2f5860a0f89ac44af857d1059885ad1d60f (patch) | |
| tree | 5ad5112a884e41367b271a8ea3509dec04524819 /src/arena.c | |
| parent | fadf9365dba24b680db5cb8750c53e264ff1ec27 (diff) | |
- upravy v kode
- prepis stirel pre space_t *
- v kode su dva vyhladavacie algortmy, implicitne sa pouziva ten ktory funguje :)
ten co nefunguje je zamakrovany makrom SUPPORT_ERROR a este ho musim doladit
git-svn-id: http://opensvn.csie.org/tuxanci_ng@66 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/arena.c')
| -rw-r--r-- | src/arena.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/arena.c b/src/arena.c index 1a8e803..75e94b4 100644 --- a/src/arena.c +++ b/src/arena.c @@ -44,12 +44,9 @@ arena_t* newArena(int w, int h) new->listTimer = newList(); - //new->listTux = newList(); - //new->listItem = newList(); new->spaceTux = newSpace(w, h, 320, 240, getStatusTux, setStatusTux); new->spaceItem = newSpace(w, h, 320, 240, getStatusItem, setStatusItem); - - new->listShot = newList(); + new->spaceShot = newSpace(w, h, 320, 240, getStatusShot, setStatusShot); return new; } @@ -62,12 +59,11 @@ int conflictSpace(int x1,int y1,int w1,int h1,int x2,int y2,int w2,int h2) int isFreeSpace(arena_t *arena, int x, int y, int w, int h) { if( isConflictWithObjectFromSpace(arena->spaceTux, x, y, w, h) )return 0; - if( isConflictWithListShot(arena->listShot, x, y, w, h) )return 0; + if( isConflictWithObjectFromSpace(arena->spaceShot, x, y, w, h) )return 0; if( isConflictWithObjectFromSpace(arena->spaceItem, x, y, w, h) )return 0; + if( isConflictWithObjectFromSpace(arena->spaceShot, x, y, w, h) )return 0; + if( isConflictModule(x, y, w, h) )return 0; - //if( isConflictWithListWall(arena->listWall, x, y, w, h) )return 0; - //if( isConflictWithListTeleport(arena->listTeleport, x, y, w, h) )return 0; - //if( isConflictWithListPipe(arena->listPipe, x, y, w, h) )return 0; return 1; } @@ -162,13 +158,17 @@ void drawArena(arena_t *arena) getObjectFromSpace(arena->spaceItem, screen_x, screen_y, WINDOW_SIZE_X, WINDOW_SIZE_Y, listHelp); drawListItem(listHelp); - //printSpace(arena->spaceItem); + listDoEmpty(listHelp); + getObjectFromSpace(arena->spaceShot, screen_x, screen_y, WINDOW_SIZE_X, WINDOW_SIZE_Y, listHelp); + drawListShot(listHelp); + + //printSpace(arena->spaceShot); //drawListTux(arena->listTux); //drawListWall(arena->listWall); //drawListTeleport(arena->listTeleport); //drawListPipe(arena->listPipe); - drawListShot(arena->listShot); + //drawListShot(arena->listShot); //drawListItem(arena->listItem); drawModule(screen_x, screen_y, WINDOW_SIZE_X, WINDOW_SIZE_Y); @@ -200,7 +200,7 @@ void eventArena(arena_t *arena) for( i = 0 ; i < 8 ; i++) { - eventMoveListShot(arena->listShot); + eventMoveListShot(arena); checkShotIsInTuxScreen(arena); //eventConflictShotWithWall(arena->listWall, arena->listShot); //eventConflictShotWithTeleport(arena->listTeleport, arena->listShot); @@ -221,7 +221,7 @@ void destroyArena(arena_t *p) { destroySpaceWithObject(p->spaceTux, destroyTux); destroySpaceWithObject(p->spaceItem, destroyItem); - destroyListItem(p->listShot, destroyShot); + destroySpaceWithObject(p->spaceShot, destroyShot); destroyTimer(p->listTimer); free(p); } |