ru:: ferris platforms have period and can be last_platform

This commit is contained in:
Zeno Rogue
2026-04-13 20:24:40 +02:00
parent 089113bc32
commit 110fcf5297
3 changed files with 7 additions and 2 deletions
+1
View File
@@ -485,6 +485,7 @@ struct moving_platform : public entity {
};
struct ferris_platform : public moving_platform {
ld period;
xy location_at(ld t) override;
string get_name() override { return "Ferris platform"; }
string get_help() override { return "Ferris wheel platforms, powered by some ancient mechanism. They always go in perfect circles, with constant velocity."; }
+1 -1
View File
@@ -626,7 +626,7 @@ void avoid::act() {
}
xy ferris_platform::location_at(ld t) {
return from_hyper(rgpushxto0(to_hyper(ctr)) * xspinpush0(t / game_fps + shift, radius));
return from_hyper(rgpushxto0(to_hyper(ctr)) * xspinpush0(t / game_fps / period * TAU + shift, radius));
}
xy rope_platform::location_at(ld t) {
+5 -1
View File
@@ -317,12 +317,16 @@ void load_room(fhstream& f, cell *c) {
r.entities.emplace_back(std::move(b));
}
else if(cap == "FERRIS") {
ld cx = get_ld(), cy = get_ld(), radius = get_ld(); int qty = get_int();
ld cx = get_ld(), cy = get_ld(), radius = get_ld(); int qty = get_int(); ld period = get_ld();
last_platform = {};
for(int i=0; i<qty; i++) {
auto b = std::make_unique<ferris_platform>();
b->ctr = {cx, cy}; b->radius = radius;
b->shift = i * TAU / qty;
b->period = period;
last_platform.push_back(&*b);
r.entities.emplace_back(std::move(b));
}
}