mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-03 12:23:56 +00:00
rogueviz::ads:: main help, help for DS game
This commit is contained in:
parent
8dac0e0f68
commit
9c9b37f2fb
@ -89,7 +89,7 @@ void restart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void run_ads_game_hooks() {
|
void run_ads_game_hooks() {
|
||||||
rogueviz::rv_hook(hooks_global_mouseover, 100, ads_mouseover);
|
rogueviz::rv_hook(hooks_global_mouseover, 100, generate_mouseovers);
|
||||||
rogueviz::rv_change<color_t>(titlecolor, 0);
|
rogueviz::rv_change<color_t>(titlecolor, 0);
|
||||||
rogueviz::rv_hook(hooks_frame, 100, view_ads_game);
|
rogueviz::rv_hook(hooks_frame, 100, view_ads_game);
|
||||||
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
|
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
|
||||||
|
@ -91,7 +91,7 @@ bool handleKey(int sym, int uni) {
|
|||||||
if(sym == 'v') pushScreen(game_menu);
|
if(sym == 'v') pushScreen(game_menu);
|
||||||
if(sym == SDLK_ESCAPE) pushScreen(game_menu);
|
if(sym == SDLK_ESCAPE) pushScreen(game_menu);
|
||||||
if(sym == SDLK_F1) {
|
if(sym == SDLK_F1) {
|
||||||
if(help == "@") help = "help not known";
|
if(help == "@") help = get_main_help();
|
||||||
gotoHelp(help);
|
gotoHelp(help);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -501,6 +501,8 @@ bool invalid(cross_result& res) {
|
|||||||
|
|
||||||
void view_ds_game() {
|
void view_ds_game() {
|
||||||
displayed.clear();
|
displayed.clear();
|
||||||
|
mousetester = kleinize(unshift(mouseh));
|
||||||
|
under_mouse.clear();
|
||||||
|
|
||||||
bool hv = hyperbolic;
|
bool hv = hyperbolic;
|
||||||
bool hvrel = among(pmodel, mdRelPerspective, mdRelOrthogonal);
|
bool hvrel = among(pmodel, mdRelPerspective, mdRelOrthogonal);
|
||||||
@ -510,6 +512,8 @@ void view_ds_game() {
|
|||||||
copyright_shown = "";
|
copyright_shown = "";
|
||||||
if(!hv) draw_textures();
|
if(!hv) draw_textures();
|
||||||
|
|
||||||
|
bool only_main = false;
|
||||||
|
|
||||||
if(1) {
|
if(1) {
|
||||||
for(auto& r: rocks) {
|
for(auto& r: rocks) {
|
||||||
auto& rock = *r;
|
auto& rock = *r;
|
||||||
@ -546,6 +550,12 @@ void view_ds_game() {
|
|||||||
|
|
||||||
vector<hyperpoint> circle_flat;
|
vector<hyperpoint> circle_flat;
|
||||||
for(auto c: rock.pts) circle_flat.push_back(c.h / (1 + c.h[2]));
|
for(auto c: rock.pts) circle_flat.push_back(c.h / (1 + c.h[2]));
|
||||||
|
|
||||||
|
if(rock.type != oParticle && pointcrash(mousetester, rock.pts)) {
|
||||||
|
if(only_main) break;
|
||||||
|
if(&rock == main_rock) { under_mouse.clear(); only_main = true; }
|
||||||
|
under_mouse.push_back(&rock);
|
||||||
|
}
|
||||||
|
|
||||||
ld area = 0;
|
ld area = 0;
|
||||||
for(int i=0; i<isize(circle_flat)-1; i++)
|
for(int i=0; i<isize(circle_flat)-1; i++)
|
||||||
@ -743,6 +753,8 @@ void run_ds_game_hooks() {
|
|||||||
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
|
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
|
||||||
rogueviz::rv_hook(hooks_handleKey, 150, handleKey);
|
rogueviz::rv_hook(hooks_handleKey, 150, handleKey);
|
||||||
rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation);
|
rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation);
|
||||||
|
rogueviz::rv_hook(hooks_global_mouseover, 100, generate_mouseovers);
|
||||||
|
rogueviz::rv_change<color_t>(titlecolor, 0xFFC000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_ds_game() {
|
void run_ds_game() {
|
||||||
|
@ -247,4 +247,7 @@ void save_to_hiscores();
|
|||||||
void hiscore_menu();
|
void hiscore_menu();
|
||||||
void load_hiscores();
|
void load_hiscores();
|
||||||
|
|
||||||
|
string get_main_help();
|
||||||
|
int generate_mouseovers();
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
@ -101,7 +101,7 @@ void explain_undermouse() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ads_mouseover() {
|
int generate_mouseovers() {
|
||||||
titlecolor = 0xFFFFFF;
|
titlecolor = 0xFFFFFF;
|
||||||
|
|
||||||
if(!paused) {
|
if(!paused) {
|
||||||
@ -115,6 +115,7 @@ int ads_mouseover() {
|
|||||||
|
|
||||||
hyperpoint h1 = normalize(unshift(mouseh));
|
hyperpoint h1 = normalize(unshift(mouseh));
|
||||||
hybrid::in_actual([&] {
|
hybrid::in_actual([&] {
|
||||||
|
if(main_rock) return;
|
||||||
h1[3] = h1[2]; h1[2] = 0;
|
h1[3] = h1[2]; h1[2] = 0;
|
||||||
ads_point rel = ads_inverse(current * vctrV) * ads_point(h1, 0);
|
ads_point rel = ads_inverse(current * vctrV) * ads_point(h1, 0);
|
||||||
cell *c = hybrid::get_at(vctr, 0);
|
cell *c = hybrid::get_at(vctr, 0);
|
||||||
@ -142,5 +143,16 @@ int ads_mouseover() {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string get_main_help() {
|
||||||
|
if(main_rock)
|
||||||
|
return
|
||||||
|
"Keep close to the yellow star! The space is expanding, so if you go too far away from it, you will never be able to get back.\n\n"
|
||||||
|
"You have to avoid (or shoot) the white asteroids which are continuously thrown at you. In longer runs, you also need to catch items to replenish your resources.\n\n"
|
||||||
|
"Good luck!\n\nSee the Guided Tour for more explanation about how de Sitter spacetime used in this game works.";
|
||||||
|
else return
|
||||||
|
"Explore the world, shoot asteroids and enemies, collect treasures and resources. The more treasures you collect, the harder the game becomes. Good luck!\n\n"
|
||||||
|
"See the Guided Tour for more explanation about how anti-de Sitter spacetime used in this game works.";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user