rv::platformer:: slide

This commit is contained in:
Zeno Rogue 2022-02-27 00:01:20 +01:00
parent d8d5e2512d
commit 0aa338e9eb
1 changed files with 33 additions and 4 deletions

View File

@ -151,7 +151,6 @@ struct room {
void initial() {
int ylev = where->master->distance;
println(hlog, "ylev = ", ylev);
if(ylev <= 0)
for(int y=room_y-6; y<room_y; y++)
for(int x=0; x<room_x; x++)
@ -550,7 +549,7 @@ bool draw_room_on_map(cell *c, const shiftmatrix& V) {
p.tinf = &roomtinf;
p.offset_texture = 0;
p.texture_id = r.room_texture->textureid;
println(hlog, "offset = ", p.offset, " texture_offset = ", p.offset_texture);
// println(hlog, "offset = ", p.offset, " texture_offset = ", p.offset_texture);
auto render_at = [&] (GLuint texid, double px0, double py0, double px1, double py1,
double tx0, double ty0, double tx1, double ty1) {
@ -711,8 +710,20 @@ void run() {
dialog::add_key_action('z', [] {
pushScreen(shot::menu);
});
dialog::add_key_action('q', [] { exit(0); });
dialog::add_key_action('s', [] {
dialog::add_key_action('q', [] {
if(tour::on) tour::next_slide();
else exit(0);
});
dialog::add_key_action('o', [] {
if(tour::on) tour::next_slide();
});
dialog::add_key_action(SDLK_ESCAPE, [] {
if(tour::on) tour::next_slide();
});
dialog::add_key_action(SDLK_F10, [] {
if(tour::on) tour::next_slide();
});
dialog::add_key_action('s', [] {
mapstream::saveMap("platformer.lev");
});
@ -802,6 +813,24 @@ void add_platf_hooks() {
}
auto chk = arg::add3("-platformer", enable)
+ addHook_rvslides(195, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
v.push_back(tour::slide{
"platformer", 10, tour::LEGAL::NONE | tour::QUICKSKIP | tour::QUICKGEO,
"A non-Euclidean platformer. Press up/left/right to move the guy.\n"
,
[] (tour::presmode mode) {
slide_url(mode, 'y', "non-Euclidean platformer (YouTube)", "https://www.youtube.com/watch?v=eb2DhCcGH7U");
slide_url(mode, 't', "non-Euclidean platformer (Twitter)", "https://twitter.com/ZenoRogue/status/1467233150380089345");
slide_url(mode, 'g', "how to edit this", "https://github.com/zenorogue/hyperrogue/blob/master/rogueviz/platformer.cpp");
setCanvas(mode, '0');
using namespace tour;
if(mode == pmStart) {
mapstream::loadMap("platformer.lev");
}
}
});
})
+ addHook(mapstream::hooks_loadmap, 100, [] (fhstream& f, int id) {
if(id == 66) {
println(hlog, "loading platformer");