void CheckMousePosOnCLick() { MouseState mouseState = Mouse.GetState(); if (mouseState.LeftButton == ButtonState.Pressed) { //start gumb if (mouseState.X <= _UI[0].position.X + (_UI[0].texture.Width / 2) * 0.5f && mouseState.X >= _UI[0].position.X - (_UI[0].texture.Width / 2) * 0.5f && mouseState.Y <= _UI[0].position.Y + (_UI[0].texture.Height / 2) * 0.5f && mouseState.Y >= _UI[0].position.Y - (_UI[0].texture.Height / 2) * 0.5f) { this.Game.Components.Clear(); Scenes.Level level = new Scenes.Level(this.Game); this.Game.Components.Add(level); } //Leaderboard gumb if (mouseState.X <= _UI[1].position.X + (_UI[1].texture.Width / 2) * 0.5f && mouseState.X >= _UI[1].position.X - (_UI[1].texture.Width / 2) * 0.5f && mouseState.Y <= _UI[1].position.Y + (_UI[1].texture.Height / 2) * 0.5f && mouseState.Y >= _UI[1].position.Y - (_UI[1].texture.Height / 2) * 0.5f) { this.Game.Components.Clear(); Scenes.LeaderBoard level = new Scenes.LeaderBoard(this.Game); this.Game.Components.Add(level); } //Exit gumb if (mouseState.X <= _UI[2].position.X + (_UI[2].texture.Width / 2) * 0.5f && mouseState.X >= _UI[2].position.X - (_UI[2].texture.Width / 2) * 0.5f && mouseState.Y <= _UI[2].position.Y + (_UI[2].texture.Height / 2) * 0.5f && mouseState.Y >= _UI[2].position.Y - (_UI[2].texture.Height / 2) * 0.5f) { this.Game.Exit(); } } }
public WindyComponent(Scenes.Level level, Entity camera, float x, float y) { this.x = x; this.y = y; this.level = level; this.camera = camera; rand = new Random(Lichen.GlobalServices.GlobalRandom.Next()); }
public BulletComponent(Scenes.Level level, float x, float y, float vx, float vy) { this.level = level; this.x = x; this.y = y; this.vx = vx; this.vy = vy; }
void CheckMousePosOnCLick() { MouseState mouseState = Mouse.GetState(); if (mouseState.LeftButton == ButtonState.Pressed) { //main menu gumb if (mouseState.X <= _UI[0].position.X + (_UI[0].texture.Width / 2) * 0.5f && mouseState.X >= _UI[0].position.X - (_UI[0].texture.Width / 2) * 0.5f && mouseState.Y <= _UI[0].position.Y + (_UI[0].texture.Height / 2) * 0.5f && mouseState.Y >= _UI[0].position.Y - (_UI[0].texture.Height / 2) * 0.5f) { this.Game.Components.Clear(); Scenes.MainMenu menu = new Scenes.MainMenu(this.Game); this.Game.Components.Add(menu); } //retry gumb if (mouseState.X <= _UI[1].position.X + (_UI[1].texture.Width / 2) * 0.5f && mouseState.X >= _UI[1].position.X - (_UI[1].texture.Width / 2) * 0.5f && mouseState.Y <= _UI[1].position.Y + (_UI[1].texture.Height / 2) * 0.5f && mouseState.Y >= _UI[1].position.Y - (_UI[1].texture.Height / 2) * 0.5f) { this.Game.Components.Clear(); Scenes.Level level = new Scenes.Level(this.Game); this.Game.Components.Add(level); } //Exit gumb if (mouseState.X <= _UI[2].position.X + (_UI[2].texture.Width / 2) * 0.5f && mouseState.X >= _UI[2].position.X - (_UI[2].texture.Width / 2) * 0.5f && mouseState.Y <= _UI[2].position.Y + (_UI[2].texture.Height / 2) * 0.5f && mouseState.Y >= _UI[2].position.Y - (_UI[2].texture.Height / 2) * 0.5f) { this.Game.Exit(); } } if (mouseState.ScrollWheelValue != PrevisuMouseVale) { int diff = PrevisuMouseVale - mouseState.ScrollWheelValue; if (diff > 0) { top = Math.Min(Math.Max(++top, 0), _LeaderBoard.Count - 14); bot = Math.Min(Math.Max(++bot, 14), _LeaderBoard.Count); } else { top = Math.Min(Math.Max(--top, 0), _LeaderBoard.Count - 14); bot = Math.Min(Math.Max(--bot, 14), _LeaderBoard.Count); } PrevisuMouseVale = mouseState.ScrollWheelValue; makeTextbetween(); } }
public void CheckForCollision() { Scenes.Level currLevel = GameplayManager.self.CurrLevel; for (int i = 0; i < currLevel.items.Count; i++) { if (!(currLevel.items[i] is Collider)) { continue; } for (int j = 0; j < currLevel.items.Count; j++) { if (i == j || !(currLevel.items[j] is Collider)) { continue; } Collider.CheckForCollision(((Collider)currLevel.items[i]), ((Collider)currLevel.items[j])); } } }
public SeekerAIComponent(Scenes.Level level) { this.level = level; target = level.Player; }
//public bool Hiding { get; set; } public PlayerControlComponent(Scenes.Level level) { this.level = level; }