public ParticleEmitter(ParticleData data) { if (r == null) r = new Random(); particleData = data; particles = new List<Particle>(); ngon = new nGonBuilder(Color.White); }
public AchievementToken(int l, String comment) { level = l; nBuild = new nGonBuilder(levelColor[l]); font = Tesseract.Engine.Content.ContentManager.Load<SpriteFont>("ScoreFont"); time = 5; achievement = comment; alive = true; }
public ScoreDrop(Vector2 pos, float rot) { Position = pos; Rotation = rot; size = 0; time = 0; ngon = new nGonBuilder(Color.White); player = GameManager.State.FindObject<Player>(); velocity = new Vector2((float)r.NextDouble() - 0.5f, (float)r.NextDouble() - 0.5f) * 0.025f; }
public OrbBoss() : base(new Microsoft.Xna.Framework.Vector2(Screen.X, 0)) { Tesseract.Engine.GameWorld.GameState.InstantiateCurrent(new StoryElement(LevelManager.world.Reward)); r = new Random(); left = r.NextDouble() > 0.5; up = r.NextDouble() < 0.5; DrawBackgroundColor = false; nBuild = new nGonBuilder(Color.Yellow); health = 40; lastMult = (health / 10) - 1; }
public LevelSpawner(float spawnRate, int number, Vector2 pos, int archtype, int subtype) { builder = new nGonBuilder(Color.White); startup = 0; onlyOne = false; timer = spawnRate; spawnRATE = spawnRate; runner = true; num = number; this.archtype = archtype; this.subtype = subtype; Position = new Vector2(pos.X * Screen.X, pos.Y * Screen.Y); }
public UpgradeOverlay(SpriteBatch batch) { p = GameManager.State.FindObject<Player>(); current = 0; pointsSpent = 0; this.batch = batch; font = ContentManager.Load<SpriteFont>("UpgradeFont"); upgLvl = new int[4] { 3, 3, 3, 3 }; selected = new bool[4] { false, false, false, false }; transparentColor = Color.Gray; transparentColor.A = 200; textLoc = new Vector2[4]; scale = Screen.Scale; upgrade = new nGonBuilder[4]; text = new String[4]; upgLoc = new Vector2[4]; oldState = Keyboard.GetState(); for(int i=0;i<4;i++) upgrade[i] = new nGonBuilder(Color.Black); }
public void Draw() { Upgrades(); if (show) { //draw onscreen overlay scale = Screen.Scale; bg = new Texture2D(ContentManager.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); bg.SetData(new[] { transparentColor }); batch.Begin(); batch.Draw(bg, overlay, Color.White); //changes color based when selected for (int i = 0; i < 4; i++) { if (selected[i]) { //upgrade[i].nGon(batch, upgLoc[i], 100 * scale / 4, upgLvl[i], -(float)Math.PI / 2 * 3); upgrade[i] = new nGonBuilder(Color.Gold); } else upgrade[i] = new nGonBuilder(Color.Black); } for (int i = 0; i < 4; i++) { //draw upgrade ngons upgrade[i].nGon(batch, upgLoc[i], 150 * scale/4, upgLvl[i],(float)Math.PI/2*3); } for (int i = 0; i < 4; i++) { //draw text for each uprade batch.DrawString(font, text[i], textLoc[i] - (font.MeasureString(text[i]) / 2) * scale / 2, Color.Black, 0, new Vector2(0, 0), scale / (2), SpriteEffects.None, 0); } String s = "Enter to Confirm," + "Points Available " + (GameManager.State.FindObject<Player>().getScore() - pointsSpent).ToString(); batch.DrawString(font, s, new Vector2(Screen.Width / 2, Screen.Height/2) - (font.MeasureString(s) / 2) * scale / 2, Color.Black, 0, new Vector2(0, 0), scale / 2, SpriteEffects.None, 0); batch.End(); } }
public void Draw() { Upgrades(); if (show) { //draw onscreen overlay scale = Screen.Scale; bg = new Texture2D(ContentManager.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); bg.SetData(new[] { transparentColor }); batch.Begin(); batch.Draw(bg, overlay, Color.Black); //Gives button option to exit game Vector2 exitString = new Vector2(-Screen.X, -Screen.Y); string exitText = "Press Backspace to exit."; batch.DrawString(font, exitText, exitString, Color.White, 0, new Vector2(0, 0), scale / (2), SpriteEffects.None, 0); //changes color based when selected for (int i = 0; i < 4; i++) { if (selected[i]) { //upgrade[i].nGon(batch, upgLoc[i], 100 * scale / 4, upgLvl[i], -(float)Math.PI / 2 * 3); upgrade[i] = new nGonBuilder(Color.Gold); } else upgrade[i] = new nGonBuilder(Color.Lerp(Color.White, Color.Transparent, 0.5f)); } for (int i = 0; i < 4; i++) { //draw upgrade ngons upgrade[i].nGon(batch, upgLoc[i], 150 * scale/4, upgLvl[i],(float)Math.PI/2*3); } for (int i = 0; i < 4; i++) { //draw text for each uprade batch.DrawString(font, text[i], textLoc[i] - (font.MeasureString(text[i]) / 2) * scale / 2, Color.White, 0, new Vector2(0, 0), scale / (2), SpriteEffects.None, 0); } String s = "Enter to Confirm," + "Points Available " + (Tesseract.Engine.HighscoreHandler.score - pointsSpent).ToString(); batch.DrawString(font, s, new Vector2(Screen.Width / 2, Screen.Height/2) - (font.MeasureString(s) / 2) * scale / 2, Color.White, 0, new Vector2(0, 0), scale / 2, SpriteEffects.None, 0); batch.End(); } }