/// <summary> /// A Polygon object that you will be able to draw. /// Animations are being implemented as we speak. /// </summary> /// <param name="graphicsDevice">The graphicsdevice from a GameRef object</param> /// <param name="vertices">The vertices in a clockwise order</param> public PolygonShape(DnK game, Vector2[] vertices) { _gameRef = game; _vertices = vertices; _triangulated = false; _size = Vector2.Zero; _area = 0f; _center = Vector2.Zero; _edgeEffect = _gameRef.Content.Load <Effect>("Graphics/Shaders/Edge"); _effect = new BasicEffect(_gameRef.GraphicsDevice) { Projection = Matrix.CreateOrthographicOffCenter( 0, _gameRef.GraphicsDevice.Viewport.Width, _gameRef.GraphicsDevice.Viewport.Height, 0, 0, 1), VertexColorEnabled = true, DiffuseColor = new Vector3(0, 1, 0), Alpha = 0.5f }; if (_vertices != null) { Triangulate(); } }
public Laser(DnK gameRef, Vector2 start, Vector2 end, float thickness = 1) : base(gameRef) { _start = start; _end = end; _thickness = thickness; }
public BossStructure(DnK game, Entity parent, int iteration = 50, float step = 25, PolygonShape polygonShape = null) { _gameRef = game; _parent = parent; _iteration = iteration; _step = step; _iteration = iteration; _area = 0f; _bottomRightVertices = new List<Vector2>(); _bottomLeftVertices = new List<Vector2>(); _topRightVertices = new List<Vector2>(); _topLeftVertices = new List<Vector2>(); _bottomRightLastDirection = Direction.Left; _topRightLastDirection = Direction.Left; if (polygonShape != null) { _polygonShape = polygonShape; _size = polygonShape.GetSize(); } else { _polygonShape = new PolygonShape(_gameRef, null); GenerateBaseStructure(); } }
public BossStructure(DnK game, Entity parent, int iteration = 50, float step = 25, PolygonShape polygonShape = null) { _gameRef = game; _parent = parent; _iteration = iteration; _step = step; _iteration = iteration; _area = 0f; _bottomRightVertices = new List <Vector2>(); _bottomLeftVertices = new List <Vector2>(); _topRightVertices = new List <Vector2>(); _topLeftVertices = new List <Vector2>(); _bottomRightLastDirection = Direction.Left; _topRightLastDirection = Direction.Left; if (polygonShape != null) { _polygonShape = polygonShape; _size = polygonShape.GetSize(); } else { _polygonShape = new PolygonShape(_gameRef, null); GenerateBaseStructure(); } }
public BaseGameState(Game game, GameStateManager manager) : base(game, manager) { GameRef = (DnK)game; playerIndexInControl = PlayerIndex.One; }
/// <summary> /// Initializes a new instance of the <see cref="Danmaku_no_Kyojin.BulletEngine.Mover"/> class. /// </summary> /// <param name="myBulletManager">My bullet manager.</param> public Mover(DnK game, IBulletManager myBulletManager) : base(game, myBulletManager) { Position = Vector2.Zero; Rotation = 0f; IsAlive = true; }
protected BaseBullet(DnK gameRef, Texture2D sprite, Vector2 position, Vector2 direction, Vector2 velocity) : base(gameRef) { Sprite = sprite; Position = position; Direction = direction; Velocity = velocity; }
protected Entity(DnK gameRef) { GameRef = gameRef; CollisionBoxes = new CollisionElements(); _scale = new Vector2(1f, 1f); IsAlive = true; }
/// <summary> /// Initializes a new instance of the <see cref="Danmaku_no_Kyojin.BulletEngine.Mover"/> class. /// </summary> /// <param name="gameRef">Game reference</param> /// <param name="myBulletManager">My bullet manager.</param> public Mover(DnK gameRef, IBulletManager myBulletManager) : base(gameRef, myBulletManager) { Position = Vector2.Zero; Rotation = 0f; IsAlive = true; }
public Boss(DnK game) : base(game) { MoverManager = new MoverManager(Game); GameManager.GameDifficulty = Config.GameDifficultyDelegate; DefeatNumber = 0; _speed = 1f; }
public Bullet(DnK gameRef, Texture2D sprite, Vector2 position, Vector2 direction, Vector2 velocity) : base(gameRef, sprite, position, direction, velocity) { Rotation = (float)Math.Atan2(direction.Y, direction.X) - MathHelper.PiOver2; _distance = 0; WaveMode = false; CollisionBoxes.Add(new CollisionCircle(this, Vector2.Zero, sprite.Width / 2f)); Power = Improvements.ShootPowerData[PlayerData.ShootPowerIndex].Key; }
public Player(DnK game, Viewport viewport, int id, Config.Controller controller, Vector2 position) : base(game) { _viewport = viewport; ID = id; _controller = controller; _originPosition = position; Position = _originPosition; Center = Vector2.Zero; }
public BaseGameState(Game game, GameStateManager manager) : base(game, manager) { GameRef = (DnK)game; playerIndexInControl = PlayerIndex.One; var controlFont = GameRef.Content.Load<SpriteFont>("Graphics/Fonts/ControlFont"); ControlManager = new ControlManager(controlFont); }
public BaseGameState(Game game, GameStateManager manager) : base(game, manager) { GameRef = (DnK)game; playerIndexInControl = PlayerIndex.One; var controlFont = GameRef.Content.Load <SpriteFont>("Graphics/Fonts/ControlFont"); ControlManager = new ControlManager(controlFont); }
/// <summary> /// Initializes a new instance of the <see cref="BulletMLLib.Bullet"/> class. /// </summary> /// <param name="myBulletManager">My bullet manager.</param> public Bullet(DnK gameRef, IBulletManager myBulletManager) : base(gameRef) { //grba the bullet manager for this dude Debug.Assert(null != myBulletManager); _bulletManager = myBulletManager; Acceleration = Vector2.Zero; _tasks = new List<BulletMLTask>(); _fireData = new List<FireData>(); }
/// <summary> /// Initializes a new instance of the <see cref="BulletMLLib.Bullet"/> class. /// </summary> /// <param name="myBulletManager">My bullet manager.</param> public Bullet(DnK gameRef, IBulletManager myBulletManager) : base(gameRef) { //grba the bullet manager for this dude Debug.Assert(null != myBulletManager); _bulletManager = myBulletManager; Acceleration = Vector2.Zero; _tasks = new List <BulletMLTask>(); _fireData = new List <FireData>(); }
public Player(DnK gameRef, Viewport viewport, int id, Config.Controller controller, Vector2 position) : base(gameRef) { _viewport = viewport; ID = id; _controller = controller; _originPosition = position; Position = _originPosition; Origin = Vector2.Zero; _random = new Random(); _cameraPosition = new Vector2(_viewport.Width / 2f, _viewport.Height / 2f); _focusMode = false; _timeBeforeRespawn = TimeSpan.Zero; }
public BossCore( DnK gameRef, Entity parent, PositionDelegate playerPositionDelegate, MoverManager moverManager, List <BulletPattern> bulletPatterns, float initialHp = 100f) : base(gameRef) { _parent = parent; _hp = initialHp; _activated = false; _playerPositionDelegate = playerPositionDelegate; _moverManager = moverManager; _bulletPatterns = bulletPatterns; }
public BossCore( DnK gameRef, Entity parent, PositionDelegate playerPositionDelegate, MoverManager moverManager, List<BulletPattern> bulletPatterns, float initialHp = 100f) : base(gameRef) { _parent = parent; _hp = initialHp; _activated = false; _playerPositionDelegate = playerPositionDelegate; _moverManager = moverManager; _bulletPatterns = bulletPatterns; }
public Boss(DnK gameRef, List<Player> players, int iteration = 50, float step = 25) { _gameRef = gameRef; _defeatCounter = 0; MoverManager = new MoverManager(gameRef); GameManager.GameDifficulty = Config.GameDifficultyDelegate; _players = players; _iteration = iteration; _step = step; _previousBossPart = null; _parts = new List<BossPart>(); _currentPartIndex = 0; int targetPlayerId = _gameRef.Rand.Next(0, _players.Count); MoverManager.Initialize(_players[targetPlayerId].GetPosition); }
public Boss(DnK gameRef, List <Player> players, int iteration = 50, float step = 25) { _gameRef = gameRef; _defeatCounter = 0; MoverManager = new MoverManager(gameRef); GameManager.GameDifficulty = Config.GameDifficultyDelegate; _players = players; _iteration = iteration; _step = step; _previousBossPart = null; _parts = new List <BossPart>(); _currentPartIndex = 0; int targetPlayerId = _gameRef.Rand.Next(0, _players.Count); MoverManager.Initialize(_players[targetPlayerId].GetPosition); }
public Bullet(DnK game, Texture2D sprite, Vector2 position, Vector2 direction, float velocity) : base(game, sprite, position, direction, velocity) { Rotation = 0; Center = new Vector2(Sprite.Width / 2f, Sprite.Height / 2f); _distance = 0; WaveMode = false; List <Point> vertices = new List <Point>() { new Point(0, 0), new Point(sprite.Width, 0), new Point(sprite.Width, sprite.Height), new Point(0, sprite.Height), }; CollisionBox = new CollisionConvexPolygon(this, Vector2.Zero, vertices); Power = Improvements.ShootPowerData[PlayerData.ShootPowerIndex].Key; }
public Bullet(DnK game, Texture2D sprite, Vector2 position, Vector2 direction, float velocity) : base(game, sprite, position, direction, velocity) { Rotation = 0; Center = new Vector2(Sprite.Width / 2f, Sprite.Height / 2f); _distance = 0; WaveMode = false; List<Point> vertices = new List<Point>() { new Point(0, 0), new Point(sprite.Width, 0), new Point(sprite.Width, sprite.Height), new Point(0, sprite.Height), }; CollisionBox = new CollisionConvexPolygon(this, Vector2.Zero, vertices); Power = Improvements.ShootPowerData[PlayerData.ShootPowerIndex].Key; }
public Turret( DnK gameRef, Entity parent, Entity target, MoverManager moverManager, Vector2 initialPosition, BulletPattern pattern, Color color) : base(gameRef) { _initialPosition = initialPosition; X = InitialPosition.X; Y = InitialPosition.Y; _parent = parent; _target = target; _moverManager = moverManager; _pattern = pattern; _timer = new TimeSpan(0, 0, (int)(GameRef.Rand.NextDouble() * 30)); _color = color; Scale = new Vector2(0.5f, 0.5f); }
/// <summary> /// A Polygon object that you will be able to draw. /// Animations are being implemented as we speak. /// </summary> /// <param name="graphicsDevice">The graphicsdevice from a GameRef object</param> /// <param name="vertices">The vertices in a clockwise order</param> public PolygonShape(DnK game, Vector2[] vertices) { _gameRef = game; _vertices = vertices; _triangulated = false; _size = Vector2.Zero; _area = 0f; _center = Vector2.Zero; _edgeEffect = _gameRef.Content.Load<Effect>("Graphics/Shaders/Edge"); _effect = new BasicEffect(_gameRef.GraphicsDevice) { Projection = Matrix.CreateOrthographicOffCenter( 0, _gameRef.GraphicsDevice.Viewport.Width, _gameRef.GraphicsDevice.Viewport.Height, 0, 0, 1), VertexColorEnabled = true, DiffuseColor = new Vector3(0, 1, 0), Alpha = 0.5f }; if (_vertices != null) Triangulate(); }
public BossPart( DnK gameRef, Boss bossRef, List<Player> playerList, MoverManager moverManager, List<BulletPattern> bulletPatterns, Color color, float initialHealth, int iteration = 50, float step = 25, List<Turret> turrets = null, PolygonShape polygonShape = null, bool mainPart = false) : base(gameRef) { _bossRef = bossRef; _mainPart = mainPart; _players = playerList; _moverManager = moverManager; _bulletPatterns = bulletPatterns ?? new List<BulletPattern>(); _health = initialHealth; _displayHp = false; _color = color; _iteration = iteration; _step = step; _accelerationDecreaseFactor = 0.00075f; _turrets = turrets ?? new List<Turret>(); _polygonShape = polygonShape; _collisionBoxesHp = new Dictionary<CollisionConvexPolygon, float>(); _targetPosition = Vector2.Zero; _targetAngle = 0f; }
public BossPart( DnK gameRef, Boss bossRef, List <Player> playerList, MoverManager moverManager, List <BulletPattern> bulletPatterns, Color color, float initialHealth, int iteration = 50, float step = 25, List <Turret> turrets = null, PolygonShape polygonShape = null, bool mainPart = false) : base(gameRef) { _bossRef = bossRef; _mainPart = mainPart; _players = playerList; _moverManager = moverManager; _bulletPatterns = bulletPatterns ?? new List <BulletPattern>(); _health = initialHealth; _displayHp = false; _color = color; _iteration = iteration; _step = step; _accelerationDecreaseFactor = 0.00075f; _turrets = turrets ?? new List <Turret>(); _polygonShape = polygonShape; _collisionBoxesHp = new Dictionary <CollisionConvexPolygon, float>(); _targetPosition = Vector2.Zero; _targetAngle = 0f; }
public MoverManager(DnK game) { _gameRef = game; }
protected Entity(DnK game) { Game = game; }
protected SpriteEntity(DnK gameRef) : base(gameRef) { }
protected BulletLauncherEntity(DnK gameRef) : base(gameRef) { Bullets = new List <BaseBullet>(); }
public Laser(DnK game, Vector2 start, Vector2 end, float thickness = 1) : base(game) { _start = start; _end = end; _thickness = thickness; }
protected BulletLauncherEntity(DnK game) : base(game) { Bullets = new List<BaseBullet>(); }