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; }
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); }
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; }
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); }
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; }
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; }
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; }
public TopBlock(Room room, Vector2 position, Vector2 Size) : base(room, position, Size) { }
public Block(Room room, Vector2 position, Vector2 Size) : base(room, position, Vector2.Zero, Size, TextureBin.Get("pixel")) { }