mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-09-05 20:48:51 +00:00
ru:: ferris platforms have period and can be last_platform
This commit is contained in:
@@ -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."; }
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user