Пример #1
0
 public SaveLoad(PlayField field, string action)
 {
     this.field = field;
     if (action == "SAVE")
     {
         this.InitiateSave();
     }
     else if (action == "LOAD")
     {
         this.Load();
     }
 }
Пример #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            field = new PlayField();
        }
Пример #3
0
 public Sprite(Vector2 position, float scale, Texture2D texture, PlayField field)
     : this(position, scale, texture, 0f, 1f, field)
 {
 }
Пример #4
0
 public Sprite(Vector2 position, Texture2D texture, PlayField field)
     : this(position, 1f, texture, 0f, 1f, field)
 {
 }
Пример #5
0
 public Sprite(Vector2 position, float scale, Texture2D texture, float rotation, PlayField field)
     : this(position, scale, texture, null, rotation, 1f, field)
 {
 }
Пример #6
0
 public Sprite(Vector2 position, float scale, Texture2D texture, SoundEffectInstance soundEffect, float rotation, float transparency, PlayField field)
 {
     this.position     = position;
     this.scale        = scale;
     this.rotation     = rotation;
     this.texture      = texture;
     this.transparency = transparency;
     children          = new List <Sprite>();
     field.Addtoplayfield(this);
     this.soundEffectInstance = soundEffect;
 }
Пример #7
0
 public Sprite(Texture2D texture, PlayField field)
     : this(Vector2.Zero, 1f, texture, 0f, 1f, field)
 {
 }
Пример #8
0
 public Player(Vector2 position, float scale, Texture2D texture, float rotation, float transparency, PlayField field) : base(position, scale, texture, rotation, transparency, field)
 {
     this.Position     = position;
     this.Scale        = scale;
     this.Rotation     = rotation;
     this.Texture      = texture;
     this.Transparency = transparency;
     children          = new List <Sprite>();
     field.Addtoplayfield(this);
 }
Пример #9
0
 public PhysicsObject(Vector2 position, float scale, Texture2D texture, float rotation, float transparency, PlayField field) : base(position, scale, texture, rotation, transparency, field)
 {
     this.Position     = position;
     this.Scale        = scale;
     this.Rotation     = rotation;
     this.Texture      = texture;
     this.Transparency = transparency;
     this.Ground       = ground;
     children          = new List <Sprite>();
     field.Addtoplayfield(this);
     hitbox = new Rectangle((int)position.X, (int)position.Y, (int)Math.Ceiling(texture.Width * scale), (int)Math.Ceiling(texture.Height * scale));
 }