Subversion Repositories Kolibri OS

Rev

Rev 1522 | Rev 1677 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1522 Rev 1566
Line 1... Line 1...
1
;;===Game_over_mode============================================================================================================
1
;;===Game_over_mode============================================================================================================
Line 2... Line 2...
2
 
2
 
Line -... Line 3...
-
 
3
Game_over:
-
 
4
 
3
Game_over:
5
      call      Show_cursor
4
 
-
 
5
    mov  ebx, [score]
-
 
Line -... Line 6...
-
 
6
 
-
 
7
    mov  ebx, [score]
-
 
8
    
-
 
9
    cmp  [play_mode],   CLASSIC_MODE
6
    cmp  ebx, [hi_score]
10
     jne @f
-
 
11
    cmp  ebx, [hi_score_classic]
-
 
12
     jng .redraw
-
 
13
    mov  [is_new_record], 1
-
 
14
     jmp .done
-
 
15
  @@:
-
 
16
    cmp  ebx, [hi_score_levels]
-
 
17
     jng .redraw
Line 7... Line 18...
7
     jng .redraw
18
    mov  [is_new_record], 1
Line 8... Line 19...
8
     
19
     jmp .done
9
    mov  [is_new_record], 1
20
  .done:
Line 36... Line 47...
36
    dec  al                                     ; was a button pressed?
47
    dec  al                                     ; was a button pressed?
37
     jz  .button
48
     jz  .button
Line 38... Line 49...
38
 
49
 
39
 
-
 
40
  .mouse:                                       ; mouse event received
50
 
Line 41... Line 51...
41
    push dword edit1
51
  .mouse:                                       ; mouse event received
Line 42... Line 52...
42
      call      [edit_box.mouse]
52
      invoke        edit_box.mouse, edit1
43
    
53
    
Line 44... Line 54...
44
     jmp .still
54
     jmp .still
45
 
55
 
Line -... Line 56...
-
 
56
 
-
 
57
  .key:                                         ; a key was pressed
-
 
58
      mcall     2                               ; get keycode
-
 
59
 
-
 
60
    cmp  [is_new_record],   1
46
 
61
     je  .key.is_record
47
  .key:                                         ; a key was pressed
62
 
48
      mcall     2                               ; get keycode
63
    cmp  ah,  0x1B                              ; Escape - go to menu
49
 
-
 
50
    cmp  [is_new_record], 1
-
 
51
     jnz .key.skip
64
     jne .still
52
     
-
 
53
    cmp  ah,  0x0D                              ; Enter
65
     jmp First_menu
54
     jnz @f
-
 
55
      call      Score_and_name_store
66
 
56
    mov  [is_new_record],   0
-
 
57
      mcall     40,111b                         ; set events: standart
67
  .key.is_record:
58
     jmp First_menu
-
 
59
 
-
 
60
  @@:
-
 
61
    push    dword edit1
-
 
62
    call    [edit_box.key]
-
 
63
    
-
 
64
     jmp .still
-
 
Line 65... Line 68...
65
  .key.skip:
68
    cmp  ah,  0x0D                              ; Enter
66
 
69
     jnz @f
67
    cmp  ah,  0x1B                              ; Escape - go to menu
70
      call      Score_and_name_store
Line 68... Line 71...
68
     jne  .still
71
     jmp First_menu
69
 
72
  @@:
Line 70... Line 73...
70
      mcall     40,111b                         ; set events: standart
73
      invoke        edit_box.key, edit1
Line 71... Line 74...
71
     jmp First_menu
74
     jmp .still
Line 86... Line 89...
86
;;===Some_functions============================================================================================================
89
;;===Some_functions============================================================================================================
Line 87... Line 90...
87
 
90
 
88
Draw_game_over_picture:
91
Draw_game_over_picture:
Line -... Line 92...
-
 
92
    ;;===Draw_game_over_picture================================================================================================
-
 
93
 
89
    ;;===Draw_game_over_picture================================================================================================
94
    cmp  [is_new_record],   1
90
 
95
     je  @f
91
    mov  ax,  0*0x100+29
96
    mov  ax,  1*0x100+26
92
    mov  cx,  1*0x100+13
97
    mov  cx,  1*0x100+13
-
 
98
    mov  edx, [game_over_picture_color]
-
 
99
    mov  esi, picture_game_over
-
 
100
     jmp .done
-
 
101
  @@:
-
 
102
    mov  ax,  5*0x100+17
-
 
103
    mov  cx,  1*0x100+12
-
 
104
    mov  edx, [you_win_picture_color]
93
    mov  edx, [game_over_picture_color]
105
    mov  esi, picture_you_win
Line 94... Line 106...
94
    mov  esi, picture_game_over
106
  .done:
Line 95... Line 107...
95
      call      Draw_picture
