Subversion Repositories Kolibri OS

Rev

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

Rev 5243 Rev 5291
Line 53... Line 53...
53
    for (i = 0; i < game.tex_ground.w; i++) {
53
    for (i = 0; i < game.tex_ground.w; i++) {
54
        texture_draw_vline(&game.tex_ground, i, 25 + rs_perlin(0,i+game.tz)*25, 2, 0xFF113300);
54
        texture_draw_vline(&game.tex_ground, i, 25 + rs_perlin(0,i+game.tz)*25, 2, 0xFF113300);
55
        texture_draw_vline(&game.tex_ground, i, 25 + rs_perlin(0,i+game.tz)*25 + 2, 999, 0xFF000000);
55
        texture_draw_vline(&game.tex_ground, i, 25 + rs_perlin(0,i+game.tz)*25 + 2, 999, 0xFF000000);
56
    };
56
    };
Line 57... Line -...
57
    
-
 
58
    texture_draw(&game.tex_ground, &game.tex_clouds, game.tz, 0, /* game.tx, game.ty, */ DRAW_MODE_ADDITIVE | DRAW_TILED_FLAG );
-
 
Line 59... Line 57...
59
    texture_draw(&game.framebuffer, &game.tex_ground, 0, GAME_HEIGHT-50, DRAW_MODE_ALPHA);
57
    
Line 60... Line 58...
60
    
58
    
Line 70... Line 68...
70
            y+=15;
68
            y+=15;
71
        };
69
        };
Line 72... Line 70...
72
        
70
        
Line 73... Line 71...
73
        if (game.menu_index == MENU_MAIN) {
71
        if (game.menu_index == MENU_MAIN) {
74
                
72
                
75
            for (i = 0; i < ROCKS_COUNT; i++) {
73
            for (i = 0; i < 3; i++) {
Line 76... Line 74...
76
                texture_draw(&game.framebuffer, &game.tex_rocks[i], 250+80*rs_noise(i,150), 60+60*rs_noise(i,1110), DRAW_MODE_ADDITIVE );
74
                texture_draw(&game.framebuffer, &game.tex_rocks[i], 250+80*rs_noise(i,150), 60+60*rs_noise(i,1110), DRAW_MODE_ADDITIVE );
77
            };
75
            };
78
                
76
                
79
            game_textout( GAME_WIDTH/2 - 100, 40, 1,  "HELI0THRYX");
77
            game_textout( GAME_WIDTH/2 - 100, 40, 1,  "HELI0THRYX");
Line 80... Line 78...
80
            game_textout( GAME_WIDTH/2 - 8, 58, 3,  "TECHDEM0");
78
//            game_textout( GAME_WIDTH/2 - 8, 58, 3,  "TECHDEM0");
81
            game_textout( 2, GAME_HEIGHT-10, 2,  L_BOTTOM_LINE_DEVELOPER_INFO);
79
            game_textout( 2, GAME_HEIGHT-10, 2,  L_BOTTOM_LINE_DEVELOPER_INFO);
Line -... Line 80...
-
 
80
        };
-
 
81
    
-
 
82
    }
-
 
83
    else {
-
 
84
        
-
 
85
        int i, j;
-
 
86
        game_obj_t *obj;
82
        };
87
        for (i = 0; i < game.objs_count; i++) {
83
    
88
            obj = &(game.objs[i]);
84
    }
89
            
