Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c092246a99 | |||
| 9ecd89c51b | |||
| 82c9cca556 | |||
| e2174e7a4a | |||
| 553a0b3887 | |||
| aebe497637 | |||
| f67c7557e9 | |||
| 8e006128c8 |
@@ -1,2 +1,4 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("snake.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "snake")
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
tup.rule("snake.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "snake")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm snake.asm snake
|
||||
@erase lang.inc
|
||||
@pause
|
||||
@@ -9,7 +9,7 @@ First_menu:
|
||||
mov [lives], START_LIVES
|
||||
call Show_cursor
|
||||
|
||||
mov [score], 0
|
||||
mov [numberScore.value], 0
|
||||
call Set_first_level_of_play_mode
|
||||
|
||||
mov ebx, [time_wait_limit_const]
|
||||
@@ -22,19 +22,20 @@ First_menu:
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
jnz @f
|
||||
|
||||
call Draw_decorations
|
||||
call Draw_first_menu_picture
|
||||
call Draw_menu_strings
|
||||
call Draw_buttons
|
||||
call Draw_decorations
|
||||
call Draw_first_menu_picture
|
||||
stdcall draw.Navigation, labelExit, [posLabel.yTop], 0
|
||||
stdcall draw.Navigation, labelStart, [posLabel.yCenter], 0
|
||||
call Draw_buttons
|
||||
@@:
|
||||
mcall 12,2
|
||||
.still:
|
||||
mcall 10 ; wait for event
|
||||
; ok, what an event?
|
||||
dec al ; has the window been moved or resized?
|
||||
jz .redraw ;
|
||||
jz .redraw ;
|
||||
dec al ; was a key pressed?
|
||||
jz .key ;
|
||||
jz .key ;
|
||||
|
||||
|
||||
.button: ; a button was pressed
|
||||
@@ -115,150 +116,26 @@ Draw_first_menu_picture:
|
||||
call Draw_picture
|
||||
|
||||
ret
|
||||
|
||||
|
||||
;;---Draw_first_menu_picture------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_menu_strings:
|
||||
;;===Make_menu_strings======================================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 1
|
||||
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, press_esc_to_exit.size*3+6
|
||||
shl ebx, 16
|
||||
add ebx, [top_strings]
|
||||
mcall , ,[navigation_strings_color],press_esc_to_exit
|
||||
; mcall ,406*65536+TOP_STRINGS,[navigation_strings_color],press_F2_to_options
|
||||
|
||||
ret
|
||||
|
||||
;;---Make_menu_strings------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_buttons:
|
||||
;;===Draw_buttons===========================================================================================================
|
||||
stdcall draw.Button, labelButtonPlay, 0x000000D0, [button_x_left], [button_y_top], [button_width_short], [button_height]
|
||||
stdcall draw.Button, labelButtonExit, 0x000000D1, [button_x_right], [button_y_top], [button_width_short], [button_height]
|
||||
|
||||
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
|
||||
cmp [play_mode], CLASSIC_MODE
|
||||
jne @f
|
||||
mov eax, labelButtonClassic
|
||||
jmp .drawButtonMode
|
||||
@@:
|
||||
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
|
||||
mov eax, labelButtonLevels
|
||||
.drawButtonMode:
|
||||
stdcall draw.Button, eax, 0x000000D2, [button_x_left], [button_y_middle], [button_width_long], [button_height]
|
||||
|
||||
stdcall draw.Button, labelButtonInc, 0x000000D3, [button_x_left], [button_y_bottom], [button_width_short], [button_height]
|
||||
stdcall draw.Button, labelButtonDec, 0x000000D4, [button_x_right], [button_y_bottom], [button_width_short], [button_height]
|
||||
ret
|
||||
|
||||
;;---Draw_buttons----------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -278,33 +155,31 @@ 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
|
||||
xor [play_mode], LEVELS_MODE
|
||||
call Set_first_level_of_play_mode
|
||||
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], CLASSIC_MODE
|
||||
jne @f
|
||||
mov [numberLevel.value], CLASSIC_MODE_FIRST_LEVEL
|
||||
mov eax, [numberHiscore.valueClassic]
|
||||
mov esi, labelChampionName.valueClassic
|
||||
@@:
|
||||
cmp [play_mode], LEVELS_MODE
|
||||
jne @f
|
||||
mov [cur_level_number], LEVELS_MODE_FIRST_LEVEL
|
||||
cmp [play_mode], LEVELS_MODE
|
||||
jne @f
|
||||
mov [numberLevel.value], LEVELS_MODE_FIRST_LEVEL
|
||||
mov eax, [numberHiscore.valueLevels]
|
||||
mov esi, labelChampionName.valueLevels
|
||||
@@:
|
||||
mov [numberHiscore.value], eax
|
||||
mov edi, [labelChampionName.value]
|
||||
mov ecx, CHAMPION_NAME_LENGTH
|
||||
cld
|
||||
rep movsb
|
||||
|
||||
ret
|
||||
|
||||
|
||||
160
programs/games/snake/functions.asm
Normal file
160
programs/games/snake/functions.asm
Normal file
@@ -0,0 +1,160 @@
|
||||
; -----------------------------
|
||||
; Draws a button with a text label
|
||||
; input: pLabel - pointer to the LABEL structure
|
||||
; id - button identifier
|
||||
; xPosition - button position X
|
||||
; yPosition - button position Y
|
||||
; bWidth - button width
|
||||
; bHeight - button height
|
||||
; -----------------------------
|
||||
proc draw.Button pLabel, id, xPosition, yPosition, bWidth, bHeight
|
||||
mcall 8, <[xPosition], [bWidth]>, <[yPosition], [bHeight]>, [id], [button_color]
|
||||
; position X for text positioning
|
||||
mov eax, [bHeight]
|
||||
shr eax, 1
|
||||
add [yPosition], eax
|
||||
; position Y for text positioning
|
||||
mov eax, [pLabel]
|
||||
mov eax, [eax+LABEL.size]
|
||||
neg eax
|
||||
mul [configFont.width]
|
||||
add eax, [bWidth]
|
||||
add eax, 4
|
||||
shr eax, 1
|
||||
add [xPosition], eax
|
||||
; draw text on the button
|
||||
stdcall draw.Label, [pLabel], [xPosition], [yPosition]
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Draws text on position yPosition and centered on the width of the screen
|
||||
; considering the length of the text and the offset in symbols
|
||||
; input: pLabel - pointer to the LABEL structure
|
||||
; yPosition - text position Y
|
||||
; countOffset - number of symbols for offset
|
||||
; -----------------------------
|
||||
proc draw.Navigation pLabel, yPosition, countOffset
|
||||
mov eax, [pLabel]
|
||||
mov eax, [eax + LABEL.size]
|
||||
sub eax, [countOffset]
|
||||
stdcall draw.GetNavigationX, eax
|
||||
stdcall draw.Label, [pLabel], eax, [yPosition], 0
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Draws a number on position yPosition and centered on the width of the screen
|
||||
; considering the length of the number and the offset in symbols
|
||||
; input: pLabel - pointer to the LABEL structure
|
||||
; yPosition - text position Y
|
||||
; countOffset - number of symbols for offset
|
||||
; -----------------------------
|
||||
proc draw.NavigationNumber pLabel, yPosition, countOffset
|
||||
mov eax, [pLabel]
|
||||
mov eax, [eax + LABEL.size]
|
||||
sub eax, [countOffset]
|
||||
stdcall draw.GetNavigationX, eax
|
||||
stdcall draw.Number, [pLabel], eax, [yPosition], 0
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Returns the X coordinate for the text positioning on the center of the screen
|
||||
; considering the offset in symbols
|
||||
; input: countOffset - number of symbols for offset
|
||||
; output: eax - X coordinate
|
||||
; -----------------------------
|
||||
proc draw.GetNavigationX countOffset
|
||||
mov eax, [countOffset]
|
||||
neg eax
|
||||
mul [configFont.width]
|
||||
add eax, [window_width]
|
||||
sub eax, 10
|
||||
shr eax, 1
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Builds the coordinates of the text label adding the offset in symbols along X
|
||||
; input: xPosition - X coordinate
|
||||
; yPosition - Y coordinate
|
||||
; countOffset - number of symbols for offset
|
||||
; output: eax - X coordinate in format X*65536+Y
|
||||
; -----------------------------
|
||||
proc draw._prepareCoord xPosition, yPosition, countOffset
|
||||
mov eax, [countOffset]
|
||||
mul [configFont.width]
|
||||
add eax, [xPosition]
|
||||
shl eax, 16
|
||||
|
||||
mov ebx, [configFont.height]
|
||||
shr ebx, 1
|
||||
sub [yPosition], ebx
|
||||
add eax, [yPosition]
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Draws the text at the X and Y positions and shifts the offset in symbols along X
|
||||
; input: pLabel - pointer to the LABEL structure
|
||||
; xPosition - text position X
|
||||
; yPosition - text position Y
|
||||
; countOffset - number of symbols for offset
|
||||
; -----------------------------
|
||||
proc draw.Label pLabel, xPosition, yPosition, countOffset
|
||||
stdcall draw._prepareCoord, [xPosition], [yPosition], [countOffset]
|
||||
mov ebx, eax
|
||||
mov eax, [pLabel]
|
||||
mov ecx, [configFont.mask]
|
||||
or ecx, [eax + LABEL.color]
|
||||
mov edx, [eax + LABEL.value]
|
||||
mcall 4
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Draws the number at the X and Y positions and shifts the offset in symbols along X
|
||||
; input: pLabel - pointer to the LABEL structure
|
||||
; xPosition - text position X
|
||||
; yPosition - text position Y
|
||||
; countOffset - number of symbols for offset
|
||||
; -----------------------------
|
||||
proc draw.Number pLabel, xPosition, yPosition, countOffset
|
||||
stdcall draw._prepareCoord, [xPosition], [yPosition], [countOffset]
|
||||
mov edx, eax
|
||||
mov eax, [pLabel]
|
||||
mov ebx, [eax + LABEL.size]
|
||||
shl ebx, 16
|
||||
mov ecx, [eax + LABEL.value]
|
||||
mov esi, [configFont.maskNumber]
|
||||
or esi, [eax + LABEL.color]
|
||||
mcall 47, , , , ,[background_color]
|
||||
ret
|
||||
endp
|
||||
; -----------------------------
|
||||
; Set configuration of the font depending on the size of the square side
|
||||
; setting the font size and the font mask text and number
|
||||
; input: squareSideLength - size of the square side
|
||||
; -----------------------------
|
||||
proc draw.setConfigFont squareSideLength
|
||||
cmp [squareSideLength], MIN_SQUARE_SIDE_LENGTH_FONT
|
||||
jg @f
|
||||
cmp [configFont.flag], FONT_SMALL
|
||||
je .return
|
||||
mov [configFont.flag], FONT_SMALL
|
||||
jmp .set
|
||||
@@:
|
||||
cmp [configFont.flag], FONT_LARGE
|
||||
je .return
|
||||
mov [configFont.flag], FONT_LARGE
|
||||
.set:
|
||||
mov eax, [configFont.flag]
|
||||
lea ebx, [eax + 8]
|
||||
shl ebx, 28
|
||||
mov [configFont.mask], ebx
|
||||
lea ebx, [eax*2 + 6]
|
||||
mov [configFont.width], ebx
|
||||
lea ebx, [7 + eax*4]
|
||||
lea ebx, [ebx + eax*2]
|
||||
mov [configFont.height], ebx
|
||||
lea ebx, [eax + 4]
|
||||
shl ebx, 28
|
||||
mov [configFont.maskNumber], ebx
|
||||
.return:
|
||||
ret
|
||||
endp
|
||||
@@ -15,16 +15,16 @@ Game_over:
|
||||
mcall 66,1,0 ; set ascii mode for keyboard
|
||||
call Show_cursor
|
||||
|
||||
mov ebx, [score]
|
||||
|
||||
mov ebx, [numberScore.value]
|
||||
|
||||
cmp [play_mode], CLASSIC_MODE
|
||||
jne @f
|
||||
cmp ebx, [hi_score_classic]
|
||||
cmp ebx, [numberHiscore.valueClassic]
|
||||
jng .redraw
|
||||
mov [is_new_record], 1
|
||||
jmp .done
|
||||
@@:
|
||||
cmp ebx, [hi_score_levels]
|
||||
cmp ebx, [numberHiscore.valueLevels]
|
||||
jng .redraw
|
||||
mov [is_new_record], 1
|
||||
jmp .done
|
||||
@@ -36,7 +36,7 @@ Game_over:
|
||||
call Set_geometry
|
||||
mcall 12,1
|
||||
mcall 0, , ,[window_style], ,window_title
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
jnz @f
|
||||
|
||||
call Draw_decorations
|
||||
@@ -57,7 +57,7 @@ Game_over:
|
||||
|
||||
.mouse: ; mouse event received
|
||||
invoke edit_box.mouse, edit1
|
||||
|
||||
|
||||
jmp .still
|
||||
|
||||
|
||||
@@ -120,51 +120,32 @@ Draw_game_over_picture:
|
||||
|
||||
Draw_game_over_strings:
|
||||
;;===Draw_game_over_strings================================================================================================
|
||||
cmp [is_new_record], 1
|
||||
jnz @f
|
||||
mov eax, [numberScore.value]
|
||||
mov [numberGameOver.value], eax
|
||||
stdcall draw.Navigation, labelCongratulations, [posLabel.yCenter], -numberGameOver.len
|
||||
stdcall draw.NavigationNumber, numberGameOver, [posLabel.yCenter], labelCongratulations.len
|
||||
stdcall draw.Navigation, labelEnterName, [posLabel.yBottom], -numberGameOver.len - 3
|
||||
stdcall draw.GetNavigationX, -labelCongratulations.len+numberGameOver.len
|
||||
mov [edit1.left], eax
|
||||
mov eax, [posLabel.yBottom]
|
||||
sub eax, 3
|
||||
mov ebx, [configFont.height]
|
||||
shr ebx, 1
|
||||
sub eax, ebx
|
||||
mov [edit1.top], eax
|
||||
mov eax, [configFont.mask]
|
||||
or [edit1.text_color], eax
|
||||
invoke edit_box.draw, edit1
|
||||
|
||||
cmp [is_new_record], 1
|
||||
jnz @f
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 1
|
||||
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, 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, 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
|
||||
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
|
||||
add ebx, string_enter_your_name.size*3-6*6-3
|
||||
mov [edit1.left], ebx
|
||||
invoke edit_box.draw, edit1
|
||||
|
||||
stdcall draw.Navigation, labelApply, [posLabel.yTop], 0
|
||||
ret
|
||||
|
||||
@@:
|
||||
|
||||
call Draw_menu_esc
|
||||
|
||||
stdcall draw.Navigation, labelMenu, [posLabel.yTop], 0
|
||||
ret
|
||||
|
||||
;;---Draw_game_over_strings------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Score_and_name_store:
|
||||
;;===Name_store============================================================================================================
|
||||
|
||||
@@ -172,23 +153,23 @@ Score_and_name_store:
|
||||
|
||||
cmp [play_mode], CLASSIC_MODE
|
||||
jne @f
|
||||
mov edi, champion_name_classic
|
||||
mov edi, labelChampionName.valueClassic
|
||||
jmp .done
|
||||
@@:
|
||||
mov edi, champion_name_levels
|
||||
mov edi, labelChampionName.valueLevels
|
||||
.done:
|
||||
|
||||
mov ecx, CHAMPION_NAME_LENGTH
|
||||
rep movsb
|
||||
|
||||
mov eax, [score]
|
||||
|
||||
mov eax, [numberScore.value]
|
||||
|
||||
cmp [play_mode], CLASSIC_MODE
|
||||
jne @f
|
||||
mov [hi_score_classic], eax
|
||||
mov [numberHiscore.valueClassic], eax
|
||||
jmp .done2
|
||||
@@:
|
||||
mov [hi_score_levels], eax
|
||||
mov [numberHiscore.valueLevels], eax
|
||||
.done2:
|
||||
|
||||
ret
|
||||
|
||||
@@ -19,16 +19,16 @@ mcall 26, 9
|
||||
call Set_geometry
|
||||
mcall 12,1
|
||||
mcall 0, , ,[window_style], ,window_title
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
jnz Pause_mode
|
||||
|
||||
|
||||
call Draw_decorations
|
||||
call Draw_stones
|
||||
call Draw_snake
|
||||
call Draw_eat
|
||||
call Draw_level_strings
|
||||
mcall 12,2
|
||||
|
||||
|
||||
.still:
|
||||
mcall 26, 9
|
||||
push eax
|
||||
@@ -40,7 +40,7 @@ mcall 26, 9
|
||||
jne Game_step
|
||||
@@:
|
||||
sub [time_to_wait], eax
|
||||
mcall 23, [time_to_wait] ;
|
||||
mcall 23, [time_to_wait]
|
||||
|
||||
test al, al
|
||||
jnz @f
|
||||
@@ -57,15 +57,15 @@ mcall 26, 9
|
||||
dec al ; has the window been moved or resized?
|
||||
jz .redraw ;
|
||||
dec al ; was a key pressed?
|
||||
jz .key ;
|
||||
jz .key ;
|
||||
dec al ; was a button pressed?
|
||||
jz .button ;
|
||||
jz .button ;
|
||||
|
||||
|
||||
.button: ; ¯à®æ¥¤ãà ®¡à ¡®ª¨ ª®¯®ª ¢ ¯à®£à ¬¬¥
|
||||
mcall 17 ; äãªæ¨ï 17: ¯®«ãç¨âì ®¬¥à ¦ ⮩ ª®¯ª¨
|
||||
.button: ; proccesing buttons
|
||||
mcall 17 ; get button number
|
||||
|
||||
shr eax, 8 ; ᤢ¨£ ¥¬ ॣ¨áâà eax 8 ¡¨â ¢¯à ¢®, çâ®¡ë ¯®«ãç¨âì ®¬¥à ¦ ⮩ ª®¯ª¨
|
||||
shr eax, 8 ; we should do it to get the real button code
|
||||
cmp eax, 1
|
||||
je Save_do_smth_else_and_exit
|
||||
|
||||
@@ -75,14 +75,6 @@ mcall 26, 9
|
||||
.key:
|
||||
mcall 2 ; get keycode
|
||||
|
||||
;pushf
|
||||
;pusha
|
||||
;movzx eax, ah
|
||||
;dph eax
|
||||
;newline
|
||||
;popa
|
||||
;popf
|
||||
|
||||
cmp ah, 0x01 ; Escape
|
||||
je First_menu
|
||||
cmp ah, 0x39 ; Space
|
||||
@@ -144,7 +136,7 @@ mcall 26, 9
|
||||
call Decrease_geometry
|
||||
jmp .redraw
|
||||
@@:
|
||||
|
||||
|
||||
jmp .still ; jump to wait for another event
|
||||
|
||||
|
||||
@@ -162,7 +154,7 @@ mcall 26, 9
|
||||
bts [acceleration_mask], LEFT
|
||||
jc Game_step
|
||||
jmp .still
|
||||
|
||||
|
||||
.key.down:
|
||||
bts [action], 0
|
||||
jc @f
|
||||
@@ -177,7 +169,7 @@ mcall 26, 9
|
||||
bts [acceleration_mask], DOWN
|
||||
jc Game_step
|
||||
jmp .still
|
||||
|
||||
|
||||
.key.up:
|
||||
bts [action], 0
|
||||
jc @f
|
||||
@@ -192,7 +184,7 @@ mcall 26, 9
|
||||
bts [acceleration_mask], UP
|
||||
jc Game_step
|
||||
jmp .still
|
||||
|
||||
|
||||
.key.right:
|
||||
bts [action], 0
|
||||
jc @f
|
||||
@@ -235,17 +227,17 @@ mcall 26, 9
|
||||
cmp [snake_direction], UP ; ... up?
|
||||
jz .up
|
||||
jmp .right ; then right
|
||||
|
||||
|
||||
.left:
|
||||
cmp [snake_direction_next], RIGHT ; next step is to right?
|
||||
jz .with_reverse
|
||||
jmp .without_reverse
|
||||
|
||||
|
||||
.down:
|
||||
cmp [snake_direction_next], UP ; next step is to up?
|
||||
jz .with_reverse
|
||||
jmp .without_reverse
|
||||
|
||||
|
||||
.up:
|
||||
cmp [snake_direction_next], DOWN ; next step is to bottom?
|
||||
jz .with_reverse
|
||||
@@ -260,20 +252,20 @@ mcall 26, 9
|
||||
.with_reverse:
|
||||
call Set_reverse_direction
|
||||
call Reverse
|
||||
|
||||
|
||||
.without_reverse:
|
||||
mov edx, snake_dots-2
|
||||
add edx, [snake_length_x2]
|
||||
|
||||
|
||||
cmp [snake_direction_next], LEFT
|
||||
je .to_left
|
||||
cmp [snake_direction_next], DOWN
|
||||
je .to_down
|
||||
je .to_down
|
||||
cmp [snake_direction_next], UP
|
||||
je .to_up
|
||||
cmp [snake_direction_next], RIGHT
|
||||
je .to_right
|
||||
|
||||
je .to_right
|
||||
|
||||
.to_left:
|
||||
mov [snake_direction], LEFT
|
||||
mov ax, [edx]
|
||||
@@ -294,7 +286,7 @@ mcall 26, 9
|
||||
mov ah, 0
|
||||
@@:
|
||||
jmp Snake_move
|
||||
|
||||
|
||||
.to_up:
|
||||
mov [snake_direction], UP
|
||||
mov ax, [edx]
|
||||
@@ -305,7 +297,7 @@ mcall 26, 9
|
||||
dec ah
|
||||
@@:
|
||||
jmp Snake_move
|
||||
|
||||
|
||||
.to_right:
|
||||
mov [snake_direction], RIGHT
|
||||
mov ax, [edx]
|
||||
@@ -325,7 +317,7 @@ mcall 26, 9
|
||||
|
||||
Draw_snake:
|
||||
;;===Draw_snake========================================================================================================
|
||||
|
||||
|
||||
call Draw_head_prehead
|
||||
mov edx, [snake_color]
|
||||
mov esi, snake_dots-6
|
||||
@@ -339,7 +331,7 @@ Draw_snake:
|
||||
jne @b
|
||||
|
||||
ret
|
||||
|
||||
|
||||
;;---Draw_snake--------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -364,47 +356,26 @@ Draw_head_prehead:
|
||||
|
||||
Draw_level_strings:
|
||||
;;===Draw_level_strings================================================================================================
|
||||
stdcall draw.Navigation, labelPause, [posLabel.yTop], 0
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 1
|
||||
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
|
||||
stdcall draw.Label, labelScore, [posLabel.xLeft], [posLabel.yCenter], 3
|
||||
stdcall draw.Number, numberScore, [posLabel.xLeft], [posLabel.yCenter], labelScore.len+3
|
||||
|
||||
; call Draw_menu_esc
|
||||
call Draw_score_string
|
||||
call Draw_score_number ; Draw score (number)
|
||||
call Draw_champion_string
|
||||
call Draw_champion_name
|
||||
call Draw_hiscore_string
|
||||
call Draw_hiscore_number
|
||||
stdcall draw.Label, labelChampion, [posLabel.xRight], [posLabel.yBottom], -labelChampion.len-numberHiscore.len-3
|
||||
stdcall draw.Label, labelChampionName, [posLabel.xRight], [posLabel.yBottom], -numberHiscore.len-3
|
||||
|
||||
cmp [play_mode], LEVELS_MODE
|
||||
jne @f
|
||||
stdcall draw.Label, labelHiscore, [posLabel.xRight], [posLabel.yCenter], -labelHiscore.len-numberHiscore.len-3
|
||||
stdcall draw.Number, numberHiscore, [posLabel.xRight], [posLabel.yCenter], -numberHiscore.len-3
|
||||
|
||||
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]
|
||||
cmp [play_mode], LEVELS_MODE
|
||||
jne @f
|
||||
|
||||
stdcall draw.Label, labelLevel, [posLabel.xLeft], [posLabel.yBottom], 3
|
||||
stdcall draw.Number, numberLevel, [posLabel.xLeft], [posLabel.yBottom], labelLevel.len+3
|
||||
@@:
|
||||
|
||||
ret
|
||||
|
||||
;;---Draw_level_strings------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reverse:
|
||||
;;===Reverse===========================================================================================================
|
||||
|
||||
@@ -427,18 +398,18 @@ Reverse:
|
||||
ret
|
||||
|
||||
;;---Reverse-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
Draw_eat:
|
||||
;;===Draw_eat==========================================================================================================
|
||||
|
||||
|
||||
mov bx, word[eat]
|
||||
mov edx, [eat_color]
|
||||
|
||||
|
||||
call Draw_square
|
||||
|
||||
|
||||
ret
|
||||
|
||||
|
||||
;;---Draw_eat----------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -451,7 +422,6 @@ Get_eat:
|
||||
;;
|
||||
|
||||
mcall 26,9
|
||||
; xor eax, esp
|
||||
shl eax, 1
|
||||
xor edx, edx
|
||||
div word[number_of_free_dots]
|
||||
@@ -466,14 +436,14 @@ Get_eat:
|
||||
@@:
|
||||
inc ebx
|
||||
jmp .loop
|
||||
|
||||
|
||||
.place_found:
|
||||
sub ebx, field_map
|
||||
mov eax, ebx
|
||||
mov bl, GRID_WIDTH
|
||||
div bl
|
||||
xchg al, ah
|
||||
|
||||
|
||||
mov word[eat], ax
|
||||
|
||||
ret
|
||||
@@ -488,7 +458,7 @@ Sdvig:
|
||||
mov edi, snake_dots
|
||||
mov ecx, [snake_length_x2]
|
||||
shr ecx, 1
|
||||
|
||||
|
||||
cld
|
||||
rep movsw
|
||||
|
||||
@@ -508,17 +478,17 @@ Set_reverse_direction:
|
||||
|
||||
cmp cl, ch
|
||||
je .X_ravny
|
||||
|
||||
|
||||
cmp cl, 0
|
||||
jne .skip2
|
||||
|
||||
|
||||
mov dl, GRID_WIDTH
|
||||
dec dl
|
||||
cmp ch, dl
|
||||
jne .Normal_y_ravny
|
||||
mov [snake_direction_next], RIGHT
|
||||
ret
|
||||
|
||||
|
||||
.skip2:
|
||||
mov dl, GRID_WIDTH
|
||||
dec dl
|
||||
@@ -528,7 +498,7 @@ Set_reverse_direction:
|
||||
jne .Normal_y_ravny
|
||||
mov [snake_direction_next], LEFT
|
||||
ret
|
||||
|
||||
|
||||
.Normal_y_ravny:
|
||||
|
||||
cmp cl, ch
|
||||
@@ -545,17 +515,17 @@ Set_reverse_direction:
|
||||
inc ebx
|
||||
mov cl, [eax]
|
||||
mov ch, [ebx]
|
||||
|
||||
|
||||
cmp cl, 0
|
||||
jne .skip3
|
||||
|
||||
|
||||
mov dl, GRID_HEIGHT
|
||||
dec dl
|
||||
cmp ch, dl
|
||||
jne .Normal_x_ravny
|
||||
mov [snake_direction_next], DOWN
|
||||
ret
|
||||
|
||||
|
||||
.skip3:
|
||||
mov dl, GRID_HEIGHT
|
||||
dec dl
|
||||
@@ -565,7 +535,7 @@ Set_reverse_direction:
|
||||
jne .Normal_x_ravny
|
||||
mov [snake_direction_next], UP
|
||||
ret
|
||||
|
||||
|
||||
.Normal_x_ravny:
|
||||
|
||||
cmp cl, ch ; !!!
|
||||
@@ -579,8 +549,8 @@ Set_reverse_direction:
|
||||
ret
|
||||
|
||||
;;---Set_reverse_direction--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
Snake_move:
|
||||
;;===Snake_move=============================================================================================================
|
||||
;; in :
|
||||
@@ -594,7 +564,7 @@ Snake_move:
|
||||
jne .eat_and_new_head_are_different
|
||||
|
||||
add [snake_length_x2], 2
|
||||
add [score], SCORE_EAT
|
||||
add [numberScore.value], SCORE_EAT
|
||||
dec [number_of_free_dots]
|
||||
cmp [number_of_free_dots], 0
|
||||
je Game_over
|
||||
@@ -631,7 +601,7 @@ Snake_move:
|
||||
.eat_and_new_head_are_different:
|
||||
|
||||
push ax
|
||||
|
||||
|
||||
mov ax, word[snake_dots]
|
||||
mov cl, 0
|
||||
call Draw_on_map
|
||||
@@ -645,22 +615,22 @@ Snake_move:
|
||||
|
||||
mov cl, 1
|
||||
call Draw_on_map
|
||||
|
||||
|
||||
mov bx, word[snake_dots]
|
||||
mov edx, [background_color]
|
||||
call Draw_square
|
||||
|
||||
|
||||
call Sdvig
|
||||
|
||||
|
||||
call Draw_head_prehead
|
||||
|
||||
|
||||
Keys_done:
|
||||
|
||||
cmp [score], 0
|
||||
cmp [numberScore.value], 0
|
||||
je @f
|
||||
dec [score]
|
||||
call Draw_score_number
|
||||
dec [numberScore.value]
|
||||
stdcall draw.Number, numberScore, [posLabel.xLeft], [posLabel.yCenter], labelScore.len+3
|
||||
@@:
|
||||
|
||||
cmp [play_mode], LEVELS_MODE
|
||||
@@ -681,10 +651,10 @@ Snake_move:
|
||||
Do_smth_between_levels:
|
||||
;;===Do_smth_between_levels================================================================================================
|
||||
|
||||
inc [cur_level_number]
|
||||
cmp [cur_level_number], LAST_LEVEL_NUMBER+1
|
||||
inc [numberLevel.value]
|
||||
cmp [numberLevel.value], LAST_LEVEL_NUMBER+1
|
||||
jne @f
|
||||
mov [cur_level_number], LEVELS_MODE_FIRST_LEVEL
|
||||
mov [numberLevel.value], LEVELS_MODE_FIRST_LEVEL
|
||||
@@:
|
||||
|
||||
call Draw_splash
|
||||
@@ -714,9 +684,9 @@ Draw_splash:
|
||||
sub bh, 2
|
||||
cmp bh, 0
|
||||
jg @b
|
||||
|
||||
|
||||
inc al
|
||||
|
||||
|
||||
mov bh, GRID_HEIGHT-2
|
||||
mov bl, cl
|
||||
@@:
|
||||
@@ -753,11 +723,11 @@ Draw_splash:
|
||||
mov esi, picture_level
|
||||
call Draw_picture
|
||||
|
||||
mov eax, [cur_level_number]
|
||||
mov eax, [numberLevel.value]
|
||||
mov dl, 10
|
||||
div dl
|
||||
push ax
|
||||
|
||||
|
||||
mov esi, digits_font
|
||||
@@:
|
||||
test al, al
|
||||
@@ -766,12 +736,12 @@ Draw_splash:
|
||||
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
|
||||
@@:
|
||||
@@ -844,5 +814,4 @@ Draw_lives_in_head:
|
||||
|
||||
;;---Draw_lives_in_head----------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
;;---Some_functions------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
snake : snake.asm first_menu.asm level.asm pause.asm game_over.asm
|
||||
fasm snake.asm snake
|
||||
@@ -17,7 +17,8 @@ Pause_mode:
|
||||
|
||||
call Draw_decorations
|
||||
call Draw_pause_picture
|
||||
call Draw_pause_strings
|
||||
stdcall draw.Navigation, labelMenu, [posLabel.yTop], 0
|
||||
stdcall draw.Navigation, labelResume, [posLabel.yCenter], 0
|
||||
mcall 12,2
|
||||
@@:
|
||||
.still:
|
||||
@@ -41,7 +42,7 @@ Pause_mode:
|
||||
|
||||
.key: ; a key was pressed
|
||||
mcall 2 ; get keycode
|
||||
|
||||
|
||||
cmp ah, 0x01 ; Escape - go to menu
|
||||
je First_menu
|
||||
cmp ah, 0x39 ; Space - resume game
|
||||
@@ -56,7 +57,7 @@ Pause_mode:
|
||||
call Decrease_geometry
|
||||
jmp .redraw
|
||||
@@:
|
||||
|
||||
|
||||
jmp .still
|
||||
|
||||
;;---Pause_mode----------------------------------------------------------------------------------------------------------------
|
||||
@@ -74,25 +75,7 @@ Draw_pause_picture:
|
||||
call Draw_picture
|
||||
|
||||
ret
|
||||
|
||||
|
||||
;;---Draw_pause_picture--------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_pause_strings:
|
||||
;;===Draw_pause_strings================================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 1
|
||||
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
|
||||
|
||||
call Draw_menu_esc ; Show 'MENU - ESC' string
|
||||
|
||||
|
||||
ret
|
||||
|
||||
;;---Draw_pause_strings------------------------------------------------------------------------------------------------
|
||||
|
||||
;;---Some_functions------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -11,7 +11,7 @@ include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
;include '../../system/board/trunk/debug.inc'
|
||||
include '../../encoding.inc'
|
||||
|
||||
;;===Define_chapter============================================================================================================
|
||||
|
||||
@@ -21,7 +21,16 @@ WINDOW_MODE_FULLSCREEN equ 1
|
||||
GRID_WIDTH equ 28
|
||||
GRID_HEIGHT equ 14
|
||||
|
||||
MIN_SQUARE_SIDE_LENGTH equ 9
|
||||
MIN_SQUARE_SIDE_LENGTH equ 10
|
||||
MIN_SQUARE_SIDE_LENGTH_FONT equ 20
|
||||
FONT_SMALL equ 0
|
||||
FONT_LARGE equ 1
|
||||
DEFAULT_NAVIGATION_COLOR equ 0xff7777
|
||||
DEFAULT_LABEL_COLOR equ 0xffffff
|
||||
DEFAULT_LABEL_END_COLOR equ 0xff9900
|
||||
DEFAULT_NUMBER_END_COLOR equ 0xffdd44
|
||||
DEFAULT_HISCORE equ 777
|
||||
DEFAULT_BUTTON_TEXT_COLOR equ 0x000000
|
||||
|
||||
SCORE_EAT equ 100
|
||||
|
||||
@@ -53,7 +62,11 @@ CHAMPION_NAME_LENGTH equ 15
|
||||
LAST_LEVEL_NUMBER equ 36
|
||||
|
||||
START_LIVES equ 3
|
||||
|
||||
struct LABEL
|
||||
color dd ?
|
||||
size dd ?
|
||||
value dd ?
|
||||
ends
|
||||
;;---Define_chapter------------------------------------------------------------------------------------------------------------
|
||||
|
||||
start:
|
||||
@@ -61,7 +74,7 @@ start:
|
||||
stdcall dll.Load,@IMPORT
|
||||
or eax, eax
|
||||
jnz Exit
|
||||
|
||||
|
||||
align 4
|
||||
|
||||
mov edi, cur_dir_path
|
||||
@@ -129,34 +142,58 @@ align 4
|
||||
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
|
||||
or [navigation_strings_color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_strings_color, 0x80ff9900
|
||||
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
|
||||
or [champion_string_color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_hiscore_color, 0x80ffdd44
|
||||
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.shift_color], eax
|
||||
; ini navigation color
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelNavigation, DEFAULT_NAVIGATION_COLOR
|
||||
mov [labelMenu.color], eax
|
||||
mov [labelExit.color], eax
|
||||
mov [labelStart.color], eax
|
||||
mov [labelPause.color], eax
|
||||
mov [labelApply.color], eax
|
||||
mov [labelResume.color], eax
|
||||
; ini color score
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelScore, DEFAULT_LABEL_COLOR
|
||||
mov [labelScore.color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.numberScore, DEFAULT_LABEL_COLOR
|
||||
mov [numberScore.color], eax
|
||||
; ini color hiscore
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelHiscore, DEFAULT_LABEL_COLOR
|
||||
mov [labelHiscore.color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.numberHiscore, DEFAULT_LABEL_COLOR
|
||||
mov [numberHiscore.color], eax
|
||||
; ini color champion
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelChampion, DEFAULT_LABEL_COLOR
|
||||
mov [labelChampion.color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelChampionName, DEFAULT_LABEL_COLOR
|
||||
mov [labelChampionName.color], eax
|
||||
; ini color level
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelLevel, DEFAULT_LABEL_COLOR
|
||||
mov [labelLevel.color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.numberLevel, DEFAULT_LABEL_COLOR
|
||||
mov [numberLevel.color], eax
|
||||
; ini color game over
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.labelGameOver, DEFAULT_LABEL_END_COLOR
|
||||
mov [labelCongratulations.color], eax
|
||||
mov [labelEnterName.color], eax
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, configColor.numberGameOver, DEFAULT_NUMBER_END_COLOR
|
||||
mov [numberGameOver.color], eax
|
||||
mov [edit1.text_color], eax
|
||||
; ini color edit box
|
||||
invoke ini.get_color, cur_dir_path, aTheme_name, aEdit_box_selection_color, 0x00aa00
|
||||
mov [edit1.shift_color], eax
|
||||
mov eax, [background_color]
|
||||
mov [edit1.color], eax
|
||||
mov [edit1.focus_border_color], eax
|
||||
mov [edit1.blur_border_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, configColor.buttonText, DEFAULT_BUTTON_TEXT_COLOR
|
||||
mov [labelButtonPlay.color], eax
|
||||
mov [labelButtonExit.color], eax
|
||||
mov [labelButtonClassic.color], eax
|
||||
mov [labelButtonLevels.color], eax
|
||||
mov [labelButtonInc.color], eax
|
||||
mov [labelButtonDec.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
|
||||
@@ -166,21 +203,14 @@ align 4
|
||||
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.color], eax
|
||||
mov [edit1.focus_border_color], eax
|
||||
mov [edit1.blur_border_color], eax
|
||||
mov eax, [game_over_hiscore_color]
|
||||
mov [edit1.text_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, config.championNameClassic, labelChampionName.valueClassic, CHAMPION_NAME_LENGTH+1, labelChampionName.valueClassic
|
||||
invoke ini.get_str, cur_dir_path, aReserved, config.championNameLevels, labelChampionName.valueLevels, CHAMPION_NAME_LENGTH+1, labelChampionName.valueLevels
|
||||
invoke ini.get_int, cur_dir_path, aReserved, config.hiscoreClassic, DEFAULT_HISCORE
|
||||
mov [numberHiscore.valueClassic], eax
|
||||
invoke ini.get_int, cur_dir_path, aReserved, config.hiscoreLevels, DEFAULT_HISCORE
|
||||
mov [numberHiscore.valueLevels], eax
|
||||
|
||||
mcall 37,4,cursor_data,2 ; load empty cursor (for "hiding" cursor while level_mode)
|
||||
mov [cursor_handle], eax
|
||||
@@ -195,7 +225,7 @@ include 'first_menu.asm' ; First menu body and functions
|
||||
include 'level.asm' ; Level body and functions (game process)
|
||||
include 'pause.asm' ; Pause body and functions
|
||||
include 'game_over.asm' ; Game_over body and functions
|
||||
|
||||
include 'functions.asm'
|
||||
;;===Some_functions============================================================================================================
|
||||
|
||||
|
||||
@@ -206,25 +236,25 @@ Save_do_smth_else_and_exit:
|
||||
|
||||
invoke ini.set_int, cur_dir_path, aReserved, aSquare_side_length, [square_side_length]
|
||||
|
||||
mov edi, champion_name_classic
|
||||
mov edi, labelChampionName.valueClassic
|
||||
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]
|
||||
invoke ini.set_str, cur_dir_path, aReserved, config.championNameClassic, labelChampionName.valueClassic, ecx
|
||||
invoke ini.set_int, cur_dir_path, aReserved, config.hiscoreClassic, [numberHiscore.valueClassic]
|
||||
|
||||
mov edi, champion_name_levels
|
||||
mov edi, labelChampionName.valueLevels
|
||||
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]
|
||||
invoke ini.set_str, cur_dir_path, aReserved, config.championNameLevels, labelChampionName.valueLevels, ecx
|
||||
invoke ini.set_int, cur_dir_path, aReserved, config.hiscoreLevels, [numberHiscore.valueLevels]
|
||||
|
||||
;;---Save_do_smth_else_and_exit--------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -234,7 +264,7 @@ Exit:
|
||||
|
||||
or eax, -1
|
||||
int 0x40
|
||||
|
||||
|
||||
;;---Exit------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -248,7 +278,7 @@ Set_geometry:
|
||||
jnz .by_hotkey
|
||||
|
||||
mcall 9,proc_info,-1
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
jz @f
|
||||
mov eax, [proc_info.box.width]
|
||||
mov [window_width], eax
|
||||
@@ -269,11 +299,11 @@ Set_geometry:
|
||||
mov eax, [proc_info.box.height]
|
||||
mov [window_height], eax
|
||||
|
||||
.by_mouse: ; or any other kind of resizing. for example, double click on window title
|
||||
.by_mouse: ; or any other kind of resizing. for example, double click on window title
|
||||
|
||||
test [proc_info.wnd_state], 0x01
|
||||
jnz .by_hotkey
|
||||
|
||||
|
||||
|
||||
cmp [window_width], 250
|
||||
jnl @f
|
||||
@@ -330,12 +360,10 @@ Set_geometry:
|
||||
mov byte[square_side_length], al
|
||||
jmp .by_hotkey
|
||||
|
||||
; jmp .done
|
||||
|
||||
.by_hotkey:
|
||||
mcall 9,proc_info,-1
|
||||
mov [resized_by_hotkey], 0
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
||||
jz @f
|
||||
mov eax, [proc_info.box.width]
|
||||
mov [window_width], eax
|
||||
@@ -344,8 +372,10 @@ Set_geometry:
|
||||
jmp .quit
|
||||
@@:
|
||||
mov eax, [square_side_length]
|
||||
inc eax ; space between squares
|
||||
inc eax ; space between squares
|
||||
|
||||
mov [g_s], eax
|
||||
stdcall draw.setConfigFont, eax
|
||||
|
||||
mov eax, [g_s]
|
||||
shr eax, 1
|
||||
@@ -401,7 +431,7 @@ Set_geometry:
|
||||
sub eax, ebx
|
||||
sub eax, 5
|
||||
sub eax, 5
|
||||
|
||||
|
||||
shr eax, 1
|
||||
mov [gbym1], eax
|
||||
|
||||
@@ -456,19 +486,24 @@ Set_geometry:
|
||||
shr cx, 1
|
||||
add cx, dx
|
||||
mov word[wp_y], cx
|
||||
|
||||
mov [top_strings], 8
|
||||
mov eax, [window_height]
|
||||
sub eax, 50
|
||||
mov [bottom_top_strings], eax
|
||||
add eax, 6
|
||||
mov [bottom_middle_strings], eax
|
||||
add eax, 6
|
||||
mov [bottom_bottom_strings], eax
|
||||
|
||||
sub eax, 4
|
||||
mov [edit1.top], eax
|
||||
|
||||
; fixing the positions for the labels
|
||||
; Y position
|
||||
mov ebx, 13 ; margin from grid borders
|
||||
mov eax, [gbym1]
|
||||
sub eax, ebx
|
||||
mov [posLabel.yTop], eax
|
||||
mov eax, [gbym1_plus_gh_mul_gs]
|
||||
add eax, ebx
|
||||
mov [posLabel.yCenter], eax
|
||||
add eax, ebx
|
||||
shr ebx, 1
|
||||
add eax, ebx
|
||||
mov [posLabel.yBottom], eax
|
||||
; X position
|
||||
mov eax, [gbxm1]
|
||||
mov [posLabel.xLeft], eax
|
||||
mov eax, [gbxm1_plus_gw_mul_gs]
|
||||
mov [posLabel.xRight], eax
|
||||
|
||||
mov eax, [g_s]
|
||||
shl eax, 2
|
||||
@@ -497,26 +532,26 @@ Set_geometry:
|
||||
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
|
||||
|
||||
.done:
|
||||
@@ -541,15 +576,12 @@ Increase_geometry:
|
||||
|
||||
Decrease_geometry:
|
||||
;;===Decrease_geometry=================================================================================================
|
||||
|
||||
cmp [square_side_length], MIN_SQUARE_SIDE_LENGTH
|
||||
je @f
|
||||
je @f
|
||||
dec [square_side_length]
|
||||
mov [resized_by_hotkey], 1
|
||||
|
||||
@@:
|
||||
ret
|
||||
|
||||
;;---Decrease_geometry-------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -585,9 +617,7 @@ Draw_decorations:
|
||||
grid_lines:
|
||||
|
||||
mov eax, 38
|
||||
;mov ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1)
|
||||
mov ebx, [gbxm1_shl16_gbxm1]
|
||||
;mov ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
|
||||
mov ecx, [gbym1_shl16_gbym1]
|
||||
add ecx, [gh_mul_gs]
|
||||
mov edx, [decorations_color]
|
||||
@@ -600,13 +630,12 @@ Draw_decorations:
|
||||
dec esi
|
||||
jnz @b
|
||||
|
||||
;mov ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
|
||||
mov ebx, [gbxm1_shl16_gbxm1]
|
||||
add ebx, [gw_mul_gs]
|
||||
mov ecx, [gbym1_shl16_gbym1]
|
||||
mov esi, GRID_HEIGHT
|
||||
add esi, 1
|
||||
|
||||
|
||||
@@:
|
||||
mcall
|
||||
add ecx, [gs_shl16_gs]
|
||||
@@ -643,7 +672,7 @@ Draw_decorations:
|
||||
mov ecx, [gbym1_shl16_gbym1]
|
||||
mov esi, GRID_HEIGHT
|
||||
add esi, 1
|
||||
|
||||
|
||||
@@:
|
||||
mcall
|
||||
add ecx, [gs_shl16_gs]
|
||||
@@ -929,140 +958,6 @@ Draw_square:
|
||||
ret
|
||||
|
||||
;;---Draw_square-------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_menu_esc:
|
||||
;;===Draw_menu_esc=====================================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 1
|
||||
sub ebx, string_menu_esc.size*3+6
|
||||
shl ebx, 16
|
||||
add ebx, dword[top_strings]
|
||||
mcall 4, ,[navigation_strings_color],string_menu_esc
|
||||
|
||||
ret
|
||||
|
||||
;;---Draw_menu_esc-----------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_score_string:
|
||||
;;===Draw_score_string=================================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 3
|
||||
sub ebx, 5
|
||||
shl ebx, 16
|
||||
add ebx, dword[bottom_top_strings]
|
||||
mcall 4, ,[score_string_color],string_score
|
||||
|
||||
ret
|
||||
|
||||
;;---Draw_score_string-------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_score_number:
|
||||
;;===Draw_score_number=================================================================================================
|
||||
|
||||
mov edx, [window_width]
|
||||
shr edx, 3
|
||||
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-------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_hiscore_string:
|
||||
;;===Draw_hiscore_string===============================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 3
|
||||
neg ebx
|
||||
add ebx, [window_width]
|
||||
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
|
||||
|
||||
ret
|
||||
|
||||
;;---Draw_hiscore_string-----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_hiscore_number:
|
||||
;;===Draw_hiscore_number===================================================================================================
|
||||
|
||||
mov edx, [window_width]
|
||||
shr edx, 3
|
||||
neg edx
|
||||
add edx, [window_width]
|
||||
sub edx, 7*6+6
|
||||
shl edx, 16
|
||||
add edx, dword[bottom_top_strings]
|
||||
|
||||
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_champion_string:
|
||||
;;===Draw_champion_string==================================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 3
|
||||
neg ebx
|
||||
add ebx, [window_width]
|
||||
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
|
||||
|
||||
ret
|
||||
|
||||
;;---Draw_champion_string----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_champion_name:
|
||||
;;===Draw_champion_name================================================================================================
|
||||
|
||||
mov ebx, [window_width]
|
||||
shr ebx, 3
|
||||
neg ebx
|
||||
add ebx, [window_width]
|
||||
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]
|
||||
|
||||
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
|
||||
|
||||
;;---Draw_champion_name------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Draw_picture:
|
||||
;;===Draw_picture======================================================================================================
|
||||
@@ -1080,14 +975,14 @@ Draw_picture:
|
||||
.draw:
|
||||
mov bl, ah
|
||||
mov di, 7
|
||||
|
||||
|
||||
.loop:
|
||||
bt word[esi], di
|
||||
jnc @f
|
||||
push eax ebx ecx esi edi
|
||||
call Draw_square
|
||||
pop edi esi ecx ebx eax
|
||||
|
||||
|
||||
@@:
|
||||
dec di
|
||||
jns @f
|
||||
@@ -1097,7 +992,7 @@ Draw_picture:
|
||||
inc bl
|
||||
cmp bl, al
|
||||
jne .loop
|
||||
|
||||
|
||||
inc bh
|
||||
cmp di, 7
|
||||
jz @f
|
||||
@@ -1145,7 +1040,7 @@ Get_from_map:
|
||||
;;
|
||||
|
||||
push eax
|
||||
|
||||
|
||||
and eax, 0x0000ffff
|
||||
xor bx, bx
|
||||
mov bl, al
|
||||
@@ -1170,7 +1065,7 @@ Load_level:
|
||||
;; cur_level_number = level number to load
|
||||
;;
|
||||
|
||||
mov eax, [cur_level_number]
|
||||
mov eax, [numberLevel.value]
|
||||
mov edx, stage_00
|
||||
@@:
|
||||
test al, al
|
||||
@@ -1253,12 +1148,12 @@ Load_level:
|
||||
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]
|
||||
@@ -1269,7 +1164,7 @@ Load_level:
|
||||
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
|
||||
@@ -1370,7 +1265,6 @@ Reverse_snake:
|
||||
|
||||
;;---Reverse_snake---------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
;;===Variables==================================================================================================================
|
||||
|
||||
window_title db 'Snake',64+15 dup (0)
|
||||
@@ -1388,29 +1282,6 @@ lives dd START_LIVES
|
||||
acceleration_mask dd 0x0
|
||||
|
||||
resized_by_hotkey dd 0x0
|
||||
fullscreen dd 0x0
|
||||
|
||||
szZ string_score ,'SCORE : '
|
||||
szZ string_hi_score ,'HI-SCORE : '
|
||||
szZ string_champion ,'CHAMPION : '
|
||||
szZ string_level ,'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
|
||||
|
||||
szZ string_congratulations ,' Congratulations!!! New hi-score is : '
|
||||
szZ string_enter_your_name ,'You are the champion! Enter your name : '
|
||||
|
||||
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'
|
||||
|
||||
is_new_record dd 0
|
||||
|
||||
@@ -1449,19 +1320,6 @@ picture_game_over db 00110000b,00000000b,00000000b,00000000b,\
|
||||
00001000b,10010100b,10000111b,10000000b,\
|
||||
00000111b,00001000b,11110100b,01000000b
|
||||
|
||||
;picture_you_win db 10001001b,11001000b,10000000b,\
|
||||
; 10001010b,00101000b,10000000b,\
|
||||
; 01010010b,00101000b,10000000b,\
|
||||
; 00100010b,00101000b,10000000b,\
|
||||
; 00100001b,11000111b,00000000b,\
|
||||
; 00000000b,00000000b,00000000b,\
|
||||
; 00000000b,00000000b,00000000b,\
|
||||
; 01000100b,10010001b,00000000b,\
|
||||
; 01010100b,10011001b,00000000b,\
|
||||
; 01010100b,10010101b,00000000b,\
|
||||
; 01010100b,10010011b,00000000b,\
|
||||
; 00101000b,10010001b,00000000b
|
||||
|
||||
picture_you_win db 01000100b,01000011b,10001000b,10000000b,\
|
||||
01000100b,01000100b,01001000b,10000000b,\
|
||||
01000100b,01000100b,00001000b,10000000b,\
|
||||
@@ -2357,23 +2215,11 @@ 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
|
||||
score_string_color dd 0x80000000
|
||||
hiscore_string_color dd 0x80000000
|
||||
champion_string_color dd 0x80000000
|
||||
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
|
||||
@@ -2396,8 +2242,6 @@ import box_lib,\
|
||||
edit_box.key , 'edit_box_key' ,\
|
||||
edit_box.mouse , 'edit_box_mouse'
|
||||
|
||||
bFirstDraw db 0
|
||||
|
||||
aPreferences db 'Preferences',0
|
||||
aSpeed db 'Speed',0
|
||||
aTheme db 'Theme',0
|
||||
@@ -2428,53 +2272,140 @@ 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
|
||||
aScore_string_color db 'Score_string_color',0
|
||||
aHiscore_string_color db 'Hiscore_string_color',0
|
||||
aChampion_string_color db 'Champion_string_color',0
|
||||
aGame_over_hiscore_color db 'Game_over_hiscore_color',0
|
||||
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
|
||||
|
||||
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
|
||||
config:
|
||||
.championNameClassic db 'Champion_name_classic',0
|
||||
.championNameLevels db 'Champion_name_levels',0
|
||||
.hiscoreClassic db 'Hiscore_classic',0
|
||||
.hiscoreLevels db 'Hiscore_levels',0
|
||||
|
||||
configFont:
|
||||
.flag dd 0
|
||||
.width dd 6
|
||||
.height dd 7
|
||||
.mask dd 0x80000000
|
||||
.maskNumber dd 0x40000000
|
||||
|
||||
configColor:
|
||||
.labelNavigation db 'Navigation_string_color',0
|
||||
.labelScore db 'Score_string_color',0
|
||||
.numberScore db 'Score_number_color',0
|
||||
.labelLevel db 'Level_string_color',0
|
||||
.numberLevel db 'Level_number_color',0
|
||||
.labelHiscore db 'Hiscore_string_color',0
|
||||
.numberHiscore db 'Hiscore_number_color',0
|
||||
.labelChampion db 'Champion_string_color',0
|
||||
.labelChampionName db 'Champion_name_color',0
|
||||
.labelGameOver db 'Game_over_string_color',0
|
||||
.numberGameOver db 'Game_over_hiscore_color',0
|
||||
.buttonText db 'Button_text_color',0
|
||||
|
||||
macro defLabel name, color, [text]
|
||||
{
|
||||
common
|
||||
local ..str
|
||||
if lang eq ru_RU
|
||||
..str cp866 text, 0
|
||||
else if lang eq ru_RU
|
||||
..str cp850 text, 0
|
||||
else
|
||||
..str db text, 0
|
||||
end if
|
||||
name#.len = $ - ..str - 1
|
||||
name LABEL color, name#.len, ..str
|
||||
}
|
||||
macro defNumber name, color, size
|
||||
{
|
||||
common
|
||||
name#.len = size
|
||||
name LABEL color, name#.len, 0
|
||||
}
|
||||
|
||||
if lang eq ru_RU
|
||||
defLabel labelButtonPlay , DEFAULT_BUTTON_TEXT_COLOR, 'ИГРАТЬ'
|
||||
defLabel labelButtonExit , DEFAULT_BUTTON_TEXT_COLOR, 'ВЫХОД'
|
||||
defLabel labelButtonClassic, DEFAULT_BUTTON_TEXT_COLOR, 'режим КЛАССИЧЕСКИЙ'
|
||||
defLabel labelButtonLevels , DEFAULT_BUTTON_TEXT_COLOR, 'режим УРОВНЕЙ'
|
||||
defLabel labelButtonInc , DEFAULT_BUTTON_TEXT_COLOR, 'УВЕЛИЧИТЬ'
|
||||
defLabel labelButtonDec , DEFAULT_BUTTON_TEXT_COLOR, 'УМЕНЬШИТЬ'
|
||||
|
||||
defLabel labelScore , DEFAULT_LABEL_COLOR, 'СЧЕТ : '
|
||||
defLabel labelLevel , DEFAULT_LABEL_COLOR, 'УРОВЕНЬ : '
|
||||
defLabel labelHiscore , DEFAULT_LABEL_COLOR, 'ЛУЧШИЙ СЧЕТ : '
|
||||
defLabel labelChampion, DEFAULT_LABEL_COLOR, 'ЧЕМПИОН : '
|
||||
|
||||
defLabel labelMenu , DEFAULT_NAVIGATION_COLOR, 'НАЖМИТЕ ',0x27,'ESC',0x27,' ДЛЯ ВЫХОДА В МЕНЮ'
|
||||
defLabel labelExit , DEFAULT_NAVIGATION_COLOR, 'НАЖМИТЕ ',0x27,'ESC',0x27,' ДЛЯ ВЫХОДА ИЗ ИГРЫ'
|
||||
defLabel labelStart , DEFAULT_NAVIGATION_COLOR, 'НАЖМИТЕ ',0x27,'ENTER',0x27,' ЧТОБЫ НАЧАТЬ'
|
||||
defLabel labelPause , DEFAULT_NAVIGATION_COLOR, 'НАЖМИТЕ ',0x27,'SPACE',0x27, ' ДЛЯ ПАУЗЫ'
|
||||
defLabel labelApply , DEFAULT_NAVIGATION_COLOR, 'ВВЕДИТЕ ИМЯ И НАЖМИТЕ ',0x27,'ENTER',0x27
|
||||
defLabel labelResume, DEFAULT_NAVIGATION_COLOR, 'НАЖМИТЕ ',0x27,'SPACE',0x27, ' ДЛЯ ПРОДОЛЖЕНИЯ'
|
||||
|
||||
defLabel labelCongratulations, DEFAULT_LABEL_END_COLOR, 'Поздравляем!!! Новый лучший счет : '
|
||||
defLabel labelEnterName , DEFAULT_LABEL_END_COLOR, 'Теперь вы чемпион! Введите свое имя : '
|
||||
else
|
||||
defLabel labelButtonPlay , DEFAULT_BUTTON_TEXT_COLOR, 'PLAY'
|
||||
defLabel labelButtonExit , DEFAULT_BUTTON_TEXT_COLOR, 'EXIT'
|
||||
defLabel labelButtonClassic, DEFAULT_BUTTON_TEXT_COLOR, 'CLASSIC mode'
|
||||
defLabel labelButtonLevels , DEFAULT_BUTTON_TEXT_COLOR, 'LEVELS mode'
|
||||
defLabel labelButtonInc , DEFAULT_BUTTON_TEXT_COLOR, '+INC+'
|
||||
defLabel labelButtonDec , DEFAULT_BUTTON_TEXT_COLOR, '-DEC-'
|
||||
|
||||
defLabel labelScore , DEFAULT_LABEL_COLOR, 'SCORE : '
|
||||
defLabel labelLevel , DEFAULT_LABEL_COLOR, 'LEVEL : '
|
||||
defLabel labelHiscore , DEFAULT_LABEL_COLOR, 'HI-SCORE : '
|
||||
defLabel labelChampion, DEFAULT_LABEL_COLOR, 'CHAMPION : '
|
||||
|
||||
defLabel labelMenu , DEFAULT_NAVIGATION_COLOR, 'MENU - ',0x27,'ESC',0x27
|
||||
defLabel labelExit , DEFAULT_NAVIGATION_COLOR, 'PRESS ',0x27,'ESC',0x27,' TO EXIT'
|
||||
defLabel labelStart , DEFAULT_NAVIGATION_COLOR, 'PRESS ',0x27,'ENTER',0x27,' TO START'
|
||||
defLabel labelPause , DEFAULT_NAVIGATION_COLOR, 'PAUSE - ',0x27,'SPACE',0x27
|
||||
defLabel labelApply , DEFAULT_NAVIGATION_COLOR, 'APPLY NAME - ',0x27,'ENTER',0x27
|
||||
defLabel labelResume, DEFAULT_NAVIGATION_COLOR, 'RESUME - ',0x27,'SPACE',0x27
|
||||
|
||||
defLabel labelCongratulations, DEFAULT_LABEL_END_COLOR, 'Congratulations!!! New hi-score is : '
|
||||
defLabel labelEnterName , DEFAULT_LABEL_END_COLOR, 'You are the champion! Enter your name : '
|
||||
end if
|
||||
|
||||
defNumber numberScore , DEFAULT_LABEL_COLOR, 7
|
||||
defNumber numberLevel , DEFAULT_LABEL_COLOR, 2
|
||||
defNumber numberHiscore , DEFAULT_LABEL_COLOR, 7
|
||||
defLabel labelChampionName, DEFAULT_LABEL_COLOR, CHAMPION_NAME_LENGTH dup (0x20)
|
||||
defNumber numberGameOver , DEFAULT_NUMBER_END_COLOR, 7
|
||||
|
||||
edit1 edit_box 65,397,0x0,0x000000,0x000000,0x000000,0x000000,0x80000000,CHAMPION_NAME_LENGTH,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
|
||||
|
||||
hed db '',0
|
||||
;;---Variables-------------------------------------------------------------------------------------------------------------
|
||||
i_end:
|
||||
hed_end:
|
||||
rb 256
|
||||
|
||||
posLabel:
|
||||
.xLeft rd 1
|
||||
.xRight rd 1
|
||||
.yTop rd 1
|
||||
.yCenter rd 1
|
||||
.yBottom rd 1
|
||||
|
||||
labelChampionName.valueClassic rb CHAMPION_NAME_LENGTH
|
||||
labelChampionName.valueLevels rb CHAMPION_NAME_LENGTH
|
||||
numberHiscore.valueClassic rd 1
|
||||
numberHiscore.valueLevels rd 1
|
||||
mouse_dd rd 1
|
||||
|
||||
window_style rd 1
|
||||
|
||||
cur_level rd 1
|
||||
cur_level_number rd 1
|
||||
hi_level rd 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
|
||||
@@ -2502,11 +2433,6 @@ gs_shl16_gs rd 1
|
||||
gbxm1_shl16_gbxm1 rd 1
|
||||
gbym1_shl16_gbym1 rd 1
|
||||
|
||||
bottom_top_strings rd 1
|
||||
bottom_middle_strings rd 1
|
||||
bottom_bottom_strings rd 1
|
||||
top_strings rd 1
|
||||
|
||||
button_x_left rd 1
|
||||
button_x_right rd 1
|
||||
button_y_top rd 1
|
||||
|
||||
@@ -1,217 +1,217 @@
|
||||
;;===Common_preferences=================================================
|
||||
[Preferences]
|
||||
Speed=80
|
||||
; Delay between moves in ms (1/100 second)
|
||||
; SLOW == 0 <= Speed <= 100 == FAST
|
||||
Theme=Theme_standard
|
||||
; Theme name to use
|
||||
; See [Theme_*] sections below for available themes
|
||||
; Name of any theme must be shorter than 30 chars
|
||||
Smart_reverse=0
|
||||
; 0 - disabled, 1 - eabled
|
||||
; If this option is enabled, the snake may be reversed only by pressing Reverse key (see [Shortcuts] section)
|
||||
; For example, if the snake is moving to the left and you press RIGHT key the snake will not move to the right
|
||||
Show_lives_style=2
|
||||
; 0 - do not show remaining lives
|
||||
; 1 - show as a number in window title
|
||||
; 2 - draw the number in snake head
|
||||
; 3 - both 1 & 2
|
||||
Draw_level_name_in_window_title=1
|
||||
; 1 - yes, draw
|
||||
; 0 - no
|
||||
; This option includes drawing 'Classic mode' string in window title for classic mode (without levels)
|
||||
Separating_symbol=/
|
||||
; Symbol that separates 'Snake', '3 lives' and level name in window title
|
||||
; 'Snake | 3 lives | Towers of Hanoi'
|
||||
; 'Snake - 3 lives
|
||||
; 'Snake / Towers of Hanoi'
|
||||
; or smth like these ones
|
||||
;;---Common_preferences-------------------------------------------------
|
||||
|
||||
;;===Shortcuts==========================================================
|
||||
[Shortcuts]
|
||||
; Keys of moving. These ones are in addition to the standard combination of arrows.
|
||||
; VIM-like navigation is used by default.
|
||||
Move_left = h
|
||||
Move_down = j
|
||||
Move_up = k
|
||||
Move_right = l
|
||||
; Snake reverse key
|
||||
Reverse = Tab
|
||||
; Increare/decrease field keys
|
||||
Increase = u
|
||||
Decrease = i
|
||||
|
||||
;;---Shortcuts----------------------------------------------------------
|
||||
|
||||
;;===Visual_themes======================================================
|
||||
[Theme_standard]
|
||||
; all these keys are optional
|
||||
Decorations = 3
|
||||
; 0 = nothing
|
||||
; 1 = grid_lines
|
||||
; 2 = grid_lines_with_ends
|
||||
; 3 = grid_lines_with_corners
|
||||
; 4 = grid_dots
|
||||
; 5 = borders_lines
|
||||
; 6 = borders_lines_with_corners
|
||||
; 7 = borders_dots
|
||||
; 8 = corners_dots
|
||||
; 9 = corners_inner
|
||||
; 10 = corners_outer
|
||||
; 11 = corners_crosses
|
||||
Background_color = 0,0,0
|
||||
Decorations_color = 35,35,0
|
||||
Snake_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
|
||||
Lives_in_head_number_color= 255,136,0
|
||||
; color of the number in snake head which represents remaining lives
|
||||
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
|
||||
; color of strings on game_over screen
|
||||
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 = 225,125,225
|
||||
Snake_head_color = 255,125,55
|
||||
Lives_in_head_number_color= 255,255,255
|
||||
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,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
|
||||
Background_color = 255,255,255
|
||||
Decorations_color = 0,0,0
|
||||
Snake_color = 30,30,30
|
||||
Snake_head_color = 30,30,30
|
||||
Lives_in_head_number_color= 255,255,255
|
||||
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
|
||||
Background_color = 0,0,0
|
||||
Decorations_color = 255,255,255
|
||||
Snake_color = 255,255,255
|
||||
Snake_head_color = 255,255,255
|
||||
Lives_in_head_number_color= 30,30,30
|
||||
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_name]
|
||||
|
||||
;;---Visual_themes------------------------------------------------------
|
||||
|
||||
;;===Reserved_Section===================================================
|
||||
[Reserved]
|
||||
Square_side_length=19
|
||||
Champion_name_classic=
|
||||
Hiscore_classic=777
|
||||
Champion_name_levels=
|
||||
Hiscore_levels=222
|
||||
;;---Reserved_Section---------------------------------------------------
|
||||
;;===Common_preferences=================================================
|
||||
[Preferences]
|
||||
Speed=80
|
||||
; Delay between moves in ms (1/100 second)
|
||||
; SLOW == 0 <= Speed <= 100 == FAST
|
||||
Theme=Theme_standard
|
||||
; Theme name to use
|
||||
; See [Theme_*] sections below for available themes
|
||||
; Name of any theme must be shorter than 30 chars
|
||||
Smart_reverse=0
|
||||
; 0 - disabled, 1 - eabled
|
||||
; If this option is enabled, the snake may be reversed only by pressing Reverse key (see [Shortcuts] section)
|
||||
; For example, if the snake is moving to the left and you press RIGHT key the snake will not move to the right
|
||||
Show_lives_style=2
|
||||
; 0 - do not show remaining lives
|
||||
; 1 - show as a number in window title
|
||||
; 2 - draw the number in snake head
|
||||
; 3 - both 1 & 2
|
||||
Draw_level_name_in_window_title=1
|
||||
; 1 - yes, draw
|
||||
; 0 - no
|
||||
; This option includes drawing 'Classic mode' string in window title for classic mode (without levels)
|
||||
Separating_symbol=/
|
||||
; Symbol that separates 'Snake', '3 lives' and level name in window title
|
||||
; 'Snake | 3 lives | Towers of Hanoi'
|
||||
; 'Snake - 3 lives
|
||||
; 'Snake / Towers of Hanoi'
|
||||
; or smth like these ones
|
||||
;;---Common_preferences-------------------------------------------------
|
||||
|
||||
;;===Shortcuts==========================================================
|
||||
[Shortcuts]
|
||||
; Keys of moving. These ones are in addition to the standard combination of arrows.
|
||||
; VIM-like navigation is used by default.
|
||||
Move_left = h
|
||||
Move_down = j
|
||||
Move_up = k
|
||||
Move_right = l
|
||||
; Snake reverse key
|
||||
Reverse = Tab
|
||||
; Increare/decrease field keys
|
||||
Increase = u
|
||||
Decrease = i
|
||||
|
||||
;;---Shortcuts----------------------------------------------------------
|
||||
|
||||
;;===Visual_themes======================================================
|
||||
[Theme_standard]
|
||||
; all these keys are optional
|
||||
Decorations = 3
|
||||
; 0 = nothing
|
||||
; 1 = grid_lines
|
||||
; 2 = grid_lines_with_ends
|
||||
; 3 = grid_lines_with_corners
|
||||
; 4 = grid_dots
|
||||
; 5 = borders_lines
|
||||
; 6 = borders_lines_with_corners
|
||||
; 7 = borders_dots
|
||||
; 8 = corners_dots
|
||||
; 9 = corners_inner
|
||||
; 10 = corners_outer
|
||||
; 11 = corners_crosses
|
||||
Background_color = 0,0,0
|
||||
Decorations_color = 35,35,0
|
||||
Snake_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
|
||||
Lives_in_head_number_color= 255,136,0
|
||||
; color of the number in snake head which represents remaining lives
|
||||
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
|
||||
; color of strings on game_over screen
|
||||
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 = 225,125,225
|
||||
Snake_head_color = 255,125,55
|
||||
Lives_in_head_number_color= 255,255,255
|
||||
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,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
|
||||
Background_color = 255,255,255
|
||||
Decorations_color = 0,0,0
|
||||
Snake_color = 30,30,30
|
||||
Snake_head_color = 30,30,30
|
||||
Lives_in_head_number_color= 255,255,255
|
||||
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
|
||||
Background_color = 0,0,0
|
||||
Decorations_color = 255,255,255
|
||||
Snake_color = 255,255,255
|
||||
Snake_head_color = 255,255,255
|
||||
Lives_in_head_number_color= 30,30,30
|
||||
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_name]
|
||||
|
||||
;;---Visual_themes------------------------------------------------------
|
||||
|
||||
;;===Reserved_Section===================================================
|
||||
[Reserved]
|
||||
Square_side_length=19
|
||||
Champion_name_classic=
|
||||
Hiscore_classic=777
|
||||
Champion_name_levels=
|
||||
Hiscore_levels=222
|
||||
;;---Reserved_Section---------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user