Ejemplo n.º 1
0
        /// <summary>
        /// Enemy Constructor
        /// </summary>
        /// <param name="game"></param>
        /// <param name="Position">Starting Position</param>
        /// <param name="Life">Starting Lifes</param>
        public Enemy(Skyraha game, Vector2 Position, int speed, int Life = 100) : base(game, "Enemy", Position, Life)
        {
            this.speed = speed;

            this.Texture2 = game.Content.Load <Texture2D>("Feind");


            X = (int)Position.X - Texture2.Width / 2;
            Y = (int)Position.Y - Texture2.Height / 2;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Bullet
        /// </summary>
        /// <param name="game"></param>
        /// <param name="position">spawn position</param>
        /// <param name="speed">bullet speed</param>
        /// <param name="Damage">damage of the bullet</param>
        public Bullets(Skyraha game, Vector2 position, int speed, int Damage) : base(game)

        {
            game.Components.Add(this);

            this.speed = speed;

            this.Texture = game.Content.Load <Texture2D>("Schuss");


            X = (int)position.X - Texture.Width / 2;
            Y = (int)position.Y - Texture.Height / 2;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Ship Constructor, for creating Ships and setting the parameters.
        /// </summary>
        /// <param name="Name">Name of the new</param>
        /// <param name="Position">Start Position</param>
        /// <param name="Life">Ships initial healthpoints</param>
        public Ship(Skyraha Game, string Name, Vector2 Position, int Life = 100) : base(Game)
        {
            // Announce gameobject to maingame
            Game.Components.Add(this);

            // Set initial values
            this.Name = Name;
            this.Life = Life;

            // Load default ship-texture
            this._Texture = Game.Content.Load <Texture2D>("Jäger");

            // Calculate ship position based on texture size
            this.Position = Position - new Vector2(_Texture.Width, _Texture.Height) / 2;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Player Constructor
 /// </summary>
 /// <param name="game"></param>
 /// <param name="Position">Starting Position</param>
 /// <param name="Life">Starting Lifes</param>
 public Player(Skyraha game, Vector2 Position, int Life = 100) : base(game, "Player", Position, Life)
 {
 }
Ejemplo n.º 5
0
 static void Main()
 {
     using (var game = new Skyraha())
         game.Run();
 }