diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game.c | 8 | ||||
-rw-r--r-- | src/globals.c | 3 | ||||
-rw-r--r-- | src/globals.h | 3 | ||||
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/map.c | 2 |
5 files changed, 16 insertions, 6 deletions
@@ -43,11 +43,17 @@ static void step(int d) { SDL_Rect box = { ttplayer.x, ttplayer.y, 32, 32 }; int out = tt_room_out(ttplayer.room, &box); - if (out) ttplayer.room = ttplayer.room->neighbours[out - 1]; if (out == 1) ttplayer.y = TT_ROOM_H * 32 - 32; else if (out == 2) ttplayer.x = 0; else if (out == 3) ttplayer.y = 0; else if (out == 4) ttplayer.x = TT_ROOM_W * 32 - 32; + if (out) { + ttplayer.room = ttplayer.room->neighbours[out - 1]; + if (ttplayer.room == ttmap + 'L') { + ttplayer.y -= 32; + Mix_PlayMusic(lenin, -1); + } + } } { SDL_Rect box = { ttplayer.x, ttplayer.y, 32, 32 }; diff --git a/src/globals.c b/src/globals.c index 54c0adf..19875b2 100644 --- a/src/globals.c +++ b/src/globals.c @@ -7,9 +7,10 @@ SDL_Texture *tttxr; SDL_Renderer *ttrdr; -Mix_Music *ponpon; +Mix_Music *grib; Mix_Music *ussr; Mix_Music *stalin; +Mix_Music *lenin; tt_room ttmap[256]; diff --git a/src/globals.h b/src/globals.h index b44cddc..5cb13fc 100644 --- a/src/globals.h +++ b/src/globals.h @@ -15,9 +15,10 @@ extern SDL_Texture *tttxr; extern SDL_Renderer *ttrdr; -extern Mix_Music *ponpon; +extern Mix_Music *grib; extern Mix_Music *ussr; extern Mix_Music *stalin; +extern Mix_Music *lenin; extern tt_room ttmap[256]; @@ -30,9 +30,10 @@ int main(int argc, char **argv) ttrdr = SDL_CreateRenderer(wdw, -1, SDL_RENDERER_ACCELERATED); tttxr = loadtxr("data/txr.bmp"); ttfont = TTF_OpenFont("data/font.otf", 24); - ponpon = Mix_LoadMUS("data/ponpon.ogg"); + grib = Mix_LoadMUS("data/grib.ogg"); ussr = Mix_LoadMUS("data/ussr.ogg"); stalin = Mix_LoadMUS("data/stalin.ogg"); + lenin = Mix_LoadMUS("data/lenin.ogg"); tt_map_load(); srand(time(0)); @@ -46,9 +47,10 @@ int main(int argc, char **argv) SDL_DestroyRenderer(ttrdr); SDL_DestroyWindow(wdw); Mix_HaltMusic(); + Mix_FreeMusic(lenin); Mix_FreeMusic(stalin); Mix_FreeMusic(ussr); - Mix_FreeMusic(ponpon); + Mix_FreeMusic(grib); Mix_CloseAudio(); TTF_Quit(); SDL_Quit(); @@ -44,7 +44,7 @@ static void togulag(tt_body *b) static void gribtake(tt_body *b) { - Mix_PlayMusic(ponpon, -1); + Mix_PlayMusic(grib, -1); b->collision_act = do_nothing; b->anim = 1; b->txrrow = 0; |