diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-05 15:56:13 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-05 15:56:13 +0000 |
| commit | 6ed79c5de77b3f6be5c297cb5432d123ff1ff177 (patch) | |
| tree | a21336754348eb80263aa72768a474c500c8a607 /src/screen/screen_world.c | |
| parent | 17b80069913989598a27fc31b952407f895f5b51 (diff) | |
- miny sa nezobrazuju na radare
- tux moze chodit strielat a zmenit zbran sucastne
- master server sa pouziga ten na "ms.tuxanci.org"
- AI sa nastavuje v GUI ako v TFG
git-svn-id: http://opensvn.csie.org/tuxanci_ng@93 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/screen/screen_world.c')
| -rw-r--r-- | src/screen/screen_world.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/screen/screen_world.c b/src/screen/screen_world.c index 380fd43..91820ff 100644 --- a/src/screen/screen_world.c +++ b/src/screen/screen_world.c @@ -148,10 +148,12 @@ void prepareArena() getSettingNameLeft(tux->name); addObjectToSpace(arena->spaceTux, tux); - if( strcmp(getSettingAI(), "none") != 0 ) + if( isSettingAI() ) { - loadModule( getSettingAI() ); - tux->control = TUX_CONTROL_AI; + if( loadModule("modAI.so") == 0 ) + { + tux->control = TUX_CONTROL_AI; + } } break; @@ -237,6 +239,16 @@ static void control_keyboard_right(tux_t *tux) if( mapa[(SDLKey)getKey(KEY_TUX_RIGHT_MOVE_LEFT)] == SDL_PRESSED )countKey++; if( mapa[(SDLKey)getKey(KEY_TUX_RIGHT_MOVE_DOWN)] == SDL_PRESSED )countKey++; + if( mapa[(SDLKey)getKey(KEY_TUX_RIGHT_SWITCH_WEAPON)] == SDL_PRESSED ) + { + if( tux->isCanSwitchGun == TRUE ) + { + netAction(tux, TUX_SWITCH_GUN); + actionTux(tux, TUX_SWITCH_GUN); + return; + } + } + if( mapa[(SDLKey)getKey(KEY_TUX_RIGHT_SHOOT)] == SDL_PRESSED && tux->isCanShot == TRUE ) { netAction(tux, TUX_SHOT); @@ -292,16 +304,6 @@ static void control_keyboard_right(tux_t *tux) tuDown:; } - - if( mapa[(SDLKey)getKey(KEY_TUX_RIGHT_SWITCH_WEAPON)] == SDL_PRESSED ) - { - if( tux->isCanSwitchGun == TRUE ) - { - netAction(tux, TUX_SWITCH_GUN); - actionTux(tux, TUX_SWITCH_GUN); - return; - } - } } static void control_keyboard_left(tux_t *tux) @@ -321,6 +323,15 @@ static void control_keyboard_left(tux_t *tux) if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_MOVE_LEFT)] == SDL_PRESSED )countKey++; if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_MOVE_DOWN)] == SDL_PRESSED )countKey++; + if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_SWITCH_WEAPON)] == SDL_PRESSED ) + { + if( tux->isCanSwitchGun == TRUE ) + { + actionTux(tux, TUX_SWITCH_GUN); + return; + } + } + if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_SHOOT)] == SDL_PRESSED && tux->isCanShot == TRUE ) { actionTux(tux, TUX_SHOT); @@ -372,14 +383,6 @@ static void control_keyboard_left(tux_t *tux) tuDown:; } - if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_SWITCH_WEAPON)] == SDL_PRESSED ) - { - if( tux->isCanSwitchGun == TRUE ) - { - actionTux(tux, TUX_SWITCH_GUN); - return; - } - } /* if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_MOVE_UP)] == SDL_PRESSED )actionTux(tux, TUX_UP); if( mapa[(SDLKey)getKey(KEY_TUX_LEFT_MOVE_RIGHT)] == SDL_PRESSED )actionTux(tux, TUX_RIGHT); |