Esempio n. 1
0
 public GameObject(Room room, Vector2 v1, Vector2 v2)
 {
     this.position = v1;
     this.size = v2 - v1;
     this.room = room;
     this.texture = TextureBin.Get("pixel");
     this.velocity = Vector2.Zero;
 }
Esempio n. 2
0
 public override void Update(Room room)
 {
     this.pos.X += xVel;
     this.pos.Y += yVel;
     yVel += 0.5f;
     if (this.pos.Y > Engine.screenResolution.Y)
         room.snow.BufferRemove(this);
 }
Esempio n. 3
0
 public GameObject(Room room, Vector2 position, Vector2 velocity, Vector2 size, Texture2D texture)
 {
     this.position = position;
     this.velocity = velocity;
     this.texture = texture;
     this.size = size;
     this.room = room;
 }
Esempio n. 4
0
 public Player(Room room, Vector2 position)
     : base(room, position, Vector2.Zero, new Vector2(48, 48), TextureBin.Get("dude2_f1"))
 {
     KeyUp = Keys.Space;
     KeyDown = Keys.Down;
     KeyLeft = Keys.Left;
     KeyRight = Keys.Right;
     aniSet = new AnimationSet(this);
 }
Esempio n. 5
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     TextureBin.LoadContent(Content);
     SoundBin.LoadSounds(Content);
     room = new Room(screenResolution);
     MediaPlayer.Play(SoundBin.GetSong("descent"));
     MediaPlayer.IsRepeating = true;
 }
Esempio n. 6
0
 public virtual void Update(Room room)
 {
     this.pos.X += (float)Math.Sin(angle) * 3;
     this.pos.Y += 5f;
     if (this.pos.Y > Engine.screenResolution.Y)
     {
         room.snow.BufferRemove(this);
     }
     this.angle += this.angleSpeed;
 }
Esempio n. 7
0
        public BlockGroup(Room room, Vector2 pos)
            : base(room, pos, Vector2.Zero, Vector2.One * Room.GRIDSIZE, TextureBin.Get("pixel"))
        {
            for (int i = 0; i < BLOCK_NUM; i++)
            {
                blocks[i] = new Block(room, position, size);
                blocksOffset[i] = new Vector2(i, 0);

                blocks[i].velocity = this.velocity;
                blocks[i].position = this.position + blocksOffset[i] * Room.GRIDSIZE;
            }
            blocks[BLOCK_NUM - 1].position.Y += Room.GRIDSIZE;
            blocks[BLOCK_NUM - 1].position.X -= Room.GRIDSIZE;
        }
Esempio n. 8
0
 public TopBlock(Room room, Vector2 position, Vector2 Size)
     : base(room, position, Size)
 {
 }
Esempio n. 9
0
 public Block(Room room, Vector2 position, Vector2 Size)
     : base(room, position, Vector2.Zero, Size, TextureBin.Get("pixel"))
 {
 }