public MainMenu() : base(1920, 1080) { AddGraphic(background); background.Scroll = 0; AddGraphic(corners); credits.X = 250; credits.Y = 960; credits.CenterOrigin(); AddGraphic(credits); lights.Clear(); background.Shader = new Shader(ShaderType.Fragment, "assets/shaders/water_wave.frag"); ambientLighting = new Surface(1920, 1080); lightSurface = new Surface(1920, 1080); Add(new Logo(421, 542, "assets/gfx/logo.png")); // Play/How To/Quit buttons playButton = Add(new Logo(1486, 440, "assets/gfx/play.png", 14.0f)); howToButton = Add(new Logo(1544, 540, "assets/gfx/howto.png", 14.0f)); quitButton = Add(new Logo(1480, 640, "assets/gfx/quit.png", 14.0f)); menuLight = new Light(0, 0.1f); menuLight.entity = playButton; menuLight.SetAlpha(1.0f, 0.7f); menuLight.SetAlphaSpan(1.1f); menuLight.SetOffset(175, 100); lights.Add(menuLight); }
public LightningArea(float x, float y, Vector2 direction) : base(x, y, direction, 0.1f, 110, 1.7f, 1, (int)Tags.PROJECTILE, (int)Tags.PLAYERATTACK) { light = new Light(); light.SetAlpha(0.5f, 0.7f); light.SetAlphaSpan(0.3f); light.SetColor(new Color("FFD700")); light.SetColorSpan(5.0f); light.SetRadius(300, 355); light.SetRadiusSpan(0.07f); light.entity = this; Level.lights.Add(light); }
public Player(float x, float y, Session session) : base(x, y) { // Assign session this.session = session; // Init bounce sounds bounce[0] = new Sound("assets/sfx/bounce1.wav"); bounce[1] = new Sound("assets/sfx/bounce2.wav"); bounce[2] = new Sound("assets/sfx/bounce3.wav"); for (int i = 0; i < 3; ++i) { bounce[i].Volume = 0.98f; } // Set up animations sprite.Add(AnimType.Go, new Anim(new int[] { 0, 1, 2, 3, 4, }, new float[] { 5.0f })); sprite.Add(AnimType.Attack, new Anim(new int[] { 7, 8, 9, 10, 11, 12, 13 }, new float[] { 4.0f })); sprite.Play(AnimType.Go); // Set up hitboxes SetHitbox(sprite.Width - 24, sprite.Height - 24, (int)Tags.PLAYER); Hitbox.CenterOrigin(); // Sprite stuff sprite.CenterOrigin(); Graphic = sprite; Layer = -1; // Initilize light light = new Light(); light.SetAlpha(0.7f); light.SetColor(new Color("879DFF"), new Color("62D8E0")); light.SetColorSpan(5.0f); light.SetRadius(sprite.Width + 30, sprite.Width + 60); light.SetRadiusSpan(5.0f); light.entity = this; Level.lights.Add(light); // TODO: Make ink slow you down }
private IEnumerator EnjoyLife() { sprite.Alpha -= 0.2f; yield return Coroutine.Instance.WaitForFrames(4); light = new Light(0, 0.7f); light.SetAlpha(1.0f); light.SetColor(Color.Black); light.SetRadius(650); light.entity = this; Level.darkness.Add(light); float length = 10.0f; for (float timer = 0; timer < length; timer += Game.RealDeltaTime * 0.001f) { // TODO: Put out little "explosions" sprite.Alpha -= 0.01f; yield return 0; } light.FadeOut(10.0f); yield return Coroutine.Instance.WaitForSeconds(10.0f); RemoveSelf(); }
/*public override void Render() { base.Render(); Collider.Render(); }*/ IEnumerator Destroy() { if (!destroyed) { SetHitbox(0, 0, (int)Tags.PROJECTILE); destroyed = true; } yield return Explosion(); if (light != null) { Level.lights.Remove(light); light = null; } RemoveSelf(); }