private void SpawnTentacle(int FireRate, bool isMoving) { rand = new Random(); int rnd = rand.Next(-251, 250); if (this.VariableD > 160 / FireRate) { string d = "t"; Vector2 AddedDisplacement = new Vector2(-(Textures.GetTexture("L").Width *sqobject.Size) - 1, -Textures.GetTexture("L").Height - 2); if (this.sqobject.Flipeffect == SpriteEffects.None) { d = "f"; AddedDisplacement += new Vector2((sqobject.Texture.Width * sqobject.Size) + Textures.GetTexture("L").Width + 2, 0f); } if (isMoving) { EntityList.Add(new Entity("L", "L", "L", this.sqobject.Position + AddedDisplacement, 300, 1, "L", new SquareObject.Damage(1, 1, 1, 1), new SquareObject.Bounce(40, 10, 10, 20), 10f, 100, d, false, 0, 0, 0)); } else { EntityList.Add(new Entity("L", "L", "L", this.sqobject.Position + AddedDisplacement, 300, 1f, "Particle", new SquareObject.Damage(1, 1, 1, 1), new SquareObject.Bounce(40, 10, 10, 20), 10f, 100, d, false, 0, 0, 0)); } EntityList[EntityList.Count - 1].sqobject.Velocity = new Vector2((float)((rnd + 700f) / 80f) * (d == "t" ? -1: 1), -2f + (((float)(rnd - 400)) / 130f)); this.VariableD = 0f; //this.sqobject.Velocity -= Math.Sign(AddedDisplacement.X) * new Vector2(6, 0f); } this.VariableD++; }
public static void Draw(SpriteBatch spriteBatch) { //Rectangle? CS$0$0000 = null; spriteBatch.Draw(Textures.GetTexture("Cursor"), new Vector2((float)InputManager.Mousestate[0].X, (float)InputManager.Mousestate[0].Y), null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f); DrawButtons_Labels(spriteBatch); spriteBatch.Draw(Textures.GetTexture("Pause_Menu"), new Vector2(210f, 86f), null, new Color(1f, 1f, 1f, 0.9f), 0f, Vector2.Zero, 1f, 0, 0.9f); }
private static void DrawMisc(SpriteBatch spriteBatch) { spriteBatch.Draw(Textures.GetTexture("Cursor"), new Vector2((float)InputManager.Mousestate[0].X, (float)InputManager.Mousestate[0].Y), null, Color.White, 0f, Vector2.Zero, 1f, 0, 1f); if (InputBox.Active) { InputBox.Draw(spriteBatch); } if (MessageBox.GameMessage != null) { MessageBox.GameMessage.Draw(spriteBatch, false); } if (MessageBox.StatusMessage != null) { MessageBox.StatusMessage.Draw(spriteBatch, true); } if (PConsole.Active) { PConsole.Draw(spriteBatch); } if (LabelList != null) { if (SelectedEntity != -1 && !ScreenManager.Paused) { foreach (TextSprite ts in LabelList) { spriteBatch.DrawString(ts.Spritefont, ts.Text, ts.Position, ts.Colour, 0f, Vector2.Zero, 1f, 0, 0.999f); } Button.DrawAll(spriteBatch); TextSprite.DrawAll(spriteBatch); } } }
public static void DrawAll(SpriteBatch spriteBatch) { if (ObjectList != null) { foreach (FallingObject o in ObjectList) { spriteBatch.Draw(Textures.GetTexture(o.Texture), o.Position, null, o.Colour, 0f, Vector2.Zero, o.Scale, SpriteEffects.None, 1); } } }
public new void Draw(SpriteBatch spriteBatch) { if (this.Type == 2) { spriteBatch.Draw(Textures.GetTexture("Sign"), base.Position + Level.Offset, null, Color.White, 0f, Vector2.Zero, 1f, 0, base.Layer); } else { base.Draw(spriteBatch); } }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Textures.GetTexture("Pause_Menu"), new Vector2(200f, 100f), null, Color.WhiteSmoke, 0f, Vector2.Zero, 1f, 0, 0.9996f); for (int h = 0; h < this.MessageList.Length; h++) { spriteBatch.DrawString(this.MessageList[h].Spritefont, this.MessageList[h].Text, this.MessageList[h].Position, this.MessageList[h].Colour, 0f, Vector2.Zero, 1f, 0, 0.9998f); } for (int i = 0; i < this.ButtonList.Count; i++) { this.ButtonList[i].Draw(spriteBatch); } }
public PopupBox(string[] message, PopupType type) { this.MessageList = new TextSprite[message.Length]; //this.MessageList[0] = new TextSprite(message[0], "Small", new Vector2(300f, 110f), Color.Red); for (int i = 0; i < message.Length; i++) { float PositionX = (Textures.GetTexture("Pause_Menu").Width - Textures.GetFont("Medium").MeasureString(message[i]).X) / 2f + 200; this.MessageList[i] = new TextSprite(message[i], "Medium", new Vector2(PositionX, (float)(140 + (30 * i))), Color.Red); } this.ButtonList = new List <Button>(); this.ButtonList.Add(new Button(new TextSprite("Yes", "Small", new Vector2(200f, 250f), Color.Red), new Vector2(263f, 255f), 4, 0.9998f)); this.ButtonList.Add(new Button(new TextSprite("No", "Small", new Vector2(445f, 250f), Color.Red), new Vector2(415f, 255f), 4, 0.9998f)); this.type = type; }
public void Draw(SpriteBatch spriteBatch, bool isStatus = false) { Color colour = new Color(isStatus ? 0.9f: 0.75f, isStatus? 0.6f : 0.1f, isStatus ? 0.9f : 0.75f, 1); float alpha = 0.035f * this.LifeTime; float brightness = alpha > 0.4f ? 0.2f : 0; Color backgroundColour = new Color(brightness, brightness, 0.5f + brightness, alpha > 0.4f ? alpha : 0f); if (LifeTime < 61) { colour = new Color(this.LifeTime / 80f, this.LifeTime / 100f, this.LifeTime / 80f, 0.035f * this.LifeTime); } if (isStatus) { spriteBatch.Draw(Textures.GetTexture("StatusBackground"), startLocation + new Vector2(-10, 17), null, backgroundColour, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9999f); } spriteBatch.DrawString(Textures.GetFont("Medium"), this.Row, startLocation, colour, 0f, Vector2.Zero, 1f, 0, 1f); }
public static void Draw(SpriteBatch spriteBatch, string nameLabel, string jobLabel) { spriteBatch.Draw(Textures.GetTexture("JobDescriptionBackground"), BackgroundPosition, null, new Color(1f, 1f, 1f, 0.5f), 0f, Vector2.Zero, 1f, 0, 0.9992f); string title = ""; string description = ""; if (nameLabel != "" && jobLabel != "") { title = nameLabel + "(" + jobLabel + ")"; description = getEntityDescription(nameLabel, jobLabel); } else if (nameLabel != "") { title = nameLabel; } spriteBatch.DrawString(titleLabel.Spritefont, title, titleLabel.Position, titleLabel.Colour, 0, Vector2.Zero, 1, 0, 0.9995f); spriteBatch.DrawString(descriptionLabel.Spritefont, description, descriptionLabel.Position, descriptionLabel.Colour, 0f, Vector2.Zero, 1f, 0, 0.9995f); }
public static void Draw(SpriteBatch spriteBatch) { if (ScreenManager.Mainmenu || ScreenManager.Levelselect) { if (ScreenManager.Credits) { spriteBatch.Draw(Textures.GetTexture("SkyB"), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0.8f); } else { spriteBatch.Draw(Textures.GetTexture("SkyA"), Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, 0, 0.8f); } spriteBatch.Draw(Textures.GetTexture("Cursor"), new Vector2((float)InputManager.Mousestate[0].X, (float)InputManager.Mousestate[0].Y), null, Color.White, 0f, Vector2.Zero, 1f, 0, 1f); Button.DrawAll(spriteBatch); LevelButton.DrawAll(spriteBatch); TextSprite.DrawAll(spriteBatch); FallingObject.DrawAll(spriteBatch); } }
public static void Draw(SpriteBatch spriteBatch) { DrawButtonsAndLabels(spriteBatch); if (Editor.CurrentBlock != null) { for (int i = 0; i < Editor.BrushSize; i++) { for (int j = 0; j < Editor.BrushSize; j++) { Editor.CurrentBlock.DrawFixed(spriteBatch, new Vector2((float)(i * 0x19), (float)(j * 0x19))); } } } if (Editor.CurrentCollectable != null) { Editor.CurrentCollectable.DrawFixed(spriteBatch); } JobDescription.Draw(spriteBatch, LabelList[0].Text, LabelList[1].Text); spriteBatch.Draw(Textures.GetTexture("EPause_Menu"), new Vector2(20f, 15f), null, new Color(1f, 1f, 1f, 0.7f), 0f, Vector2.Zero, 1f, 0, 0.9f); }
private void Cannon(int FireRate) { if (this.Job.Contains("M")) { this.sqobject.Velocity = Vector2.Zero; } if (this.VariableD > 300 - (30 * FireRate)) { string d = "t"; Vector2 AddedDisplacement = new Vector2(-(Textures.GetTexture("LazerBullet").Width *sqobject.Size) - 1, (this.sqobject.Texture.Height / 2f) - 2); if (this.sqobject.Flipeffect == SpriteEffects.None) { d = "f"; AddedDisplacement += new Vector2((sqobject.Texture.Width * sqobject.Size) + Textures.GetTexture("LazerBullet").Width + 2, 0f); } EntityList.Add(new Entity("LazerBullet", "LazerBullet", "LazerBullet", this.sqobject.Position + AddedDisplacement, 1000, 1f, "Lazer", new SquareObject.Damage(1, 1, 1, 1), new SquareObject.Bounce(2, 2, 2, 2), 50f, 50, d, false, 0, 0, 0)); this.VariableD = 0f; this.sqobject.Velocity -= Math.Sign(AddedDisplacement.X) * new Vector2(6, 0f); } this.VariableD++; }
public NewLevelButton(string name, Vector2 position) : base(LevelSaver.CustomLevelsPath + name, position, Textures.GetTexture("6")) { }
public static void DrawKey(SpriteBatch spriteBatch, Vector2 Position, string Texture) { spriteBatch.Draw(Textures.GetTexture(Texture), Position, null, Color.WhiteSmoke, 0, Vector2.Zero, 0.5f, SpriteEffects.None, 0.95f); }
public virtual void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Thumbnail, this.Position + Level.Offset + ImageOffset, null, this.ThumbnailColour, 0, Vector2.Zero, 1, SpriteEffects.None, 0.895f); spriteBatch.Draw(Textures.GetTexture("Button2"), this.Position + Level.Offset, null, this.Colour, 0f, Vector2.Zero, 1f, 0, 0.89f); DrawLabels(spriteBatch); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.DrawString(this.label.Spritefont, this.label.Text, this.label.Position, this.label.Colour, 0f, Vector2.Zero, 1f, 0, 0.94f); spriteBatch.DrawString(textSprite.Spritefont, textSprite.Text, textSprite.Position, textSprite.Colour, 0f, Vector2.Zero, 1f, 0, 0.991f); spriteBatch.Draw(Textures.GetTexture("1"), this.position, null, Color.White, 0f, Vector2.Zero, 1f, 0, 0.99f); }