示例#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;
 }
示例#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);
 }
示例#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;
 }
示例#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);
 }
示例#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;
 }
示例#6
0
文件: Snow.cs 项目: adamgryu/HackGame
 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;
 }
示例#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;
        }
示例#8
0
 public TopBlock(Room room, Vector2 position, Vector2 Size)
     : base(room, position, Size)
 {
 }
示例#9
0
 public Block(Room room, Vector2 position, Vector2 Size)
     : base(room, position, Vector2.Zero, Size, TextureBin.Get("pixel"))
 {
 }