From 54fadda10d465dbd31917d4d572953339cd88661 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Sat, 14 Aug 2010 13:58:36 +0000 Subject: [PATCH] snake: version 0.5 git-svn-id: svn://kolibrios.org@1566 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/games/snake/trunk/first_menu.asm | 240 +++++- programs/games/snake/trunk/game_over.asm | 98 ++- programs/games/snake/trunk/level.asm | 295 +++++-- programs/games/snake/trunk/pause.asm | 7 +- programs/games/snake/trunk/snake.asm | 969 ++++++++++++++++++---- programs/games/snake/trunk/snake.ini | 78 +- 6 files changed, 1355 insertions(+), 332 deletions(-) diff --git a/programs/games/snake/trunk/first_menu.asm b/programs/games/snake/trunk/first_menu.asm index d27540136c..611ba05775 100644 --- a/programs/games/snake/trunk/first_menu.asm +++ b/programs/games/snake/trunk/first_menu.asm @@ -1,12 +1,12 @@ ;;===First_menu_mode=========================================================================================================== First_menu: + mcall 40,111b ; set events: standart + mov [is_new_record], 0 + call Show_cursor - mov [snake_length_x2], 6 - mov word[snake_dots], 0x0303 - mov dword[snake_dots+2], 0x03050304 - mov [snake_napravlenie], 3 - mov [snake_napravlenie_next], 3 + mov [score], 0 + call Set_first_level_of_play_mode .redraw: mcall 12,1 @@ -18,9 +18,10 @@ First_menu: add ecx, dword[window_height] mcall 0, , ,[window_style], ,window_title - call Draw_decorations - call Draw_first_menu_picture - call Draw_menu_strings + call Draw_decorations + call Draw_first_menu_picture + call Draw_menu_strings + call Draw_buttons mcall 12,2 @@ -38,7 +39,28 @@ First_menu: shr eax, 8 ; we should do it to get the real button code cmp eax, 1 ; is it close button? - je Exit ; if so, jump to quit... + je Save_do_smth_else_and_exit ; if so, jump to quit... + cmp eax, 0xD0 ; 'play' button? + je Level_begin + cmp eax, 0xD1 ; 'exit' button? + je Save_do_smth_else_and_exit + cmp eax, 0xD2 ; change play mode button? + jne @f + call Change_play_mode + call Delete_buttons + call Draw_buttons + jmp .still ; jump to wait for another event + @@: + cmp eax, 0xD3 ; '+INC+' button? + jne @f + call Increase_geometry + jmp .redraw ; jump to wait for another event + @@: + cmp eax, 0xD4 ; '-dec-' button? + jne @f + call Decrease_geometry + jmp .redraw ; jump to wait for another event + @@: jmp .still ; jump to wait for another event @@ -47,12 +69,16 @@ First_menu: mcall 2 ; get keycode cmp ah, 0x1B ; Escape - je Exit + je Save_do_smth_else_and_exit cmp ah, 0x0D ; Enter je Level_begin cmp ah, 0x20 ; Space - je Level_begin - + jne @f + call Change_play_mode + call Delete_buttons + call Draw_buttons + jmp .still ; jump to wait for another event + @@: jmp .still ; jump to wait for another event ;;---First_menu_mode----------------------------------------------------------------------------------------------------------- @@ -63,14 +89,14 @@ First_menu: Draw_first_menu_picture: ;;===Draw_first_menu_picture================================================================================================ - mov ax, 0*0x100+29 - mov cx, 1*0x100+6 + mov ax, 2*0x100+24 + mov cx, 1*0x100+5 mov edx, [snake_picture_color] mov esi, picture_first_menu_snake call Draw_picture - mov ax, 9*0x100+11 - mov cx, 9*0x100+5 + mov ax, 3*0x100+11 + mov cx, 8*0x100+5 mov edx, [version_picture_color] mov esi, picture_first_menu_version call Draw_picture @@ -81,17 +107,17 @@ Draw_first_menu_picture: Draw_menu_strings: - ;;===Make_menu_strings========================================================================================= + ;;===Make_menu_strings====================================================================================================== mov ebx, [window_width] shr ebx, 1 - sub ebx, (press_esc_to_exit-press_to_start-1)*3+6 + sub ebx, press_to_start.size*3+6 shl ebx, 16 add ebx, dword[bottom_middle_strings] mcall 4, ,[navigation_strings_color],press_to_start mov ebx, [window_width] shr ebx, 1 - sub ebx, (string_congratulations-press_esc_to_exit-1)*3+6 + sub ebx, press_esc_to_exit.size*3+6 shl ebx, 16 add ebx, [top_strings] mcall , ,[navigation_strings_color],press_esc_to_exit @@ -99,6 +125,176 @@ Draw_menu_strings: ret - ;;---Make_menu_strings----------------------------------------------------------------------------------------- - -;;---Some_functions------------------------------------------------------------------------------------------------------------ \ No newline at end of file + ;;---Make_menu_strings------------------------------------------------------------------------------------------------------ + + +Draw_buttons: + ;;===Draw_buttons=========================================================================================================== + + mov ebx, [button_x_left] + shl ebx, 16 + mov bx, word[button_width_short] + mov ecx, [button_y_top] + shl ecx, 16 + add cx, word[button_height] + mcall 8, , ,0x000000D0,[button_color] ; top left button + shr ecx, 16 + mov bx, cx + mov edx, [button_height] + shr edx, 1 + sub edx, 3 ; ~half of font height + add bx, dx + ror ebx, 16 + mov edx, [button_width_short] + shr edx, 1 + sub edx, string_button_play.size*3 + add bx, dx + ror ebx, 16 + mcall 4, ,[button_text_color],string_button_play + + mov ebx, [button_x_right] + shl ebx, 16 + mov bx, word[button_width_short] + mov ecx, [button_y_top] + shl ecx, 16 + add cx, word[button_height] + mcall 8, , ,0x000000D1, ; top right button + shr ecx, 16 + mov bx, cx + mov edx, [button_height] + shr edx, 1 + sub edx, 3 ; ~half of font height + add bx, dx + ror ebx, 16 + mov edx, [button_width_short] + shr edx, 1 + sub edx, string_button_exit.size*3 + add bx, dx + ror ebx, 16 + mcall 4, ,[button_text_color],string_button_exit + + mov ebx, [button_x_left] + shl ebx, 16 + mov bx, word[button_width_long] + mov ecx, [button_y_middle] + shl ecx, 16 + add cx, word[button_height] + mcall 8, , ,0x000000D2, ; middle button + shr ecx, 16 + mov bx, cx + mov edi, [button_height] + shr edi, 1 + sub edi, 3 ; ~half of font height + add bx, di + ror ebx, 16 + mov edi, [button_width_long] + shr edi, 1 + cmp [play_mode], 0 + jne @f + sub edi, string_button_pm_classic.size*3 + mov edx, string_button_pm_classic + jmp .skip + @@: + sub edi, string_button_pm_levels.size*3 + mov edx, string_button_pm_levels + .skip: + add bx, di + ror ebx, 16 + mcall 4, ,[button_text_color], + + mov ebx, [button_x_left] + shl ebx, 16 + mov bx, word[button_width_short] + mov ecx, [button_y_bottom] + shl ecx, 16 + add cx, word[button_height] + mcall 8, , ,0x000000D3, ; bottom left button + shr ecx, 16 + mov bx, cx + mov edx, [button_height] + shr edx, 1 + sub edx, 3 ; ~half of font height + add bx, dx + ror ebx, 16 + mov edx, [button_width_short] + shr edx, 1 + sub edx, string_button_inc.size*3 + add bx, dx + ror ebx, 16 + mcall 4, ,[button_text_color],string_button_inc + + mov ebx, [button_x_right] + shl ebx, 16 + mov bx, word[button_width_short] + mov ecx, [button_y_bottom] + shl ecx, 16 + add cx, word[button_height] + mcall 8, , ,0x000000D4, + shr ecx, 16 + mov bx, cx + mov edx, [button_height] + shr edx, 1 + sub edx, 3 ; ~half of font height + add bx, dx + ror ebx, 16 + mov edx, [button_width_short] + shr edx, 1 + sub edx, string_button_dec.size*3 + add bx, dx + ror ebx, 16 + mcall 4, ,[button_text_color],string_button_dec + + ret + + ;;---Draw_buttons---------------------------------------------------------------------------------------------------------- + + +Delete_buttons: + ;;===Delete_buttons======================================================================================================== + + mcall 8,,,0x800000D0 + mcall ,,,0x800000D1 + mcall ,,,0x800000D2 + mcall ,,,0x800000D3 + mcall ,,,0x800000D4 + + ret + + ;;---Delete_buttons-------------------------------------------------------------------------------------------------------- + + +Change_play_mode: + ;;===Change_play_mode====================================================================================================== + + cmp [play_mode], LEVELS_MODE + jne @f + mov [play_mode], CLASSIC_MODE + mov [cur_level_number], 0 + ret + @@: + inc [play_mode] + + call Set_first_level_of_play_mode + + ret + + ;;---Change_play_mode------------------------------------------------------------------------------------------------------ + + +Set_first_level_of_play_mode: + ;;===Set_first_level_of_play_mode========================================================================================== + + cmp [play_mode], CLASSIC_MODE + jne @f + mov [cur_level_number], CLASSIC_MODE_FIRST_LEVEL + @@: + cmp [play_mode], LEVELS_MODE + jne @f + mov [cur_level_number], LEVELS_MODE_FIRST_LEVEL + @@: + + ret + + ;;---Set_first_level_of_play_mode------------------------------------------------------------------------------------------- + +;;---Some_functions------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/programs/games/snake/trunk/game_over.asm b/programs/games/snake/trunk/game_over.asm index d34de85bbe..cd2ab6b64b 100644 --- a/programs/games/snake/trunk/game_over.asm +++ b/programs/games/snake/trunk/game_over.asm @@ -2,11 +2,22 @@ Game_over: + call Show_cursor + mov ebx, [score] - cmp ebx, [hi_score] + + cmp [play_mode], CLASSIC_MODE + jne @f + cmp ebx, [hi_score_classic] jng .redraw - mov [is_new_record], 1 + jmp .done + @@: + cmp ebx, [hi_score_levels] + jng .redraw + mov [is_new_record], 1 + jmp .done + .done: mcall 40,100111b ; set events: standart + mouse @@ -38,8 +49,7 @@ Game_over: .mouse: ; mouse event received - push dword edit1 - call [edit_box.mouse] + invoke edit_box.mouse, edit1 jmp .still @@ -47,28 +57,21 @@ Game_over: .key: ; a key was pressed mcall 2 ; get keycode - cmp [is_new_record], 1 - jnz .key.skip - + cmp [is_new_record], 1 + je .key.is_record + + cmp ah, 0x1B ; Escape - go to menu + jne .still + jmp First_menu + + .key.is_record: cmp ah, 0x0D ; Enter jnz @f call Score_and_name_store - mov [is_new_record], 0 - mcall 40,111b ; set events: standart jmp First_menu - @@: - push dword edit1 - call [edit_box.key] - + invoke edit_box.key, edit1 jmp .still - .key.skip: - - cmp ah, 0x1B ; Escape - go to menu - jne .still - - mcall 40,111b ; set events: standart - jmp First_menu .button: ; a button was pressed @@ -76,7 +79,7 @@ Game_over: shr eax, 8 ; we should do it to get the real button code cmp eax, 1 - je Exit + je Save_do_smth_else_and_exit jmp .still @@ -88,10 +91,19 @@ Game_over: Draw_game_over_picture: ;;===Draw_game_over_picture================================================================================================ - mov ax, 0*0x100+29 + cmp [is_new_record], 1 + je @f + mov ax, 1*0x100+26 mov cx, 1*0x100+13 mov edx, [game_over_picture_color] mov esi, picture_game_over + jmp .done + @@: + mov ax, 5*0x100+17 + mov cx, 1*0x100+12 + mov edx, [you_win_picture_color] + mov esi, picture_you_win + .done: call Draw_picture ret @@ -107,37 +119,33 @@ Draw_game_over_strings: mov ebx, [window_width] shr ebx, 1 - sub ebx, (string_enter_your_name-string_congratulations-1+8)*3+6 + sub ebx, string_congratulations.size*3+6*6 shl ebx, 16 add ebx, [bottom_top_strings] mcall 4, ,[game_over_strings_color],string_congratulations mov ebx, [window_width] shr ebx, 1 - sub ebx, (strings_end-string_enter_your_name-1+8)*3+6 -; add ebx, (strings_end-string_enter_your_name)*6 + sub ebx, string_enter_your_name.size*3+6*6 shl ebx, 16 add ebx, [bottom_bottom_strings] mcall , , ,string_enter_your_name mov ebx, [window_width] shr ebx, 1 - sub ebx, (press_to_start-string_apply_name_enter-1)*3+6 + sub ebx, string_apply_name_enter.size*3 shl ebx, 16 add ebx, [top_strings] mcall , ,[navigation_strings_color],string_apply_name_enter mov edx, [window_width] shr edx, 1 - sub edx, (string_enter_your_name-string_congratulations-1+8)*3+7 - add edx, (string_enter_your_name-string_congratulations)*6 + add edx, string_congratulations.size*3-6*6-1 shl edx, 16 add edx, dword[bottom_top_strings] mcall 47,0x00070000,[score], ,[game_over_hiscore_color] mov ebx, [window_width] shr ebx, 1 - sub ebx, (strings_end-string_enter_your_name-1+8)*3+9 - add ebx, (strings_end-string_enter_your_name)*6 - mov [edit1+0x04], ebx - push dword edit1 - call [edit_box.draw] + add ebx, string_enter_your_name.size*3-6*6-3 + mov [edit1.left], ebx + invoke edit_box.draw, edit1 ret @@ -153,8 +161,28 @@ Draw_game_over_strings: Score_and_name_store: ;;===Name_store============================================================================================================ - invoke ini.set_str, cur_dir_path, aScore, aChampion_name, hed, 15 - invoke ini.set_int, cur_dir_path, aScore, aHiscore, [score] + mov esi, hed + + cmp [play_mode], CLASSIC_MODE + jne @f + mov edi, champion_name_classic + jmp .done + @@: + mov edi, champion_name_levels + .done: + + mov ecx, CHAMPION_NAME_LENGTH + rep movsb + + mov eax, [score] + + cmp [play_mode], CLASSIC_MODE + jne @f + mov [hi_score_classic], eax + jmp .done2 + @@: + mov [hi_score_levels], eax + .done2: ret diff --git a/programs/games/snake/trunk/level.asm b/programs/games/snake/trunk/level.asm index 5945c61e95..acbe301349 100644 --- a/programs/games/snake/trunk/level.asm +++ b/programs/games/snake/trunk/level.asm @@ -2,31 +2,13 @@ Level_begin: - mov [score], 0 - mov [action], 0 - mov eax, [gw_mul_gh] - sub eax, 3 - mov [number_of_free_dots], ax - - invoke ini.get_str, cur_dir_path, aScore, aChampion_name, champion_name, 15, champion_name - invoke ini.get_int, cur_dir_path, aScore, aHiscore, 0 - - test eax, eax - jz @f - mov dword [hi_score], eax - @@: - - mov esi, start_map - mov edi, field_map - mov ecx, [gw_mul_gh] - shr ecx, 2 - rep movsd - + call Load_level call Get_eat Level_body: ;;===Level_body======================================================================================================== + call Hide_cursor mcall 26, 9 mov [time_before_waiting], eax mov eax, [time_wait_limit] @@ -43,6 +25,7 @@ mcall 26, 9 mcall 0, , ,[window_style], ,window_title call Draw_decorations + call Draw_stones call Draw_snake call Draw_eat call Draw_level_strings @@ -82,6 +65,16 @@ mcall 26, 9 jz .button ; + .button: ; процедура обрабоки кнопок в программе + mcall 17 ; функция 17: получить номер нажатой кнопки + + shr eax, 8 ; сдвигаем регистр eax на 8 бит вправо, чтобы получить номер нажатой кнопки + cmp eax, 1 + je Save_do_smth_else_and_exit ; если это не кнопка 1 (зарезервирована системой как кнопка закрытия программы), пропускаем 2 следующие строчки кода + + jmp .still + + .key: mcall 2 ; get keycode @@ -101,135 +94,124 @@ mcall 26, 9 jmp .still ; jump to wait for another event - .button: ; процедура обрабоки кнопок в программе - mcall 17 ; функция 17: получить номер нажатой кнопки - - shr eax, 8 ; сдвигаем регистр eax на 8 бит вправо, чтобы получить номер нажатой кнопки - cmp eax, 1 - je Exit ; если это не кнопка 1 (зарезервирована системой как кнопка закрытия программы), пропускаем 2 следующие строчки кода - - jmp .still - - .key.left: - bts dword[action], 0 + bts [action], 0 jc @f mov [time_to_wait], 0 @@: - mov [snake_napravlenie_next], LEFT + mov [snake_direction_next], LEFT jmp .still .key.down: - bts dword[action], 0 + bts [action], 0 jc @f mov [time_to_wait], 0 @@: - mov [snake_napravlenie_next], DOWN + mov [snake_direction_next], DOWN jmp .still .key.up: - bts dword[action], 0 + bts [action], 0 jc @f mov [time_to_wait], 0 @@: - mov [snake_napravlenie_next], UP + mov [snake_direction_next], UP jmp .still .key.right: - bts dword[action], 0 + bts [action], 0 jc @f mov [time_to_wait], 0 @@: - mov [snake_napravlenie_next], RIGHT + mov [snake_direction_next], RIGHT jmp .still Game_step: - cmp [snake_napravlenie], LEFT ; are we moving to left? + cmp [snake_direction], LEFT ; are we moving to left? jz .left - cmp [snake_napravlenie], DOWN ; ... down? + cmp [snake_direction], DOWN ; ... down? jz .down - cmp [snake_napravlenie], UP ; ... up? + cmp [snake_direction], UP ; ... up? jz .up jmp .right ; then right .left: - cmp [snake_napravlenie_next], RIGHT ; next step is to right? - jz .with_rewerse - jmp .without_rewerse + cmp [snake_direction_next], RIGHT ; next step is to right? + jz .with_reverse + jmp .without_reverse .down: - cmp [snake_napravlenie_next], UP ; next step is to up? - jz .with_rewerse - jmp .without_rewerse + cmp [snake_direction_next], UP ; next step is to up? + jz .with_reverse + jmp .without_reverse .up: - cmp [snake_napravlenie_next], DOWN ; next step is to bottom? - jz .with_rewerse - jmp .without_rewerse + cmp [snake_direction_next], DOWN ; next step is to bottom? + jz .with_reverse + jmp .without_reverse .right: - cmp [snake_napravlenie_next], LEFT ; next step is to left? - jz .with_rewerse - jmp .without_rewerse + cmp [snake_direction_next], LEFT ; next step is to left? + jz .with_reverse + jmp .without_reverse - .with_rewerse: - call Set_reverse_napravlenie + .with_reverse: + call Set_reverse_direction call Reverse - .without_rewerse: -; mov [time_to_wait], 0 + .without_reverse: mov edx, snake_dots-2 add edx, [snake_length_x2] - cmp [snake_napravlenie_next], LEFT + cmp [snake_direction_next], LEFT je .to_left - cmp [snake_napravlenie_next], DOWN + cmp [snake_direction_next], DOWN je .to_down - cmp [snake_napravlenie_next], UP + cmp [snake_direction_next], UP je .to_up - cmp [snake_napravlenie_next], RIGHT + cmp [snake_direction_next], RIGHT je .to_right .to_left: - mov [snake_napravlenie], LEFT + mov [snake_direction], LEFT mov ax, [edx] dec al cmp al, -1 jne @f - mov al, byte[g_w] + mov al, GRID_WIDTH dec al @@: jmp Snake_move .to_down: - mov [snake_napravlenie], DOWN + mov [snake_direction], DOWN mov ax, [edx] inc ah - cmp ah, byte[g_h] + cmp ah, GRID_HEIGHT jne @f mov ah, 0 @@: jmp Snake_move .to_up: - mov [snake_napravlenie], UP + mov [snake_direction], UP mov ax, [edx] dec ah cmp ah, -1 jne @f - mov ah, byte[g_h] + mov ah, GRID_HEIGHT dec ah @@: jmp Snake_move .to_right: - mov [snake_napravlenie], RIGHT + mov [snake_direction], RIGHT mov ax, [edx] inc al - cmp al, byte[g_w] + cmp al, GRID_WIDTH jne @f mov al, 0 @@: @@ -285,7 +267,7 @@ Draw_level_strings: mov ebx, [window_width] shr ebx, 1 - sub ebx, (string_resume_space-string_pause_space-1)*3+6 + sub ebx, string_pause_space.size*3+6 shl ebx, 16 add ebx, [top_strings] mcall 4, ,[navigation_strings_color],string_pause_space ; Draw 'PAUSE - SPACE' string @@ -298,6 +280,26 @@ Draw_level_strings: call Draw_hiscore_string call Draw_hiscore_number + cmp [play_mode], LEVELS_MODE + jne @f + + mov ebx, [window_width] + shr ebx, 3 + sub ebx, 5 + shl ebx, 16 + add ebx, [bottom_bottom_strings] + mcall 4, ,[level_string_color],string_level + + mov edx, [window_width] + shr edx, 3 + sub edx, 5+1 + add edx, string_level.size*6 + shl edx, 16 + add edx, [bottom_bottom_strings] + mcall 47,0x00020000,[cur_level_number], ,[level_number_color],[background_color] + + @@: + ret ;;---Draw_level_strings------------------------------------------------------------------------------------------------ @@ -368,7 +370,7 @@ Get_eat: .place_found: sub ebx, field_map mov eax, ebx - mov bl, byte[g_w] + mov bl, GRID_WIDTH div bl xchg al, ah @@ -395,8 +397,8 @@ Sdvig: ;;---Sdvig------------------------------------------------------------------------------------------------------------- -Set_reverse_napravlenie: - ;;===Set_reverse_napravlenie=========================================================================================== +Set_reverse_direction: + ;;===Set_reverse_direction================================================================================================== mov eax, snake_dots mov ebx, snake_dots+2 @@ -410,32 +412,32 @@ Set_reverse_napravlenie: cmp cl, 0 jne .skip2 - mov dl, byte[g_w] + mov dl, GRID_WIDTH dec dl cmp ch, dl jne .Normal_y_ravny - mov [snake_napravlenie_next], RIGHT + mov [snake_direction_next], RIGHT ret .skip2: - mov dl, byte[g_w] + mov dl, GRID_WIDTH dec dl cmp cl, dl jne .Normal_y_ravny cmp ch, 0 jne .Normal_y_ravny - mov [snake_napravlenie_next], LEFT + mov [snake_direction_next], LEFT ret .Normal_y_ravny: cmp cl, ch jg .Napravlenie_to_right - mov [snake_napravlenie_next], LEFT + mov [snake_direction_next], LEFT ret .Napravlenie_to_right: - mov [snake_napravlenie_next], RIGHT + mov [snake_direction_next], RIGHT ret .X_ravny: @@ -447,40 +449,40 @@ Set_reverse_napravlenie: cmp cl, 0 jne .skip3 - mov dl, byte[g_h] + mov dl, GRID_HEIGHT dec dl cmp ch, dl jne .Normal_x_ravny - mov [snake_napravlenie_next], DOWN + mov [snake_direction_next], DOWN ret .skip3: - mov dl, byte[g_h] + mov dl, GRID_HEIGHT dec dl cmp ch, dl jne .Normal_x_ravny cmp ch, 0 jne .Normal_x_ravny - mov [snake_napravlenie_next], UP + mov [snake_direction_next], UP ret .Normal_x_ravny: cmp cl, ch ; !!! jg .Napravlenie_to_down ; 0 1 2 ... - mov [snake_napravlenie_next], UP ; 1 + mov [snake_direction_next], UP ; 1 ret ; 2 ; . .Napravlenie_to_down: ; . - mov [snake_napravlenie_next], DOWN ; . + mov [snake_direction_next], DOWN ; . ret - ;;---Set_reverse_napravlenie------------------------------------------------------------------------------------------- + ;;---Set_reverse_direction-------------------------------------------------------------------------------------------------- Snake_move: - ;;===Snake_move======================================================================================================== + ;;===Snake_move============================================================================================================= ;; in : ;; ax = coord's of new head ;; edx = snake_dots+[snake_length_x2]-2 (snake head) @@ -493,8 +495,8 @@ Snake_move: add [snake_length_x2], 2 add [score], SCORE_EAT - dec word[number_of_free_dots] - cmp word[number_of_free_dots], 0 + dec [number_of_free_dots] + cmp [number_of_free_dots], 0 je Game_over mov ax, word[eat] mov cl, 1 @@ -539,6 +541,13 @@ Snake_move: dec [score] call Draw_score_number @@: + + cmp [play_mode], LEVELS_MODE + jne @f + cmp [snake_length_x2], (EAT_TO_END_LEVEL+3)*2 + je Do_smth_between_levels + @@: + mcall 26, 9 mov [time_before_waiting], eax mov eax, [time_wait_limit] @@ -547,4 +556,112 @@ Snake_move: ;;---Snake_move------------------------------------------------------------------------------------------------------------ + +Do_smth_between_levels: + ;;===Do_smth_between_levels================================================================================================ + + inc [cur_level_number] + cmp [cur_level_number], LAST_LEVEL_NUMBER+1 + jne @f + mov [cur_level_number], LEVELS_MODE_FIRST_LEVEL + @@: + + call Draw_splash + + @@: + mcall 2 + cmp eax, 1 + jne @b + + jmp Level_begin + + ;;---Do_smth_between_levels------------------------------------------------------------------------------------------------ + + +Draw_splash: + ;;===Draw_splash=========================================================================================================== + + mov al, 0 + mov cl, GRID_WIDTH-1 + mov edx, [splash_background_color] + + .draw: + mov bh, GRID_HEIGHT-1 + mov bl, al + @@: + call Draw_square + sub bh, 2 + cmp bh, 0 + jg @b + + inc al + + mov bh, GRID_HEIGHT-2 + mov bl, cl + @@: + call Draw_square + sub bh, 2 + cmp bh, 0 + jnl @b + + dec cl + cmp cl, 0 + jl @f + + push eax ebx + mcall 5,PAUSE_WHILE_DRAWING_SPLASH + pop ebx eax + + jmp .draw + @@: + + + + mov ax, 2*0x100+24 + mov cx, 1*0x100+5 + mov edx, [splash_level_string_color] + mov esi, picture_level + call Draw_picture + + mov eax, [cur_level_number] + mov dl, 10 + div dl + push ax + + mov esi, digits_font + @@: + test al, al + jz @f + add esi, 20 + dec al + jmp @b + @@: + + mov ax, 9*0x100+4 + mov cx, 8*0x100+5 + mov edx, [splash_level_number_color] + call Draw_picture + + pop ax + mov esi, digits_font + @@: + test ah, ah + jz @f + add esi, 20 + dec ah + jmp @b + @@: + + mov ax, 15*0x100+4 + mov cx, 8*0x100+5 + mov edx, [splash_level_number_color] + call Draw_picture + + mcall 5,PAUSE_BETWEEN_LEVELS + + ret + + ;;---Draw_splash----------------------------------------------------------------------------------------------------------- + + ;;---Some_functions------------------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/programs/games/snake/trunk/pause.asm b/programs/games/snake/trunk/pause.asm index 9acae1555d..6879976641 100644 --- a/programs/games/snake/trunk/pause.asm +++ b/programs/games/snake/trunk/pause.asm @@ -2,6 +2,7 @@ Pause_mode: + call Show_cursor mov [action], 0 mov eax, [time_wait_limit] mov [time_to_wait], eax @@ -37,7 +38,7 @@ Pause_mode: shr eax, 8 ; we should do it to get the real button code cmp eax, 1 - je Exit + je Save_do_smth_else_and_exit jmp .still @@ -60,7 +61,7 @@ Pause_mode: Draw_pause_picture: ;;===Draw_pause_picture======================================================================================================== - mov ax, 0*0x100+29 + mov ax, 2*0x100+24 mov cx, 4*0x100+6 mov edx, [pause_picture_color] mov esi, picture_pause @@ -76,7 +77,7 @@ Draw_pause_strings: mov ebx, [window_width] shr ebx, 1 - sub ebx, (string_menu_esc-string_resume_space-1)*3+6 + sub ebx, string_resume_space.size*3+6 shl ebx, 16 add ebx, dword[bottom_middle_strings] mcall 4, ,[navigation_strings_color],string_resume_space ; Show 'RESUME - SPACE' string diff --git a/programs/games/snake/trunk/snake.asm b/programs/games/snake/trunk/snake.asm index 0171dca80b..baf324a6a2 100644 --- a/programs/games/snake/trunk/snake.asm +++ b/programs/games/snake/trunk/snake.asm @@ -3,7 +3,7 @@ use32 org 0x0 db 'MENUET01' - dd 0x1,start,i_end,d_end,stacktop,0x0,cur_dir_path + dd 0x01,start,i_end,d_end,stacktop,0x0,cur_dir_path ;;---HEADER-------------------------------------------------------------------------------------------------------------------- @@ -16,6 +16,11 @@ include '../../../develop/libraries/box_lib/trunk/box_lib.mac' ;;===Define_chapter============================================================================================================ +GRID_WIDTH equ 28 +GRID_HEIGHT equ 14 + +MIN_SQUARE_SIDE_LENGTH equ 9 + SCORE_EAT equ 100 LEFT equ 0 @@ -23,6 +28,27 @@ DOWN equ 1 UP equ 2 RIGHT equ 3 +struct LEVEL + field db GRID_WIDTH*GRID_HEIGHT dup (?) + snake_dots db 6 dup (?) + snake_direction dd ? + snake_direction_next dd ? + number_of_stones dd ? +ends + +CLASSIC_MODE equ 0 +LEVELS_MODE equ 1 + +CLASSIC_MODE_FIRST_LEVEL equ 0 +LEVELS_MODE_FIRST_LEVEL equ 1 + +EAT_TO_END_LEVEL equ 12 +PAUSE_BETWEEN_LEVELS equ 250 +PAUSE_WHILE_DRAWING_SPLASH equ 4 + +CHAMPION_NAME_LENGTH equ 15 +LAST_LEVEL_NUMBER equ 12 + ;;---Define_chapter------------------------------------------------------------------------------------------------------------ start: @@ -45,22 +71,18 @@ align 4 invoke ini.get_int, cur_dir_path, aPreferences, aSpeed, 80 neg eax add [time_wait_limit], eax - invoke ini.get_int, cur_dir_path, aPreferences, aSquare_side_length, 19 - mov [square_side_length], eax - invoke ini.get_int, cur_dir_path, aPreferences, aSpace_between_squares, 1 - mov [space_between_squares], eax invoke ini.get_str, cur_dir_path, aPreferences, aTheme, aTheme_name, 31, aTheme_name invoke ini.get_int, cur_dir_path, aTheme_name, aDecorations, 2 - mov [decorations], al + mov [decorations], eax invoke ini.get_color, cur_dir_path, aTheme_name, aBackground_color, 0x000000 or [background_color], eax or [window_style], eax - invoke ini.get_color, cur_dir_path, aTheme_name, aDecorations_color, 0x00aaaa00 + invoke ini.get_color, cur_dir_path, aTheme_name, aDecorations_color, 0xAAAA00 or [decorations_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_color, 0x1111ff or [snake_color], eax - invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_head_color, 0x1111ff + invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_head_color, 0x6B6Bff or [snake_head_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_picture_color, 0x4488ff or [snake_picture_color], eax @@ -70,6 +92,8 @@ align 4 or [pause_picture_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_picture_color, 0xff1111 or [game_over_picture_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aYou_win_picture_color, 0xffff11 + or [you_win_picture_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aEat_color, 0xffff11 or [eat_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aNavigation_strings_color, 0x80ff7777 @@ -78,6 +102,8 @@ align 4 or [game_over_strings_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aScore_string_color, 0x80ffffff or [score_string_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aLevel_string_color, 0xffffff + or [level_string_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aHiscore_string_color, 0x80ffffff or [hiscore_string_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aChampion_string_color, 0x80ffffff @@ -86,19 +112,45 @@ align 4 or [game_over_hiscore_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aScore_number_color, 0xffffff or [score_number_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aLevel_number_color, 0xffffff + or [level_number_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aHiscore_number_color, 0x00ffffff or [hiscore_number_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aChampion_name_color, 0x80ffffff or [champion_name_color], eax invoke ini.get_color, cur_dir_path, aTheme_name, aEdit_box_selection_color, 0x00aa00 - or [edit1+0x10], eax + or [edit1.shift_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aButton_color, 0xDDDDDD + or [button_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aButton_text_color, 0x000000 + or [button_text_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aStone_color, 0x5f8700 + or [stone_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aSplash_background_color, 0xAAAA00 + or [splash_background_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aSplash_level_number_color, 0x000000 + or [splash_level_number_color], eax + invoke ini.get_color, cur_dir_path, aTheme_name, aSplash_level_string_color, 0x000000 + or [splash_level_string_color], eax + + invoke ini.get_int, cur_dir_path, aReserved, aSquare_side_length, 19 + mov [square_side_length], eax + invoke ini.get_str, cur_dir_path, aReserved, aChampion_name_classic, champion_name_classic, CHAMPION_NAME_LENGTH, champion_name_classic + invoke ini.get_int, cur_dir_path, aReserved, aHiscore_classic, 777 + or [hi_score_classic], eax + invoke ini.get_str, cur_dir_path, aReserved, aChampion_name_levels, champion_name_levels, CHAMPION_NAME_LENGTH, champion_name_levels + invoke ini.get_int, cur_dir_path, aReserved, aHiscore_levels, 777 + or [hi_score_levels], eax mov eax, [background_color] - mov [edit1+0x0C], eax - mov [edit1+0x14], eax - mov [edit1+0x18], eax + mov [edit1.color], eax + mov [edit1.focus_border_color], eax + mov [edit1.blur_border_color], eax mov eax, [game_over_hiscore_color] - mov [edit1+0x1C], eax + mov [edit1.text_color], eax + + mcall 37,4,cursor_data,2 ; load empty cursor (for "hiding" cursor while level_mode) + mov [cursor_handle], eax call Set_geometry @@ -109,6 +161,37 @@ include 'game_over.asm' ; Game_over body and functions ;;===Some_functions============================================================================================================ + +Save_do_smth_else_and_exit: + ;;===Save_do_smth_else_and_exit============================================================================================ + + mcall 37,6,[cursor_handle] ; delete cursor + + invoke ini.set_int, cur_dir_path, aReserved, aSquare_side_length, [square_side_length] + + mov edi, champion_name_classic + xor al, al + mov ecx, CHAMPION_NAME_LENGTH+1 + cld + repne scasb + neg ecx + add ecx, CHAMPION_NAME_LENGTH + invoke ini.set_str, cur_dir_path, aReserved, aChampion_name_classic, champion_name_classic, ecx + invoke ini.set_int, cur_dir_path, aReserved, aHiscore_classic, [hi_score_classic] + + mov edi, champion_name_levels + xor al, al + mov ecx, CHAMPION_NAME_LENGTH+1 + cld + repne scasb + neg ecx + add ecx, CHAMPION_NAME_LENGTH + invoke ini.set_str, cur_dir_path, aReserved, aChampion_name_levels, champion_name_levels, ecx + invoke ini.set_int, cur_dir_path, aReserved, aHiscore_levels, [hi_score_levels] + + ;;---Save_do_smth_else_and_exit-------------------------------------------------------------------------------------------- + + Exit: ;;===Exit================================================================================================================== @@ -121,8 +204,8 @@ Exit: Set_geometry: ;;===Set_geometry========================================================================================================== - mov eax, [space_between_squares] - add eax, [square_side_length] + mov eax, [square_side_length] + inc eax ; space between squares mov [g_s], eax mov eax, [g_s] @@ -140,16 +223,12 @@ Set_geometry: add eax, 25 mov [gbym1], eax - mov eax, [g_w] - mul word[g_h] - mov [gw_mul_gh], eax - - mov edx, [g_w] + mov edx, GRID_WIDTH mov eax, [g_s] mul dx mov [gw_mul_gs], eax - mov edx, [g_h] + mov edx, GRID_HEIGHT mov eax, [g_s] mul dx mov [gh_mul_gs], eax @@ -184,11 +263,12 @@ Set_geometry: add eax, 5*2 ; skin width mov [window_width], eax - mov eax, [gh_mul_gs] + mcall 48,4 ; get skin header height + add eax, [gh_mul_gs] add eax, [gbym1] add eax, [g_e] add eax, 30 - add eax, 22+5 ; skin height + add eax, 5 ; skin height (bottom part) mov [window_height], eax mcall 48, 5 @@ -198,12 +278,6 @@ Set_geometry: cmp dx, word[window_width] ; does window fit to work area width? jnl @f dec [square_side_length] -; dps 'snake: Window does not fit to screen.' -; newline -; dps 'Square_side_length was decreased.' -; newline -; dps 'Check you config file! (snake.ini)' -; newline jmp Set_geometry @@: @@ -213,12 +287,6 @@ Set_geometry: cmp cx, word[window_height] ; does window fit to work area height? jnl @f dec [square_side_length] -; dps 'snake: Window does not fit to screen.' -; newline -; dps 'Square_side_length was decreased.' -; newline -; dps 'Check you config file! (snake.ini)' -; newline jmp Set_geometry @@: @@ -242,17 +310,95 @@ Set_geometry: mov [bottom_bottom_strings], eax sub eax, 4 - mov [edit1+0x08], eax + mov [edit1.top], eax + + + mov eax, [g_s] + shl eax, 2 + sub eax, 2 + mov [button_width_short], eax + mov eax, [g_s] + shl eax, 3 + add eax, [g_s] + sub eax, 2 + mov [button_width_long], eax + mov eax, [g_s] + sub eax, 2 + mov [button_height], eax + + mov bl, 0x10 + mov cl, 0x08 + + mov al, byte[g_s] + mul bl + mov bx, ax + add bx, word[gbxm1] + inc bx + + mov al, byte[g_s] + mul cl + mov cx, ax + add cx, word[gbym1] + inc cx + + mov [button_x_left], ebx + mov [button_y_top], ecx + + add ebx, [g_s] + add ebx, [g_s] + add ebx, [g_s] + add ebx, [g_s] + add ebx, [g_s] + + mov [button_x_right], ebx + + add ecx, [g_s] + add ecx, [g_s] + + mov [button_y_middle], ecx + + add ecx, [g_s] + add ecx, [g_s] + + mov [button_y_bottom], ecx + ret ;;---Set_geometry------------------------------------------------------------------------------------------------------ +Increase_geometry: + ;;===Increase_geometry================================================================================================= + + inc [square_side_length] + call Set_geometry + mcall 67,[wp_x],[wp_y],[window_width],[window_height] + + ret + + ;;---Increase_geometry------------------------------------------------------------------------------------------------- + + +Decrease_geometry: + ;;===Decrease_geometry================================================================================================= + + cmp [square_side_length], MIN_SQUARE_SIDE_LENGTH + je @f + dec [square_side_length] + call Set_geometry + mcall 67,[wp_x],[wp_y],[window_width],[window_height] + + @@: + ret + + ;;---Decrease_geometry------------------------------------------------------------------------------------------------- + + Draw_decorations: ;;===Draw_decorations================================================================================================== - mov al, [decorations] + mov al, byte[decorations] dec al jz grid_lines dec al @@ -287,7 +433,7 @@ Draw_decorations: mov ecx, [gbym1_shl16_gbym1] add ecx, [gh_mul_gs] mov edx, [decorations_color] - mov esi, [g_w] + mov esi, GRID_WIDTH add esi, 1 @@: @@ -300,7 +446,7 @@ Draw_decorations: mov ebx, [gbxm1_shl16_gbxm1] add ebx, [gw_mul_gs] mov ecx, [gbym1_shl16_gbym1] - mov esi, [g_h] + mov esi, GRID_HEIGHT add esi, 1 @@: @@ -322,7 +468,7 @@ Draw_decorations: add ecx, [gbym1_plus_gh_mul_gs] add ecx, [g_e] mov edx, [decorations_color] - mov esi, [g_w] + mov esi, GRID_WIDTH add esi, 1 @@: @@ -337,7 +483,7 @@ Draw_decorations: add ebx, [gbxm1_plus_gw_mul_gs] add ebx, [g_e] mov ecx, [gbym1_shl16_gbym1] - mov esi, [g_h] + mov esi, GRID_HEIGHT add esi, 1 @@: @@ -596,6 +742,8 @@ Draw_square: ;; bh - y_coord ;; edx - color + push eax ebx ecx edx + mov cl, bh mov al, byte[g_s] @@ -615,9 +763,11 @@ Draw_square: shl ecx, 16 add ecx, [g_s] dec ecx - + mcall 13 + pop edx ecx ebx eax + ret ;;---Draw_square------------------------------------------------------------------------------------------------------- @@ -628,7 +778,7 @@ Draw_menu_esc: mov ebx, [window_width] shr ebx, 1 - sub ebx, (string_apply_name_enter-string_menu_esc-1)*3+6 + sub ebx, string_menu_esc.size*3+6 shl ebx, 16 add ebx, dword[top_strings] mcall 4, ,[navigation_strings_color],string_menu_esc @@ -647,9 +797,9 @@ Draw_score_string: shl ebx, 16 add ebx, dword[bottom_top_strings] mcall 4, ,[score_string_color],string_score - + ret - + ;;---Draw_score_string------------------------------------------------------------------------------------------------- @@ -658,14 +808,14 @@ Draw_score_number: mov edx, [window_width] shr edx, 3 - sub edx, 6 - add edx, (string_hi_score-string_score)*6 + sub edx, 5+1 + add edx, string_score.size*6 shl edx, 16 add edx, dword[bottom_top_strings] mcall 47,0x00070000,[score], ,[score_number_color],[background_color] - + ret - + ;;---Draw_score_number------------------------------------------------------------------------------------------------- @@ -676,7 +826,7 @@ Draw_hiscore_string: shr ebx, 3 neg ebx add ebx, [window_width] - sub ebx, (string_player-string_hi_score)*6+7*6+5 + sub ebx, string_hi_score.size*6+7*6+5 shl ebx, 16 add ebx, dword[bottom_top_strings] mcall 4, ,[hiscore_string_color],string_hi_score @@ -685,9 +835,9 @@ Draw_hiscore_string: ;;---Draw_hiscore_string----------------------------------------------------------------------------------------------- - + Draw_hiscore_number: - ;;===Draw_hiscore_number=============================================================================================== + ;;===Draw_hiscore_number=================================================================================================== mov edx, [window_width] shr edx, 3 @@ -696,21 +846,30 @@ Draw_hiscore_number: sub edx, 7*6+6 shl edx, 16 add edx, dword[bottom_top_strings] - mcall 47,0x00070000,[hi_score], ,[hiscore_number_color] + + cmp [play_mode], CLASSIC_MODE + jne @f + mov ecx, [hi_score_classic] + jmp .done + @@: + mov ecx, [hi_score_levels] + + .done: + mcall 47,0x00070000, , ,[hiscore_number_color] ret - ;;---Draw_hiscore_number----------------------------------------------------------------------------------------------- - - + ;;---Draw_hiscore_number--------------------------------------------------------------------------------------------------- + + Draw_champion_string: - ;;===Draw_champion_string============================================================================================== + ;;===Draw_champion_string================================================================================================== mov ebx, [window_width] shr ebx, 3 neg ebx add ebx, [window_width] - sub ebx, (string_level-string_champion)*6+7*6+5 + sub ebx, string_champion.size*6+7*6+5 shl ebx, 16 add ebx, dword[bottom_bottom_strings] mcall 4, ,[champion_string_color],string_champion @@ -727,11 +886,20 @@ Draw_champion_name: shr ebx, 3 neg ebx add ebx, [window_width] - sub ebx, (press_to_start-champion_name)*6+7*6+6 - add ebx, (press_to_start-champion_name)*6 + sub ebx, CHAMPION_NAME_LENGTH/2*6+7*6+6 ; there is no difference between length of champion names for other play_modes + add ebx, CHAMPION_NAME_LENGTH/2*6 shl ebx, 16 add ebx, dword[bottom_bottom_strings] - mcall 4, ,[champion_name_color],champion_name + + cmp [play_mode], CLASSIC_MODE + jne @f + mov edx, champion_name_classic + jmp .done + @@: + mov edx, champion_name_levels + + .done: + mcall 4, ,[champion_name_color], ret @@ -783,24 +951,28 @@ Draw_on_map: ;; cl = value to draw ;; + push eax ebx edx + and eax, 0x0000ffff xor bx, bx mov bl, al shr ax, 8 - mov dx, word[g_w] + mov dx, GRID_WIDTH mul dx add ax, bx - mov edi, field_map - add edi, eax - mov [edi], cl + mov edx, field_map + add edx, eax + mov [edx], cl + + pop edx ebx eax ret - ;;---Draw_on_map------------------------------------------------------------------------------------------------------- + ;;---Draw_on_map----------------------------------------------------------------------------------------------------------- Get_from_map: - ;;===Get_from_map====================================================================================================== + ;;===Get_from_map========================================================================================================== ;; in : ;; al = x coord ;; ah = y coord @@ -814,7 +986,7 @@ Get_from_map: xor bx, bx mov bl, al shr ax, 8 - mov dx, word[g_w] + mov dx, GRID_WIDTH mul dx add ax, bx mov edi, field_map @@ -825,13 +997,112 @@ Get_from_map: ret - ;;---Get_from_map------------------------------------------------------------------------------------------------------ + ;;---Get_from_map----------------------------------------------------------------------------------------------------------- -;;---Some_functions-------------------------------------------------------------------------------------------------------- +Load_level: + ;;===Load_level============================================================================================================= + ;; in : + ;; cur_level_number = level number to load + ;; + + mov eax, [cur_level_number] + mov edx, stage_00 + @@: + test al, al + jz @f + add edx, 410 + dec al + jmp @b + @@: + + mov [cur_level], edx + + mov esi, edx + add esi, LEVEL.field + mov edi, field_map + mov ecx, GRID_WIDTH*GRID_HEIGHT/4 + rep movsd + + mov esi, edx + add esi, LEVEL.snake_dots + mov edi, snake_dots + mov ecx, 3 + rep movsw + + mov esi, edx + add esi, LEVEL.snake_direction + mov eax, [esi] + mov [snake_direction], eax + + mov esi, edx + add esi, LEVEL.snake_direction_next + mov eax, [esi] + mov [snake_direction_next], eax + + mov esi, edx + add esi, LEVEL.number_of_stones + mov eax, [esi] + mov [number_of_free_dots], GRID_WIDTH*GRID_HEIGHT-3 + sub [number_of_free_dots], eax + + mov ax, word[snake_dots] + mov cl, 1 + call Draw_on_map + mov ax, word[snake_dots+2] + mov cl, 1 + call Draw_on_map + mov ax, word[snake_dots+4] + mov cl, 1 + call Draw_on_map + + mov [action], 0 + mov [snake_length_x2], 6 + + ret + + ;;---Load_level------------------------------------------------------------------------------------------------------------- -;;===Variables============================================================================================================= +Draw_stones: + ;;===Draw_stones============================================================================================================ + + mov ax, 0*0x100+GRID_WIDTH + mov cx, 0*0x100+GRID_HEIGHT + mov edx, [stone_color] + mov esi, [cur_level] + add esi, LEVEL.field + call Draw_picture + + ret + + ;;---Draw_stones------------------------------------------------------------------------------------------------------------ + + +Hide_cursor: + ;;===Hide_cursor=========================================================================================================== + + mcall 37,5,[cursor_handle] + + ret + + ;;---Show_cursor----------------------------------------------------------------------------------------------------------- + + +Show_cursor: + ;;===Hide_cursor=========================================================================================================== + + mcall 37,5,0 + + ret + + ;;---Show_cursor----------------------------------------------------------------------------------------------------------- + + +;;---Some_functions------------------------------------------------------------------------------------------------------------- + + +;;===Variables================================================================================================================== window_title db 'Snake',0 window_style dd 0x34000000 @@ -839,106 +1110,426 @@ time_before_waiting dd 0x0 time_to_wait dd 0x0 time_wait_limit dd 101 +play_mode dd 0x0 + +square_side_length dd 19 gbxm1 dd 30 gbym1 dd 30 -g_w dd 29 -g_h dd 15 -g_e dd 13 -field_map db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - -string_score db 'SCORE :',0 -string_hi_score db 'HI-SCORE :',0 -string_player db 'PLAYER :',0 -string_champion db 'CHAMPION :',0 -string_level db 'LEVEL :',0 -string_pause_space db 'PAUSE - ',0x27,'SPACE',0x27,0 -string_resume_space db 'RESUME - ',0x27,'SPACE',0x27,0 -string_menu_esc db 'MENU - ',0x27,'ESC',0x27,0 -string_apply_name_enter db 'APPLY NAME - ',0x27,'ENTER',0x27,0 -press_to_start db 'PRESS ',0x27,'SPACE',0x27,' OR ',0x27,'ENTER',0x27,' TO START',0 -press_esc_to_exit db 'PRESS ',0x27,'ESC',0x27,' TO EXIT',0 +szZ string_score ,'SCORE : ' +szZ string_hi_score ,'HI-SCORE : ' +;szZ string_player ,'PLAYER :' +szZ string_champion ,'CHAMPION : ' +szZ string_level ,'LEVEL : ' +;szZ string_hi_level ,'HI-LEVEL :' +szZ string_pause_space ,'PAUSE - ',0x27,'SPACE',0x27 +szZ string_resume_space ,'RESUME - ',0x27,'SPACE',0x27 +szZ string_menu_esc ,'MENU - ',0x27,'ESC',0x27 +szZ string_apply_name_enter ,'APPLY NAME - ',0x27,'ENTER',0x27 +szZ press_to_start ,'PRESS ',0x27,'ENTER',0x27,' TO START' +szZ press_esc_to_exit ,'PRESS ',0x27,'ESC',0x27,' TO EXIT' ;press_F2_to_options db 'PRESS ',0x27,'F2',0x27,' TO OPTIONS',0 -string_congratulations db ' Congratulations!!! New hi-score is :',0 -string_enter_your_name db 'You are the champion! Enter your name :',0 -strings_end: +szZ string_congratulations ,' Congratulations!!! New hi-score is : ' +szZ string_enter_your_name ,'You are the champion! Enter your name : ' -snake_dots db 3,3, 4,3, 5,3, 865 dup (0) -snake_napravlenie db 3 -snake_napravlenie_next db 3 -snake_length_x2 dd 6 +szZ string_button_play ,'PLAY' +szZ string_button_exit ,'EXIT' +szZ string_button_inc ,'+INC+' +szZ string_button_dec ,'-dec-' +szZ string_button_pm_classic,'CLASSIC mode' +szZ string_button_pm_levels ,'LEVELS mode' -score dd 0 -hi_score dd 777 -is_new_record db 0 +is_new_record dd 0 -action db 0 +action dd 0 -picture_first_menu_snake db 1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,\ - 1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,\ - 1,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,\ - 1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,0,0,0,0,1,1,1,1,0,\ - 0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,\ - 1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,1,1,0,1,1,1,1,1 +picture_first_menu_snake db 1,1,1,1,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,1,1,1,1,\ + 1,0,0,0,0,1,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,1,\ + 1,1,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,1,\ + 0,0,0,1,0,1,0,1,1,0,1,1,1,1,0,1,0,1,0,0,1,0,0,0,\ + 1,1,1,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1 + picture_first_menu_version db 1,1,1,1,0,0,0,1,1,1,1,\ - 1,0,0,1,0,0,0,0,0,0,1,\ - 1,0,0,1,0,0,0,0,1,1,1,\ + 1,0,0,1,0,0,0,1,0,0,0,\ + 1,0,0,1,0,0,0,1,1,1,1,\ 1,0,0,1,0,0,0,0,0,0,1,\ 1,1,1,1,0,1,0,1,1,1,1 -picture_pause db 0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0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_dots db 7,5, 8,5, 9,5 +.snake_direction dd RIGHT +.snake_direction_next dd RIGHT +.number_of_stones dd 40 + +stage_03: +.field db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + +.snake_dots db 23,0, 22,0, 21,0 +.snake_direction dd LEFT +.snake_direction_next dd LEFT +.number_of_stones dd 44 + +stage_04: +.field db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + +.snake_dots db 3,12, 4,12, 5,12 +.snake_direction dd RIGHT +.snake_direction_next dd RIGHT +.number_of_stones dd 69 + +stage_12: +.field db 0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,\ + 0,2,2,0,2,2,2,0,0,0,0,2,0,0,0,0,0,0,0,0,2,0,2,0,0,2,0,2,\ + 0,2,0,0,2,0,2,2,2,2,0,2,2,0,0,2,2,2,0,0,0,0,0,0,0,2,2,2,\ + 0,2,2,0,0,0,0,2,0,2,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,0,0,\ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,\ + 0,2,0,2,0,0,2,2,0,0,0,0,2,2,0,0,2,0,2,0,0,2,2,0,0,0,2,2,\ + 0,2,2,2,0,0,2,0,0,0,0,0,2,0,0,0,2,2,2,0,0,2,0,0,0,0,0,2,\ + 0,0,0,0,0,0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,0,2,2,0,0,0,2,2,\ + 0,0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ + 0,0,0,2,0,2,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,\ + 2,2,0,2,2,2,0,0,0,0,0,0,0,2,2,0,2,0,2,0,0,2,0,0,0,0,0,0,\ + 0,2,0,0,0,0,2,2,2,0,0,0,0,0,2,0,2,2,2,0,0,2,2,0,2,0,2,0,\ + 2,2,0,0,0,0,2,0,2,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,2,2,2,0 + +.snake_dots db 27,0, 26,0, 25,0 +.snake_direction dd LEFT +.snake_direction_next dd LEFT +.number_of_stones dd 110 background_color dd 0x000000 decorations_color dd 0x00000000 @@ -948,6 +1539,7 @@ snake_picture_color dd 0x000000 version_picture_color dd 0x000000 pause_picture_color dd 0x000000 game_over_picture_color dd 0x000000 +you_win_picture_color dd 0x000000 eat_color dd 0x000000 navigation_strings_color dd 0x80000000 game_over_strings_color dd 0x80000000 @@ -958,6 +1550,15 @@ game_over_hiscore_color dd 0x80000000 score_number_color dd 0x40000000 hiscore_number_color dd 0x00000000 champion_name_color dd 0x80000000 +button_color dd 0x000000 +button_text_color dd 0x80000000 +stone_color dd 0x000000 +splash_background_color dd 0x000000 +splash_level_string_color dd 0x000000 +splash_level_number_color dd 0x000000 +level_string_color dd 0x80000000 +level_number_color dd 0x00000000 + align 4 @IMPORT: @@ -982,8 +1583,6 @@ bFirstDraw db 0 aPreferences db 'Preferences',0 aSpeed db 'Speed',0 -aSquare_side_length db 'Square_side_length',0 -aSpace_between_squares db 'Space_between_squares',0 aTheme db 'Theme',0 aTheme_name db 32 dup (0) @@ -996,6 +1595,7 @@ aSnake_picture_color db 'Snake_picture_color',0 aVersion_picture_color db 'Version_picture_color',0 aPause_picture_color db 'Pause_picture_color',0 aGame_over_picture_color db 'Game_over_picture_color',0 +aYou_win_picture_color db 'You_win_picture_color',0 aEat_color db 'Eat_color',0 aNavigation_strings_color db 'Navigation_string_color',0 aGame_over_strings_color db 'Game_over_string_color',0 @@ -1007,10 +1607,21 @@ aScore_number_color db 'Score_number_color',0 aHiscore_number_color db 'Hiscore_number_color',0 aChampion_name_color db 'Champion_name_color',0 aEdit_box_selection_color db 'Edit_box_selection_color',0 +aButton_color db 'Button_color',0 +aButton_text_color db 'Button_text_color',0 +aStone_color db 'Stone_color',0 +aSplash_background_color db 'Splash_background_color',0 +aSplash_level_string_color db 'Splash_level_string_color',0 +aSplash_level_number_color db 'Splash_level_number_color',0 +aLevel_string_color db 'Level_string_color',0 +aLevel_number_color db 'Level_number_color',0 -aScore db 'Score',0 -aHiscore db 'Hiscore',0 -aChampion_name db 'Champion_name',0 +aReserved db 'Reserved',0 +aSquare_side_length db 'Square_side_length',0 +aHiscore_classic db 'Hiscore_classic',0 +aChampion_name_classic db 'Champion_name_classic',0 +aHiscore_levels db 'Hiscore_levels',0 +aChampion_name_levels db 'Champion_name_levels',0 edit1 edit_box 65,397,0x0,0x000000,0x000000,0x000000,0x000000,0x80000000,15,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1 @@ -1021,21 +1632,35 @@ hed_end: rb 256 mouse_dd rd 1 -decorations rb 1 -number_of_free_dots rw 1 +cur_level rd 1 +cur_level_number rd 1 +hi_level rd 1 -eat rb 1 +score rd 1 +hi_score_classic rd 1 +hi_score_levels rd 1 + +champion_name_classic rb CHAMPION_NAME_LENGTH +champion_name_levels rb CHAMPION_NAME_LENGTH + +snake_dots rb GRID_WIDTH*GRID_HEIGHT*2+3 ; +3 bytes for faster dword copying +snake_direction rd 1 +snake_direction_next rd 1 +snake_length_x2 rd 1 + +decorations rd 1 +number_of_free_dots rd 1 + +eat rw 1 -square_side_length rd 1 -space_between_squares rd 1 g_s rd 1 +g_e rd 1 window_width rd 1 window_height rd 1 wp_x rd 1 wp_y rd 1 -gw_mul_gh rd 1 gw_mul_gs rd 1 gh_mul_gs rd 1 gbxm1_plus_gw_mul_gs rd 1 @@ -1049,11 +1674,23 @@ bottom_middle_strings rd 1 bottom_bottom_strings rd 1 top_strings rd 1 -champion_name rb 16 +button_x_left rd 1 +button_x_right rd 1 +button_y_top rd 1 +button_y_middle rd 1 +button_y_bottom rd 1 +button_width_short rd 1 +button_width_long rd 1 +button_height rd 1 + +cursor_data rb 32*32*4 +cursor_handle rd 1 cur_dir_path rb 4096 @PARAMS rb 4096 +field_map rb GRID_WIDTH*GRID_HEIGHT*2 + rb 4096 stacktop: d_end: \ No newline at end of file diff --git a/programs/games/snake/trunk/snake.ini b/programs/games/snake/trunk/snake.ini index 1e8f93aff6..aa520dacee 100644 --- a/programs/games/snake/trunk/snake.ini +++ b/programs/games/snake/trunk/snake.ini @@ -2,13 +2,9 @@ [Preferences] Speed=80 ; SLOW == 0 <= Speed <= 100 == FAST -Square_side_length=19 -; in pixels -; recommended minimum is 8 (strings don't overlap) -; for nice look at low Square_side_length try Theme_ultra_black Theme=Theme_standard ; Theme name to use -; See [Theme_*] below for available themes +; See [Theme_*] sections below for available themes ; Name of any theme must be shorter than 30 chars ;;---Common_preferences------------------------------------------------- @@ -31,13 +27,16 @@ Decorations = 2 Background_color = 0,0,0 Decorations_color = 170,170,0 Snake_color = 17,17,255 -Snake_head_color = 17,17,255 +Snake_head_color = 107,107,255 ; by default Snake_head_color is equal to Snake_color, so the snake has no head Snake_picture_color = 68,136,255 ; color of big 'SNAKE' label at start menu Version_picture_color = 85,255,85 Pause_picture_color = 17,255,17 Game_over_picture_color = 255,17,17 +; ... if you end game without new record +You_win_picture_color = 255,255,17 +; ... if you end game with new record Navigation_string_color = 255,119,119 ; color of 'PRESS * to *' and like this strings Game_over_string_color = 255,153,0 @@ -46,34 +45,60 @@ Game_over_hiscore_color = 255,221,68 ; color of new hiscore and champion name on game_over screen Eat_color = 255,255,17 Score_number_color = 255,255,255 +; color of "SCORE : " string at the left bottom screen part Score_string_color = 255,255,255 +; color of digits after "SCORE : " +Level_string_color = 255,255,255 +; color of "LEVEL : " string at the left bottom screen part +Level_number_color = 255,255,255 +; color of digits after "LEVEL : " Hiscore_number_color = 255,255,255 Hiscore_string_color = 255,255,255 Champion_string_color = 255,255,255 Champion_name_color = 255,255,255 Edit_box_selection_color= 0,176,0 +Button_color = 221,221,221 +; color of buttons 'play', 'exit' etc at start menu +Button_text_color = 0,0,0 +; color of the text on these buttons +Stone_color = 95,135,0 +Splash_background_color = 170,170,0 +; background color for "LEVEL ??" label between levels +Splash_level_string_color= 0,0,0 +; color of "LEVEL" label +Splash_level_number_color= 0,0,0 +; color of two level number digits on splash between levels [Theme_light] Decorations = 2 Background_color = 245,245,245 Decorations_color = 55,55,55 -Snake_color = 215,115,215 -Snake_head_color = 215,115,215 +Snake_color = 225,125,225 +Snake_head_color = 255,125,55 Snake_picture_color = 105,155,205 Version_picture_color = 155,255,0 Pause_picture_color = 75,255,75 Game_over_picture_color = 225,125,105 +You_win_picture_color = 55,255,155 Navigation_string_color = 205,105,105 Game_over_string_color = 205,105,105 -Game_over_hiscore_color = 205,85,85 -Eat_color = 255,255,55 +Game_over_hiscore_color = 205,75,75 +Eat_color = 225,225,25 Score_number_color = 100,100,255 Score_string_color = 100,100,255 +Level_string_color = 100,100,255 +Level_number_color = 100,100,255 Hiscore_number_color = 100,100,255 Hiscore_string_color = 100,100,255 Champion_string_color = 100,100,255 Champion_name_color = 100,100,255 Edit_box_selection_color= 0,176,0 +Button_color = 221,221,221 +Button_text_color = 0,0,0 +Stone_color = 105,185,255 +Splash_background_color = 185,255,185 +Splash_level_string_color= 165,165,255 +Splash_level_number_color= 255,165,165 [Theme_ultra_white] Decorations = 10 @@ -85,17 +110,26 @@ Snake_picture_color = 30,30,30 Version_picture_color = 70,70,70 Pause_picture_color = 30,30,30 Game_over_picture_color = 30,30,30 +You_win_picture_color = 105,105,105 Navigation_string_color = 255,255,255 Game_over_string_color = 30,30,30 Game_over_hiscore_color = 0,0,0 Eat_color = 0,255,0 Score_number_color = 0,0,0 Score_string_color = 255,255,255 +Level_string_color = 255,255,255 +Level_number_color = 255,255,255 Hiscore_number_color = 0,0,0 Hiscore_string_color = 255,255,255 Champion_string_color = 255,255,255 Champion_name_color = 255,255,255 Edit_box_selection_color= 176,176,176 +Button_color = 221,221,221 +Button_text_color = 0,0,0 +Stone_color = 145,145,145 +Splash_background_color = 205,205,205 +Splash_level_string_color= 255,255,255 +Splash_level_number_color= 255,255,255 [Theme_ultra_black] Decorations = 6 @@ -107,25 +141,35 @@ Snake_picture_color = 255,255,255 Version_picture_color = 225,225,225 Pause_picture_color = 225,225,225 Game_over_picture_color = 225,225,225 +You_win_picture_color = 255,255,255 Navigation_string_color = 0,0,0 Game_over_string_color = 225,225,225 Game_over_hiscore_color = 225,225,225 Eat_color = 255,0,0 Score_number_color = 255,255,255 Score_string_color = 255,255,255 +Level_string_color = 0,0,0 +Level_number_color = 0,0,0 Hiscore_number_color = 255,255,255 Hiscore_string_color = 255,255,255 Champion_string_color = 0,0,0 Champion_name_color = 0,0,0 Edit_box_selection_color= 100,100,100 +Button_color = 221,221,221 +Button_text_color = 0,0,0 +Stone_color = 145,145,145 +Splash_background_color = 30,30,30 +Splash_level_string_color= 255,255,255 +Splash_level_number_color= 255,255,255 -[Theme_your_theme_here] +[Theme_your_theme_name] ;;---Visual_themes------------------------------------------------------ -; !!! DON'T WRITE ANYTHING AFTER THIS LINE: 'Score' SECTION IS WRITABLE AND YOU WILL LOST THIS DATA !!! - -;;===Section_of_results================================================= -[Score] -Hiscore=777 -Champion_name= \ No newline at end of file +;;===Reserved_Section=================================================== +[Reserved] +Square_side_length=19 +Champion_name_classic= +Hiscore_classic=777 +Champion_name_levels= +Hiscore_levels=222 \ No newline at end of file