Esempio n. 1
0
 public Ship(Vector pos, Game game, ParticleEngine particleEngine, Arena arena)
 {
     position = pos;
     gameref = game;
     particles = particleEngine;
     arenaref = arena;
 }
Esempio n. 2
0
 public SimpleBullet(Ship parent, double x, double y, double angle, double magnitude, Arena arena)
     : base(parent, x, y, true, arena, 4, 4)
 {
     bulletSprite = new Sprite(parent.GameRef.Resources.GetSpriteDescriptor("bullet"), parent.GameRef.Resources);
     this.angle = angle;
     this.magnitude = magnitude;
 }
Esempio n. 3
0
 public static Component CreateComponent(string type, Ship parent, double x, double y, Arena arena)
 {
     switch (type)
     {
     case "SimpleGunTurret":
         return new SimpleGunTurret(parent, x, y, arena);
     default:
         return null;
     }
 }
Esempio n. 4
0
        private double x, y; //Relative position from parent if absolutePosition is false, absolute position otherwise

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Construct a new 
        /// </summary>
        /// <param name="parent">
        /// A <see cref="Ship"/>
        /// </param>
        /// <param name="x">
        /// A <see cref="System.Double"/>
        /// </param>
        /// <param name="y">
        /// A <see cref="System.Double"/>
        /// </param>
        public Component(Ship parent, double x, double y, bool absolutePosition, Arena arena, int width, int height)
        {
            this.height = height;
            this.width = width;
            this.parent = parent;
            this.x = x;
            this.y = y;
            this.absolutePosition = absolutePosition;
            this.arenaref = arena;
            id = idCounter;
            idCounter++;
        }
Esempio n. 5
0
 public SimpleGunTurret(Ship parent, double x, double y, Arena arena)
     : base(parent, x, y, false, arena, 16, 16)
 {
     turretSprite = new Sprite(parent.GameRef.Resources.GetSpriteDescriptor("turret"), parent.GameRef.Resources);
 }
Esempio n. 6
0
        public void StartLevel(int level)
        {
            switch (level)
            {
            case 1:
                arena = new Arena(5000, 5000, gameref);
                /*foreach (Component obj in player.Components)
                {
                    arena.AddObject(obj);
                }*/

             	break;
            }
        }
Esempio n. 7
0
 public PlayerShipBody(Ship parent, double x, double y, Arena arena)
     : base(parent, x, y, false, arena, 32, 48)
 {
     bodySprite = new Sprite(parent.GameRef.Resources.GetSpriteDescriptor("playership"), parent.GameRef.Resources);
 }