/programs/games/heliothryx/game/rsgame.c |
---|
218,6 → 218,23 |
snd->data[i] = ( 1.0 - 1.0*i/snd->length_samples ) * sin( ( (1.0 - 0.48*i/snd->length_samples) * freq ) *i) * amp; |
}; |
/* |
// ok |
rs_sgen_init(2, snd->length_samples); |
rs_sgen_func_pm(1, 880.0, 21.0, 0.3, 110.0, 0.3); |
rs_sgen_func_normalize(1, 1.0); |
rs_sgen_func_lowpass(0, 1, 1.0, 0.0, 1.0); |
rs_sgen_wave_out(0); |
memcpy(snd->data, rs_sgen_reg.wave_out, snd->length_samples*2 ); |
rs_sgen_term(); |
*/ |
rskos_snd_update_buffer(&snd->hbuf, snd->data, snd->length_samples); |
}; |
242,6 → 259,9 |
void game_reg_init() { |
// game.tx = 0; |
// game.ty = 0; |
// game.tz = 0; |
game.player_x = 0; |
game.player_y = 0; |
249,6 → 269,13 |
game.bg_color = COLOR_BLACK; |
// int i; |
// for (i = 0; i < BULLETS_COUNT; i++) { |
// game.bullet_x[i] = 0; |
// game.bullet_y[i] = 0; |
// }; |
// game.bullet_index = 0; |
game.objs = malloc( sizeof(game_obj_t) * GAME_OBJS_MAX_COUNT ); |
game.status = STATUS_MENU; |
/programs/games/heliothryx/game/rsgame.h |
---|
123,6 → 123,10 |
int t; |
float f; |
// int health; |
// int reserved0; |
// int reserved1; |
// int reserved2; |
} game_obj_t; |
#define OBJ_FLAG_DESTROYED 0x01 |
160,6 → 164,7 |
#define RS_ARROW_RIGHT_MASK 0x08 |
#define RS_ATTACK_KEY_MASK 0x10 |
//#define BULLETS_COUNT 8 |
#define GAME_SHOOT_PERIOD 3 |
213,11 → 218,17 |
int window_scale; |
// int tx1; |
// int ty1; |
int tz; |
int player_x; |
int player_y; |
// int player_z; |
// int bullet_x[BULLETS_COUNT]; |
// int bullet_y[BULLETS_COUNT]; |
// int bullet_index; |
int shoot_delay; |
int shoot_keypressed; |
int shoot_restore_delay; |
/programs/games/heliothryx/game/rsgamedraw.c |
---|
16,6 → 16,16 |
int kk = 20; // (rskos_get_time()/1) % 160; |
// |
// unsigned char *c = game.framebuffer.data; |
// |
// int i; |
// for (i = 0; i < w*h*4; i+=4) { |
// c[i+0] = 10; // i/w/3; |
// c[i+1] = (( (1*i)*(i + kk)/70) & 5) ? 70 : 0; |
// c[i+2] = 50; |
// c[i+3] = i % 128; |
// }; |
texture_clear(&game.framebuffer, game.bg_color ); |
22,9 → 32,18 |
game.bg_color = COLOR_BLACK; |
// texture_clear(&game.tex); |
// texture_draw(&game.framebuffer, &game.tex, 40, 40, DRAW_MODE_ADDITIVE); |
// texture_draw(&game.framebuffer, &game.tex, 70, 50, DRAW_MODE_ADDITIVE); |
// texture_draw(&game.framebuffer, &game.tex, 20, 60, DRAW_MODE_ADDITIVE); |
// texture_draw(&game.framebuffer, &game.tex, 60, 70, DRAW_MODE_ADDITIVE); |
// |
// texture_draw(&game.framebuffer, &game.tex, 111, 150, DRAW_MODE_ADDITIVE); |
int i, c, c2, c3; |
for (i = 0; i < 100; i++) { |
// DEBUG10f("i = %d, v1 = %.4f, v2 = %.4f \n", i, rs_noise(kk+100, kk+i)*10, rs_noise(kk+200, kk+i+300)*10); |
c = (0.5+0.45*rs_noise(kk+150, kk+i))*255; |
c2 = c + 0.05*rs_noise(kk+150, kk+i)*255; |
c3 = c2; // (0.5+0.49*rs_noise(kk+150, kk+i+2))*255; |
190,6 → 209,9 |
// game_textout( 2, 12, 2, L_TECHDEMO_LINE2 ); |
}; |
texture_draw(&game.tex_ground, &game.tex_clouds, game.tz, 0, /* game.tx, game.ty, */ DRAW_MODE_ADDITIVE | DRAW_TILED_FLAG ); |
/programs/games/heliothryx/game/rsgamemenu.c |
---|
21,7 → 21,7 |
- letter a...z means action (a = 0th, b = 1st, c = 2nd, see menu_actions[] above) |
- number 0...9 means goto menu #0, #1, #2... see menu_titles[] below |
- space ' ' means no action, menu item is unselectable |
- empty string "" is not allowed and can cause segfault |
- empty string "" is now allowed and can cause segfault |
String from second char is label of menu item |
*/ |
60,6 → 60,12 |
0 |
}; |
//char* menu_game_over_titles[] = { |
// " "L_GAME_OVER, |
// " ", |
// "0"L_BACK, |
// 0 |
//}; |
char* menu_pause_titles[] = { |
" "L_PAUSE, |
74,6 → 80,7 |
/* 0 */ menu_main_titles, |
/* 1 */ menu_settings_titles, |
/* 2 */ menu_about_titles, |
// /* 3 */ menu_level_passed_titles, |
/* 3 */ menu_game_over_titles, |
/* 4 */ menu_pause_titles, |
0 |
/programs/games/heliothryx/game/rsgamemenu.h |
---|
10,6 → 10,7 |
#define MENU_MAIN 0 |
#define MENU_SETTINGS 1 |
#define MENU_ABOUT 2 |
//#define MENU_LEVEL_PASSED 3 |
#define MENU_GAME_OVER 3 |
#define MENU_PAUSE 4 |