summaryrefslogtreecommitdiff
path: root/src/screen_world.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-21 14:03:35 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-21 14:03:35 +0000
commit114131bf71d7d4ec48c92a7bde8183442995940f (patch)
tree84a3e5ba788d3a6bf76f5067b861fbce8b2f239b /src/screen_world.c
parent1e1d106a545a9cadc517de1a0ad931f1a8fcc2fa (diff)
- vypisovanie sprav do hry
- oprava chyby odhlaelenj pomocou valgrindu - zena rychlosti zbrani - drobne upravy git-svn-id: http://opensvn.csie.org/tuxanci_ng@31 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen_world.c')
-rw-r--r--src/screen_world.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/screen_world.c b/src/screen_world.c
index d4540b1..49d94ac 100644
--- a/src/screen_world.c
+++ b/src/screen_world.c
@@ -31,6 +31,7 @@
#include "arena.h"
#include "arenaFile.h"
#include "proto.h"
+#include "term.h"
static arena_t *arena;
static int count;
@@ -49,17 +50,7 @@ void setGameType()
int ret = 0;
ret = initNetMuliplayer( getSettingGameType(), getSettingIP(), getSettingPort() );
-/*
- if( getSettingGameType() == NET_GAME_TYPE_SERVER )
- {
- ret = initServer( getSettingPort() );
- }
- if( getSettingGameType() == NET_GAME_TYPE_CLIENT )
- {
- ret = initClient( getSettingPort() , getSettingIP() );
- }
-*/
if( ret != 0 )
{
fprintf(stderr, "Chyba inicalizacie sieti !\n");
@@ -99,7 +90,8 @@ static void timer_endArena()
void countRoundInc()
{
- if( count >= max_count )
+ if( count == WORLD_COUNT_ROUND_UNLIMITED ||
+ count >= max_count )
{
return;
}
@@ -201,6 +193,7 @@ void drawWorld()
}
drawPanel(arena->listTux);
+ drawTerm();
}
int conflictSpace(int x1,int y1,int w1,int h1,int x2,int y2,int w2,int h2)
@@ -371,6 +364,8 @@ void tuxControl(tux_t *p)
void eventWorld()
{
+ int i;
+
if( arena == NULL )
{
eventNetMultiplayer();
@@ -379,21 +374,26 @@ void eventWorld()
return;
}
+ eventNetMultiplayer();
+
eventConflictTuxWithTeleport(arena->listTux, arena->listTeleport);
eventConflictTuxWithShot(arena->listTux, arena->listShot);
- eventConflictShotWithWall(arena->listWall, arena->listShot);
- eventConflictShotWithTeleport(arena->listTeleport, arena->listShot);
- eventConflictShotWithPipe(arena->listPipe, arena->listShot);
- eventConflictShotWithItem(arena->listItem, arena->listShot);
+ for( i = 0 ; i < 4 ; i++)
+ {
+ eventMoveListShot(arena->listShot);
+ eventConflictShotWithWall(arena->listWall, arena->listShot);
+ eventConflictShotWithTeleport(arena->listTeleport, arena->listShot);
+ eventConflictShotWithPipe(arena->listPipe, arena->listShot);
+ eventConflictShotWithItem(arena->listItem, arena->listShot);
+ }
- eventMoveListShot(arena->listShot);
eventListItem(arena->listItem);
-
- eventNetMultiplayer();
+
eventListTux(arena->listTux);
eventTimer();
+ eventTerm();
eventEnd();
eventEsc();
}
@@ -406,6 +406,7 @@ void startWorld()
count = 0;
setGameType();
+ initTerm();
prepareArena();
initTimer();
}
@@ -469,6 +470,7 @@ void stoptWorld()
delAllImageInGroup(IMAGE_GROUP_USER);
delAllMusicInGroup(MUSIC_GROUP_USER);
quitTimer();
+ quitTerm();
}
void initWorld()