Subversion Repositories Kolibri OS

Rev

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

Rev 1518 Rev 1522
Line 2... Line 2...
2
 
2
 
Line 3... Line 3...
3
Game_over:
3
Game_over:
4
 
4
 
5
    mov  ebx, [score]
5
    mov  ebx, [score]
Line 6... Line 6...
6
    cmp  ebx, [hi_score]
6
    cmp  ebx, [hi_score]
Line 7... Line 7...
7
     jng Game_over_Redraw
7
     jng .redraw
Line 8... Line 8...
8
     
8
     
9
    mov  [is_new_record], 1
9
    mov  [is_new_record], 1
-
 
10
 
-
 
11
      mcall     40,100111b                      ; set events: standart + mouse
10
 
12
 
11
      mcall     40,100111b                      ; set events: standart + mouse
-
 
12
 
13
  .redraw:
13
Game_over_Redraw:
14
      mcall     12,1
14
      mcall     12,1
15
    mov  ebx, [wp_x]
15
      mcall     0,200*65536+WINDOW_WIDTH,326*65536+WINDOW_HEIGHT,[window_style], ,window_title
16
    shl  ebx, 16
16
      
-
 
Line 17... Line 17...
17
    cmp  [is_new_record], 1
17
    add  ebx, dword[window_width]
18
     jnz @f
18
    mov  ecx, [wp_y]
19
    push    dword edit1
19
    shl  ecx, 16
Line 20... Line 20...
20
      call      [edit_box.draw]
20
    add  ecx, dword[window_height]
Line 21... Line 21...
21
  @@:
21
      mcall     0, , ,[window_style], ,window_title
22
 
22
 
23
      call      Draw_decorations
23
      call      Draw_decorations
24
      call      Draw_game_over_picture
24
      call      Draw_game_over_picture
25
      call      Draw_game_over_strings
25
      call      Draw_game_over_strings          ; edit_box is here
26
 
26
 
27
      mcall     12,2
27
      mcall     12,2
28
 
28
 
29
Game_over_Wait_for_event:
29
  .still:
Line 30... Line 30...
30
      mcall     10                              ; wait for event
30
      mcall     10                              ; wait for event
31
                                                ; ok, what an event?
31
                                                ; ok, what an event?
32
    dec  al                                     ; has the window been moved or resized?
32
    dec  al                                     ; has the window been moved or resized?
Line 33... Line 33...
33
     jz  Game_over_Redraw
33
     jz  .redraw
Line 34... Line 34...
34
    dec  al                                     ; was a key pressed?
34
    dec  al                                     ; was a key pressed?
35
     jz  Game_over_key
35
     jz  .key
Line 36... Line 36...
36
    dec  al                                     ; was a button pressed?
36
    dec  al                                     ; was a button pressed?
37
     jz  Game_over_button
37
     jz  .button
Line 38... Line 38...
38
 
38
 
39
 
39
 
40
Game_over_mouse:                                ; mouse event received
40
  .mouse:                                       ; mouse event received
41
    push dword edit1
41
    push dword edit1
Line 59... Line 59...
59
 
59
 
60
  @@:
60
  @@:
61
    push    dword edit1
61
    push    dword edit1
Line 62... Line 62...
62
    call    [edit_box.key]
62
    call    [edit_box.key]
63
    
63
    
Line 64... Line 64...
64
     jmp Game_over_Wait_for_event
64
     jmp .still
65
  .skip:
65
  .key.skip:
Line 66... Line 66...
66
 
66
 
67
    cmp  ah,  0x1B                              ; Escape - go to menu
67
    cmp  ah,  0x1B                              ; Escape - go to menu
Line 68... Line 68...
68
     jne  Game_over_Wait_for_event
68
     jne  .still
69
 
69
 
70
      mcall     40,111b                         ; set events: standart
70
      mcall     40,111b                         ; set events: standart
Line 71... Line 71...
71
     jmp First_menu
71
     jmp First_menu
72
 
72
 
Line 73... Line 73...
73
 
73
 
Line 74... Line 74...
74
Game_over_button:                               ; a button was pressed
74
  .button:                                      ; a button was pressed
Line 75... Line 75...
75
      mcall     17                              ; get button number
75
      mcall     17                              ; get button number
Line 76... Line 76...
76
    shr  eax, 8                                 ; we should do it to get the real button code
76
    shr  eax, 8                                 ; we should do it to get the real button code
77
 
77
 
Line 78... Line 78...
78
    cmp  eax, 1
78
    cmp  eax, 1
79
     je  Exit
79
     je  Exit
80
 
-
 
81
     jmp Game_over_Wait_for_event
80
 
-
 
81
     jmp .still
82
 
82
 
Line 83... Line 83...
83
;;---Game_over_mode------------------------------------------------------------------------------------------------------------
83
;;---Game_over_mode------------------------------------------------------------------------------------------------------------
Line 84... Line 84...
84
 
84
 
Line 85... Line 85...
85
 
85
 
86
;;===Some_functions============================================================================================================
86
;;===Some_functions============================================================================================================
Line 87... Line -...
87
 
-
 
88
Draw_game_over_picture:
-
 
89
    ;;===Draw_game_over_picture================================================================================================
87
 
90
 
88
Draw_game_over_picture:
Line -... Line 89...
-
 
89
    ;;===Draw_game_over_picture================================================================================================
-
 
90
 
-
 
91
    mov  ax,  0*0x100+29
-
 
92
    mov  cx,  1*0x100+13
-
 
93
    mov  edx, [game_over_picture_color]
91
    mov  al,  11
94
    mov  esi, picture_game_over
-
 
95
      call      Draw_picture
-
 
96
 
-
 
97
    ret
-
 
98
 
-
 
99
    ;;---Draw_game_over_picture------------------------------------------------------------------------------------------------
-
 
100
 
92
    mov  bh,  0
101
 
-
 
102
Draw_game_over_strings:
-
 
103
    ;;===Draw_game_over_strings================================================================================================
-
 
104
 
-
 
105
    cmp  [is_new_record], 1
-
 
106
     jnz @f
93
    mov  ecx, picture_game_over
107
 
-
 
108
    mov  ebx, [window_width]
-
 
109
    shr  ebx, 1
-
 
110
    sub  ebx, (string_enter_your_name-string_congratulations-1+8)*3+6
-
 
111
    shl  ebx, 16
-
 
112
    add  ebx, [bottom_top_strings]
-
 
113
      mcall     4, ,[game_over_strings_color],string_congratulations
94
    mov  edx, [game_over_picture_color]
114
    mov  ebx, [window_width]
-
 
115
    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
-
 
118
    shl  ebx, 16
-
 
119
    add  ebx, [bottom_bottom_strings]
-
 
120
      mcall      , , ,string_enter_your_name
-
 
121
    mov  ebx, [window_width]
Line 95... Line 122...
95
      call      Draw_picture
122
    shr  ebx, 1
Line 96... Line 123...
96
 
123
    sub  ebx, (press_to_start-string_apply_name_enter-1)*3+6
Line 124... Line 151...
124
    
151
 
125
    
152
 
Line 126... Line -...
126
Score_and_name_store:
-
 
127
    ;;===Name_store============================================================================================================
153
Score_and_name_store:
128
    
154
    ;;===Name_store============================================================================================================
Line 129... Line 155...
129
 
155