85
    else {
90
            if (obj->obj_type == OBJ_BULLET) {
-
 
91
                    
86
        
92
                texture_set_pixel(&game.framebuffer, obj->x-4, obj->y, 0xFF00BB00);
87
        texture_draw(&game.framebuffer, &game.tex_ship[0], game.tx-8, game.ty-4, DRAW_MODE_ALPHA);
93
                texture_set_pixel(&game.framebuffer, obj->x-3, obj->y, 0xFF00CC00);
88
        texture_draw(&game.framebuffer, &game.tex_ship[1], game.tx-8, game.ty-4, DRAW_MODE_ALPHA);
94
                texture_set_pixel(&game.framebuffer, obj->x-2, obj->y, 0xFF00DD00);
-
 
95
                texture_set_pixel(&game.framebuffer, obj->x-1, obj->y, 0xFF00EE00);
-
 
96
                texture_set_pixel(&game.framebuffer, obj->x-0, obj->y, 0xFF00FF00);
89
        texture_draw(&game.framebuffer, &game.tex_ship[2], game.tx, game.ty-4, DRAW_MODE_ALPHA);
97
                
90
        texture_draw(&game.framebuffer, &game.tex_ship[3], game.tx, game.ty-4, DRAW_MODE_ALPHA);
98
            }
91
        
99
            else if (obj->obj_type == OBJ_RED_BULLET) {
92
        int i;
100
                    
93
        for (i = 0; i < BULLETS_COUNT; i++) {
101
                texture_set_pixel(&game.framebuffer, obj->x-1, obj->y-0, 0xFFFF0000);
94
            if (game.bullet_y[i]) {
102
                texture_set_pixel(&game.framebuffer, obj->x-1, obj->y-1, 0xFFFF6600);
-
 
103
                texture_set_pixel(&game.framebuffer, obj->x-1, obj->y-0, 0xFFFF0000);
-
 
104
                texture_set_pixel(&game.framebuffer, obj->x-0, obj->y-1, 0xFFFF0000);
-
 
105
                texture_set_pixel(&game.framebuffer, obj->x-0, obj->y-0, 0xFFFF6600);
-
 
106
                texture_set_pixel(&game.framebuffer, obj->x+1, obj->y-1, 0xFFFF0000);
-
 
107
                texture_set_pixel(&game.framebuffer, obj->x+1, obj->y-0, 0xFFFF6600);
-
 
108
                
-
 
109
            }
-
 
110
            else if (obj->obj_type == OBJ_EXPLOSION) {
-
 
111
                
-
 
112
//                char s[] = "00 ";
-
 
113
//                s[0] += obj->t / 10;
-
 
114
//                s[1] += obj->t % 10;
-
 
115
//                game_textout( obj->x, obj->y, 0, s );
-
 
116
 
-
 
117
                texture_draw( &game.framebuffer, &game.tex_explosions[ obj->t ], obj->x - obj->radius, obj->y - obj->radius, DRAW_MODE_ALPHA );
-
 
118
                
-
 
119
            }
-
 
120
            else if (obj->obj_type == OBJ_ROCK) {
-
 
121
                texture_draw( &game.framebuffer, &game.tex_rocks[ obj->tag ], obj->x - obj->radius, obj->y - obj->radius, DRAW_MODE_ALPHA );
-
 
122
            }
-
 
123
            else if (obj->obj_type == OBJ_MINIROCK) {
-
 
124
                texture_draw( &game.framebuffer, &game.tex_minirocks[ obj->tag ], obj->x - obj->radius, obj->y - obj->radius, DRAW_MODE_ALPHA );
-
 
125
            }
-
 
126
            else if (obj->obj_type == OBJ_TURRET) {
-
 
127
                texture_draw( &game.framebuffer, &game.tex_rocks[ 0 ], obj->x - obj->radius, obj->y - obj->radius, DRAW_MODE_ALPHA );
-
 
128
                texture_draw( &game.framebuffer, &game.tex_rocks[ 0 ], obj->x - obj->radius, obj->y - obj->radius, DRAW_MODE_ADDITIVE );
-
 
129
                
-
 
130
                for (j = 0; j < 1 + (obj->tag)/6; j++) {
-
 
131
                    texture_draw_vline(&game.framebuffer, obj->x - obj->radius + j*4 + 0, obj->y - obj->radius - 16, 8, 0xFF993333 );
-
 
132
                    texture_draw_vline(&game.framebuffer, obj->x - obj->radius + j*4 + 1, obj->y - obj->radius - 16, 8, 0xFF993333 );
-
 
133
                    texture_draw_vline(&game.framebuffer, obj->x - obj->radius + j*4 + 2, obj->y - obj->radius - 16, 8, 0xFF993333 );
-
 
134
                };
-
 
135
                
-
 
136
            }
-
 
137
 
-
 
138
        };
-
 
139
        
-
 
140
 
-
 
141
        texture_draw(&game.framebuffer, &game.tex_ship[0], game.player_x-8, game.player_y-4, DRAW_MODE_ALPHA);
-
 
142
        texture_draw(&game.framebuffer, &game.tex_ship[1], game.player_x-8, game.player_y-4, DRAW_MODE_ALPHA);
-
 
143
        texture_draw(&game.framebuffer, &game.tex_ship[2], game.player_x, game.player_y-4, DRAW_MODE_ALPHA);
-
 
144
        texture_draw(&game.framebuffer, &game.tex_ship[3], game.player_x, game.player_y-4, DRAW_MODE_ALPHA);
-
 
145
        
-
 
146
        
-
 
147
        if ( game.stage == 0 ) {
-
 
148
            game_textout_at_center( 0, GAME_HEIGHT + 50 - game.stage_timer*(GAME_HEIGHT+50)/50, 1, "LEVEL 1" );
-
 
149
            game_textout_at_center( 0, GAME_HEIGHT*2/3, 2, L_TECHDEMO_LINE1 );
-
 
150
        }
-
 
151
        else {
-
 
152
            
-
 
153
            char s_score[] = "000";
-
 
154
            s_score[0] += game.score / 100;
-
 
155
            s_score[1] += (game.score / 10) % 10;
95
                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-4, game.bullet_y[i], 0xFF00BB00);
156
            s_score[2] += (game.score / 1) % 10;
-
 
157
            
-
 
158
            game_textout_at_center(0, 10, 3, s_score);
-
 
159
            
-
 
160
            
-
 
161
        };
-
 
162
        
-
 
163
        
-
 
164
        
-
 
165
        
-
 
166
        char s_health[] = "HEALTH: 0 ";
-
 
167
        char s_ammo[] = "AMM0: 00 ";
-
 
168
        
-
 
169
        s_health[8] += game.health;
-
 
170
        s_ammo[6] += game.ammo / 10;
-
 
171
        s_ammo[7] += game.ammo % 10;
-
 
172
        
96
                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-3, game.bullet_y[i], 0xFF00CC00);
