Ah, I see. In any case static functions won’t be able to help here, they’re not applicable.
What you need to do is to cast the reference to the world from the base class World
to the derived class GameWorld
, and then access the method. You can do this in three ways - either instantly:
(world as GameWorld).setDoorText(...)
Or by declaring a local variable:
var gameWorld:GameWorld = world as GameWorld;
gameWorld.setDoorText(...)
Or by having that variable cached at entity level (or wherever you’re calling it from).
One point is that FP.world
should ONLY be used to change the active world, otherwise odd unexpected behaviours can crop up. To get a reference to the current world, from an entity just use world
(except in the constructor… but that’s another story).