forked from KolibriOS/kolibrios
Rusty Earth
1) two demo level 2) screen for "game stage", "game over" and "game win" 3) NOSO boot parameter to start without sound and sound files git-svn-id: svn://kolibrios.org@5292 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1043a1aa9f
commit
7cadd5ef29
@ -101,7 +101,9 @@ save_new_and_clear_old_position:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
harvest_of_death:
|
||||
mov [death_of_protagonist],0
|
||||
xor eax,eax
|
||||
mov [death_of_protagonist],al
|
||||
mov [npc_alive],al
|
||||
mov esi,plan_level
|
||||
mov ecx,LEVEL_MAP_SIZE_X*LEVEL_MAP_SIZE_Y
|
||||
cld
|
||||
@ -117,6 +119,11 @@ harvest_of_death:
|
||||
|
||||
cmp al,BASE_WATER
|
||||
je .base_water
|
||||
|
||||
cmp ah,OBJECT_FINAL_MONSTER
|
||||
ja .counter
|
||||
|
||||
mov [npc_alive],1
|
||||
;--------------------------------------
|
||||
.counter:
|
||||
dec ecx
|
||||
|
@ -1,51 +0,0 @@
|
||||
;---------------------------------------------------------------------
|
||||
death_of_protagonist_start:
|
||||
mov esi,map_level_game_over
|
||||
call map_level_to_plan_level
|
||||
.red:
|
||||
call draw_window
|
||||
;---------------------------------------------------------------------
|
||||
.still:
|
||||
mcall 10
|
||||
|
||||
cmp eax,1
|
||||
je .red
|
||||
|
||||
cmp eax,2
|
||||
je .key
|
||||
|
||||
cmp eax,3
|
||||
je .button
|
||||
|
||||
jmp .still
|
||||
;---------------------------------------------------------------------
|
||||
.key:
|
||||
mcall 2
|
||||
cmp [extended_key],1
|
||||
je .extended_key
|
||||
|
||||
test al,al
|
||||
jnz .still
|
||||
|
||||
cmp ah,0xE0
|
||||
jne .menu_still ; start_level_0
|
||||
|
||||
mov [extended_key],1
|
||||
jmp .still
|
||||
;---------------------------------------------------------------------
|
||||
.extended_key:
|
||||
mov [extended_key],0
|
||||
jmp .menu_still ; start_level_0
|
||||
;---------------------------------------------------------------------
|
||||
.menu_still:
|
||||
mcall 5,200
|
||||
jmp menu_still
|
||||
;---------------------------------------------------------------------
|
||||
.button:
|
||||
mcall 17
|
||||
|
||||
cmp ah,1
|
||||
jne .still
|
||||
|
||||
jmp button.exit
|
||||
;--------------------------------------
|
@ -1,5 +1,9 @@
|
||||
;---------------------------------------------------------------------
|
||||
draw_font:
|
||||
; in:
|
||||
; ebx - X*65536 + Y
|
||||
; edx - text ASCII
|
||||
;
|
||||
pusha
|
||||
xor ebp,ebp
|
||||
mov esi,edx
|
||||
|
@ -256,11 +256,13 @@ background_music_file_name db 'walking_with_poseidon.wav',0
|
||||
stone_kick_sound_file_name db 'flaunch.wav',0
|
||||
menu_sound_file_name db 'misc_menu.wav',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
protagonist_route dd 2
|
||||
protagonist_position:
|
||||
.x dd 4
|
||||
.y dd 4
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
main_menu_text_pointers:
|
||||
dd menu_game_label
|
||||
dd menu_settings_label
|
||||
@ -269,6 +271,7 @@ main_menu_text_pointers:
|
||||
dd menu_exit_label
|
||||
dd 0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
menu_credits_text_pointers:
|
||||
dd menu_credits_text.1
|
||||
dd menu_credits_text.2
|
||||
@ -278,6 +281,7 @@ menu_credits_text_pointers:
|
||||
dd menu_credits_text.6
|
||||
dd 0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
menu_help_text_pointers:
|
||||
dd menu_help_text.1
|
||||
dd menu_help_text.2
|
||||
@ -285,9 +289,16 @@ menu_help_text_pointers:
|
||||
dd menu_help_text.4
|
||||
dd 0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
settings_menu_text_pointers:
|
||||
dd menu_settings_sound_label
|
||||
dd menu_settings_music_label
|
||||
dd menu_setting_exit
|
||||
dd 0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
map_level_pointer:
|
||||
dd map_level_0
|
||||
dd map_level_1
|
||||
dd 0
|
||||
;---------------------------------------------------------------------
|
||||
|
@ -7,7 +7,33 @@
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
map_level_0:
|
||||
map_level_game_over:
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
dd 000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h,000002h
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
map_level_game_stage:
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
map_level_1:
|
||||
dd 030100h,000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h
|
||||
dd 000000h,001001h,001001h,000001h,000001h,000001h,001001h,001001h,001001h,000000h
|
||||
dd 010200h,001001h,000002h,000002h,000000h,000000h,000000h,000000h,001001h,000000h
|
||||
@ -20,15 +46,15 @@ map_level_0:
|
||||
dd 030300h,000000h,000000h,000000h,000000h,020400h,000000h,000000h,000003h,000003h
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
map_level_game_over:
|
||||
dd 000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h
|
||||
dd 000000h,000002h,000002h,000000h,000000h,000002h,000000h,000002h,000002h,000000h
|
||||
dd 000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h
|
||||
dd 000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h
|
||||
dd 000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h
|
||||
dd 000000h,000002h,000002h,000000h,000000h,000002h,000000h,000002h,000002h,000000h
|
||||
dd 000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h,000000h,000000h
|
||||
dd 000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h,000000h,000000h
|
||||
dd 000000h,000002h,000000h,000002h,000000h,000002h,000000h,000002h,000000h,000000h
|
||||
dd 000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h,000000h
|
||||
;---------------------------------------------------------------------
|
||||
map_level_0:
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
dd 000001h,001001h,001001h,000001h,000001h,000001h,000001h,001101h,001101h,000001h
|
||||
dd 000001h,001001h,000001h,000001h,000001h,000001h,000001h,000001h,001101h,000001h
|
||||
dd 000001h,001101h,030101h,001101h,001101h,001001h,001001h,000001h,001001h,000001h
|
||||
dd 000001h,001101h,000001h,001101h,000f01h,000001h,001001h,000001h,001001h,010301h
|
||||
dd 000001h,001001h,000001h,001001h,000001h,000001h,001101h,000001h,001101h,000001h
|
||||
dd 000001h,001001h,000001h,001001h,001001h,001101h,001101h,000001h,001101h,000001h
|
||||
dd 000001h,001101h,000001h,000001h,000001h,000001h,000001h,000001h,001001h,000001h
|
||||
dd 000001h,001101h,001101h,000001h,000001h,000001h,000001h,001001h,001001h,000001h
|
||||
dd 000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h,000001h
|
||||
;---------------------------------------------------------------------
|
@ -1,6 +1,6 @@
|
||||
;---------------------------------------------------------------------
|
||||
title:
|
||||
db 'Rusty Earth (Prototype 1.8) 28.12.2014',0
|
||||
db 'Rusty Earth (Prototype 1.9) 30.12.2014',0
|
||||
;---------------------------------------------------------------------
|
||||
menu_game_label:
|
||||
db 'GAME',0
|
||||
@ -32,6 +32,16 @@ text_on_label:
|
||||
menu_setting_exit:
|
||||
db 'EXIT',0
|
||||
;---------------------------------------------------------------------
|
||||
stage_text:
|
||||
db 'LEVEL '
|
||||
.1: db '00',0
|
||||
;--------------------------------------
|
||||
game_win_text:
|
||||
db 'YES! YOU WIN!',0
|
||||
;--------------------------------------
|
||||
protagonist_death_text:
|
||||
db 'REST IN PEACE',0
|
||||
;---------------------------------------------------------------------
|
||||
menu_credits_text:
|
||||
.1: db 'Hello KolibriOS Team!',0
|
||||
.2: db 'The game used graphics and sound material',0
|
||||
|
@ -2,7 +2,7 @@
|
||||
; Code page - Cyrillic OEM866
|
||||
;---------------------------------------------------------------------
|
||||
title:
|
||||
db '<27>¦ Ά ο ‡¥¬«ο (<28>ΰ®β®β¨― 1.8) 28.12.2014',0
|
||||
db '<27>¦ ¢ ï ‡¥¬«ï (<28>à®â®â¨¯ 1.9) 30.12.2014',0
|
||||
;---------------------------------------------------------------------
|
||||
menu_game_label:
|
||||
db 'ˆƒ<CB86>€',0
|
||||
@ -34,6 +34,16 @@ text_on_label:
|
||||
menu_setting_exit:
|
||||
db '‚›•Ž„',0
|
||||
;---------------------------------------------------------------------
|
||||
stage_text:
|
||||
db '“<>Ž‚…<E2809A>œ '
|
||||
.1: db '00',0
|
||||
;--------------------------------------
|
||||
game_win_text:
|
||||
db '“<>€! <20>Ž<EFBFBD>…„€!',0
|
||||
;--------------------------------------
|
||||
protagonist_death_text:
|
||||
db '<27>’Ž <20>›‹ ŠŽ<C5A0>…–',0
|
||||
;---------------------------------------------------------------------
|
||||
menu_credits_text:
|
||||
.1: db '<27>ਢ¥â ãç á⨪ ¬ ª®¬ ¤ë KolibriOS Team!',0
|
||||
.2: db 'ƒà ä¨ç¥áª¨¥ ¨ §¢ãª®¢ë¥ ¬ â¥à¨ «ë ¯®¤',0
|
||||
|
@ -34,7 +34,7 @@
|
||||
dd IM_END
|
||||
dd I_END
|
||||
dd stacktop
|
||||
dd 0x0
|
||||
dd bootparam
|
||||
dd path
|
||||
;-----------------------------------------------------------------------------
|
||||
include 'lang.inc'
|
||||
@ -65,10 +65,10 @@ OBJECT_DEATH = 1
|
||||
OBJECT_SKELETON = 2
|
||||
OBJECT_IFRIT = 3
|
||||
OBJECT_BARRET = 4
|
||||
OBJECT_FINAL_MONSTER = 14
|
||||
OBJECT_PROTAGONIST = 15
|
||||
OBJECT_RED_BRICK = 16
|
||||
OBJECT_WHITE_BRICK = 17
|
||||
OBJECT_FINAL_MONSTER = 14 ; 0Eh
|
||||
OBJECT_PROTAGONIST = 15 ; 0Fh
|
||||
OBJECT_RED_BRICK = 16 ; 10h
|
||||
OBJECT_WHITE_BRICK = 17 ; 11h
|
||||
RED_BRICK_CRASH_1 = 0x80
|
||||
RED_BRICK_CRASH_2 = 0x81
|
||||
;-----------------------------------------------------------------------------
|
||||
@ -93,6 +93,10 @@ load_libraries l_libs_start,end_l_libs
|
||||
mov [deflate_unpack],eax
|
||||
;--------------------------------------
|
||||
call load_and_convert_all_icons
|
||||
|
||||
cmp [bootparam],dword 'NOSO'
|
||||
je menu_still
|
||||
|
||||
call load_all_sound_files
|
||||
|
||||
mov eax,[background_music]
|
||||
@ -111,15 +115,69 @@ load_libraries l_libs_start,end_l_libs
|
||||
menu_still:
|
||||
jmp main_menu_start
|
||||
;---------------------------------------------------------------------
|
||||
show_game_stage:
|
||||
mov esi,map_level_game_stage
|
||||
call map_level_to_plan_level
|
||||
call draw_window
|
||||
mov eax,[level_counter]
|
||||
inc eax
|
||||
mov ebx,stage_text.1
|
||||
call decimal_string_2
|
||||
mov edx,stage_text
|
||||
mov ebx,SPRITE_SIZE_X*3 shl 16 + SPRITE_SIZE_Y*5
|
||||
call draw_font
|
||||
mcall 5,300
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
show_game_win:
|
||||
mov esi,map_level_game_stage
|
||||
call map_level_to_plan_level
|
||||
call draw_window
|
||||
mov edx,game_win_text
|
||||
mov ebx,SPRITE_SIZE_X*2 shl 16 + SPRITE_SIZE_Y*5
|
||||
call draw_font
|
||||
mcall 5,1000
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
death_of_protagonist_show:
|
||||
mov esi,map_level_game_over
|
||||
call map_level_to_plan_level
|
||||
call draw_window
|
||||
mov edx,protagonist_death_text
|
||||
mov ebx,SPRITE_SIZE_X*2 shl 16 + SPRITE_SIZE_Y*5
|
||||
call draw_font
|
||||
mcall 5,500
|
||||
jmp main_menu_start
|
||||
;---------------------------------------------------------------------
|
||||
start_level_0:
|
||||
xor eax,eax
|
||||
mov [level_counter],eax
|
||||
;---------------------------------------------------------------------
|
||||
start_level:
|
||||
mov esi,[level_counter]
|
||||
shl esi,2
|
||||
mov esi,[esi+map_level_pointer]
|
||||
test esi,esi
|
||||
jnz @f
|
||||
|
||||
call show_game_win
|
||||
jmp main_menu_start
|
||||
;--------------------------------------
|
||||
@@:
|
||||
call show_game_stage
|
||||
mov eax,[stone_kick_sound]
|
||||
mov [sounds_sample],eax
|
||||
; xor eax,eax
|
||||
; mov [level_counter],eax
|
||||
mov [death_of_protagonist],0
|
||||
mov [protagonist_route],2
|
||||
mov [protagonist_position.x],4
|
||||
mov [protagonist_position.y],4
|
||||
|
||||
mov esi,map_level_0
|
||||
mov esi,[level_counter]
|
||||
shl esi,2
|
||||
mov esi,[esi+map_level_pointer]
|
||||
; mov esi,map_level_0
|
||||
call map_level_to_plan_level
|
||||
call generate_objects_id
|
||||
call copy_plan_level_to_plan_level_old
|
||||
@ -145,8 +203,15 @@ still:
|
||||
call harvest_of_death
|
||||
call show_tiles_one_iteration
|
||||
cmp [death_of_protagonist],1
|
||||
je death_of_protagonist_start
|
||||
je death_of_protagonist_show
|
||||
|
||||
cmp [npc_alive],0
|
||||
jne @f
|
||||
|
||||
inc byte [level_counter]
|
||||
jmp start_level
|
||||
;--------------------------------------
|
||||
@@:
|
||||
mov eax,[protagonist_position.y]
|
||||
imul eax,LEVEL_MAP_SIZE_X*4
|
||||
mov ebx,[protagonist_position.x]
|
||||
@ -155,7 +220,7 @@ still:
|
||||
add eax,plan_level
|
||||
mov eax,[eax]
|
||||
cmp ah,OBJECT_PROTAGONIST
|
||||
jne death_of_protagonist_start
|
||||
jne death_of_protagonist_show
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
@ -193,6 +258,46 @@ draw_window:
|
||||
mcall 12,2
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; <20>…<EFBFBD>…‚Ž„ 10-<2D>›• —ˆ‘…‹ ‘Ž ‡<>€ŠŽŒ ‚ ‘’<E28098>ŽŠŽ‚›‰ ‚ˆ„
|
||||
; ‚室:
|
||||
; AX - ç¨á«®
|
||||
; EBX - ¤à¥á áâப¨
|
||||
; ‚ë室:
|
||||
; áâப ᮤ¥à¦¨â ç¨á«®, ª®¥æ ®â¬¥ç¥ ª®¤®¬ 0
|
||||
;------------------------------------------------------------------------------
|
||||
decimal_string_2:
|
||||
push eax ebx ecx edx
|
||||
xor ecx,ecx
|
||||
mov [ebx],byte '0'
|
||||
inc ebx
|
||||
;--------------------------------------
|
||||
.p3:
|
||||
xor edx,edx
|
||||
push ebx
|
||||
mov ebx,10
|
||||
div ebx
|
||||
pop ebx
|
||||
add edx,48
|
||||
push edx
|
||||
inc ecx
|
||||
cmp ax,0
|
||||
jne .p3
|
||||
|
||||
cmp ecx,1
|
||||
jbe .p4
|
||||
|
||||
mov ecx,2
|
||||
dec ebx
|
||||
;--------------------------------------
|
||||
.p4:
|
||||
pop edx
|
||||
mov [ebx],dl
|
||||
inc ebx
|
||||
loop .p4
|
||||
pop edx ecx ebx eax
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
memory_free_error:
|
||||
mov [N_error],3
|
||||
jmp button.exit
|
||||
@ -205,7 +310,6 @@ include 'key.inc'
|
||||
include 'show_tiles.inc'
|
||||
include 'show_base.inc'
|
||||
include 'show_object.inc'
|
||||
include 'death_protagonist.inc'
|
||||
include 'load.inc'
|
||||
include 'icon_convert.inc'
|
||||
include 'error_window.inc'
|
||||
|
@ -5,6 +5,7 @@ extended_key rb 1
|
||||
draw_all_level rb 1
|
||||
current_cell_NPC rb 1
|
||||
death_of_protagonist rb 1
|
||||
npc_alive rb 1
|
||||
target_detected rb 1
|
||||
sound_flag rb 1
|
||||
sounds_flag rb 1
|
||||
@ -52,6 +53,8 @@ target_action_cell_y rd 1
|
||||
menu_text_pointers rd 1
|
||||
text_step_Y rd 1
|
||||
;------------------------------------------------------------------------------
|
||||
level_counter rd 1
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
version rd 1 ; версия интерфейса, текущая 0x0101
|
||||
; snd_format одна из констант вида PCM_X_Y_Z где
|
||||
@ -115,10 +118,11 @@ align 4
|
||||
file_info:
|
||||
rb 40
|
||||
;---------------------------------------------------------------------
|
||||
;align 4
|
||||
align 4
|
||||
bootparam:
|
||||
;procinfo:
|
||||
;process_info:
|
||||
; rb 1024
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
; sound thread
|
||||
|
Loading…
Reference in New Issue
Block a user