107
      call      Draw_picture
Line 105... Line 117...
105
    cmp  [is_new_record], 1
117
    cmp  [is_new_record], 1
106
     jnz @f
118
     jnz @f
Line 107... Line 119...
107
 
119
 
108
    mov  ebx, [window_width]
120
    mov  ebx, [window_width]
109
    shr  ebx, 1
121
    shr  ebx, 1
110
    sub  ebx, (string_enter_your_name-string_congratulations-1+8)*3+6
122
    sub  ebx, string_congratulations.size*3+6*6
111
    shl  ebx, 16
123
    shl  ebx, 16
112
    add  ebx, [bottom_top_strings]
124
    add  ebx, [bottom_top_strings]
113
      mcall     4, ,[game_over_strings_color],string_congratulations
125
      mcall     4, ,[game_over_strings_color],string_congratulations
114
    mov  ebx, [window_width]
126
    mov  ebx, [window_width]
115
    shr  ebx, 1
127
    shr  ebx, 1
116
    sub  ebx, (strings_end-string_enter_your_name-1+8)*3+6
-
 
117
;    add  ebx, (strings_end-string_enter_your_name)*6
128
    sub  ebx, string_enter_your_name.size*3+6*6
118
    shl  ebx, 16
129
    shl  ebx, 16
119
    add  ebx, [bottom_bottom_strings]
130
    add  ebx, [bottom_bottom_strings]
120
      mcall      , , ,string_enter_your_name
131
      mcall      , , ,string_enter_your_name
121
    mov  ebx, [window_width]
132
    mov  ebx, [window_width]
122
    shr  ebx, 1
133
    shr  ebx, 1
123
    sub  ebx, (press_to_start-string_apply_name_enter-1)*3+6
134
    sub  ebx, string_apply_name_enter.size*3
124
    shl  ebx, 16
135
    shl  ebx, 16
125
    add  ebx, [top_strings]
136
    add  ebx, [top_strings]
126
      mcall      , ,[navigation_strings_color],string_apply_name_enter
137
      mcall      , ,[navigation_strings_color],string_apply_name_enter
127
    mov  edx, [window_width]
138
    mov  edx, [window_width]
128
    shr  edx, 1
-
 
129
    sub  edx, (string_enter_your_name-string_congratulations-1+8)*3+7
139
    shr  edx, 1
130
    add  edx, (string_enter_your_name-string_congratulations)*6
140
    add  edx, string_congratulations.size*3-6*6-1
131
    shl  edx, 16
141
    shl  edx, 16
132
    add  edx, dword[bottom_top_strings]
142
    add  edx, dword[bottom_top_strings]
133
      mcall     47,0x00070000,[score], ,[game_over_hiscore_color]
143
      mcall     47,0x00070000,[score], ,[game_over_hiscore_color]
134
    mov  ebx, [window_width]
144
    mov  ebx, [window_width]
135
    shr  ebx, 1
-
 
136
    sub  ebx, (strings_end-string_enter_your_name-1+8)*3+9
145
    shr  ebx, 1
137
    add  ebx, (strings_end-string_enter_your_name)*6
146
    add  ebx, string_enter_your_name.size*3-6*6-3
138
    mov  [edit1+0x04],  ebx
-
 
139
    push    dword edit1
147
    mov  [edit1.left],  ebx
Line 140... Line 148...
140
      call      [edit_box.draw]
148
      invoke        edit_box.draw, edit1
Line 141... Line 149...
141
 
149
 
Line 151... Line 159...
151
 
159
 
152
 
160
 
Line -... Line 161...
-
 
161
Score_and_name_store:
-
 
162
    ;;===Name_store============================================================================================================
-
 
163
 
-
 
164
    mov  esi, hed
-
 
165
 
-
 
166
    cmp  [play_mode],   CLASSIC_MODE
-
 
167
     jne @f
153
Score_and_name_store:
168
    mov  edi, champion_name_classic
-
 
169
     jmp .done
-
 
170
  @@:
-
 
171
    mov  edi, champion_name_levels
-
 
172
  .done:
-
 
173
 
-
 
174
    mov  ecx, CHAMPION_NAME_LENGTH
-
 
175
    rep  movsb
-
 
176
    
-
 
177
    mov  eax, [score]
154
    ;;===Name_store============================================================================================================
178
 
-
 
179
    cmp  [play_mode],   CLASSIC_MODE
-
 
180
     jne @f
-
 
181
    mov  [hi_score_classic],    eax
-
 
182
     jmp .done2
Line 155... Line 183...
155
 
183
  @@:
Line 156... Line 184...
156
      invoke    ini.set_str, cur_dir_path, aScore, aChampion_name, hed, 15
184
    mov  [hi_score_levels], eax