173
        game_textout(8, 8, 2, s_health);
Line -... Line 174...
-
 
174
        game_textout(GAME_WIDTH - 12 - GAME_AMMO_MAX*2 - 1, 8, 2, s_ammo);
-
 
175
        
97
                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-2, game.bullet_y[i], 0xFF00DD00);
176
        for (i = 0; i < game.ammo; i++) {
-
 
177
            texture_draw_vline(&game.framebuffer, GAME_WIDTH - 12 - GAME_AMMO_MAX*2 + i*2, 20, 8, 0xFF3366FF );
-
 
178
        };
98
                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-1, game.bullet_y[i], 0xFF00EE00);
179
        
-
 
180
        int health_color = 0xFF339933;
Line -... Line 181...
-
 
181
        if (game.health < 5) {
-
 
182
            health_color = 0xFF808010;
-
 
183
        };
-
 
184
        if (game.health < 3) {
99
                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-0, game.bullet_y[i], 0xFF00FF00);
185
            health_color = 0xFFFF3300;
Line -... Line 186...
-
 
186
        };
-
 
187
 
-
 
188
        for (i = 0; i < game.health; i++) {
-
 
189
            texture_draw_vline(&game.framebuffer, 8 + i*4 + 0, 20, 8, health_color  );
-
 
190
            texture_draw_vline(&game.framebuffer, 8 + i*4 + 1, 20, 8, health_color  );
-
 
191
            texture_draw_vline(&game.framebuffer, 8 + i*4 + 2, 20, 8, health_color  );
-
 
192
        };
-
 
193
        
-
 
194
 
-
 
195
        
100
            };
196
        
Line 101... Line 197...
101
        };
197
//        game_textout( 2, 12, 2, L_TECHDEMO_LINE2 );