public WorldRenderer(World world) { _world = world; _mapRenderer = new WorldMapRenderer(_world.Map); _timeBonusRenderer = new TimeBonusRenderer(_world.TimeBonuses); _springRenderer = new SpringRenderer(_world.Springs); _keyRenderer = new KeyRenderer(_world.Keys); _cannonRenderer = new CannonRenderer(_world.Cannons); _doorRenderer = new DoorRenderer(_world.Doors); _portalRenderer = new PortalRenderer(_world); }
public PortalRenderer(World world) { _world = world; const float InitialUpdateDelta = 0.016f; for (int i = 0; i < PortalParticle.Life / InitialUpdateDelta; i++) { for (int j = 0; j < _portalParticles.Count; j++) { _portalParticles[j].Update(InitialUpdateDelta); } _portalParticles.RemoveAll(particle => particle.Alpha <= 0); _timeSinceLastParticle += InitialUpdateDelta; while (_timeSinceLastParticle > PortalRenderer.TimeBetweenRects) { _timeSinceLastParticle -= PortalRenderer.TimeBetweenRects; _portalParticles.Add(new PortalParticle(_world.Portal.Area.Center, Vector2.Normalize(FlaiMath.GetAngleVector(_nextDirection)))); _nextDirection += PortalRenderer.DirectionStep; } } }
public Player(World world, Vector2i startingIndex) { _world = world; _position = startingIndex * Tile.Size; }
public Level(World world, int? stage) { _world = world; _player = new Player(_world, stage.HasValue ? _world.GetStageStartIndex(stage.Value) : _world.PlayerSpawnIndex); _gameClock = new GameClock(); }