public Paratroopa(Type type, float speedModifier) : base(type) { this.DeadTexture = ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_paratroopa"); this.Position = new Vector2(Statics.GAME_WIDTH + this.DeadTexture.Width, Statics.GAME_RANDOM.Next(Statics.GAME_HEIGHT / 2, Statics.GAME_FLOOR)); this.Width = this.DeadTexture.Width; this.Height = this.DeadTexture.Height; this.EntityType = type; this.MoveSpeed = _baseSpeed + speedModifier + Statics.GAME_RANDOM.Next(0, 3); this.ColorData = new Color[this.Width * this.Height]; this.DeadTexture.GetData(ColorData); Texture2D animated_Texture = ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_paratroopa_animated"); _paratroopa_Sprite = new AnimatedSprite(); _paratroopa_Sprite.Initialize(animated_Texture, this.Position, this.Rotation, 128, 128, 4, 60, Color.White, this.Scale, true); _originPos = this.Position; _destinationPos = new Vector2(-this.Width, this.Position.Y); _dirAngle = Math.Atan2(_destinationPos.Y - _originPos.Y, _destinationPos.X - _originPos.X); _amp = Statics.GAME_RANDOM.Next(4, 8); _soundCounter = 0; _soundFrequency = 60; }
public void LoadContent() { #region Entity Textures AnimatedTextures.Add("Entity\\Bird", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_bird_animated.png")); AnimatedTextures.Add("Entity\\Paratroopa", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_paratroopa_animated.png")); Textures.Add("Entity\\Bird", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_bird.png")); Textures.Add("Entity\\DeadBird", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_bird_dead.png")); Textures.Add("Entity\\Boomba", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_boomba.png")); Textures.Add("Entity\\Bullet", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_bullet.png")); Textures.Add("Entity\\Paratroopa", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_paratroopa.png")); Textures.Add("Entity\\Pipe", ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_pipe.png")); #endregion #region UI Textures Textures.Add("UI\\Button", ParallaxBackground.GetFromPng("Content\\Textures\\Button\\flappy_button")); Textures.Add("UI\\ButtonExit", ParallaxBackground.GetFromPng("Content\\Textures\\Button\\flappy_button_exit")); Textures.Add("UI\\ButtonRestart", ParallaxBackground.GetFromPng("Content\\Textures\\Button\\flappy_button_restart")); Textures.Add("UI\\ButtonPipe", ParallaxBackground.GetFromPng("Content\\Textures\\Button\\flappy_level_pipes")); Textures.Add("UI\\ButtonBullet", ParallaxBackground.GetFromPng("Content\\Textures\\Button\\flappy_level_bullet")); Textures.Add("UI\\ButtonParatroopa", ParallaxBackground.GetFromPng("Content\\Textures\\Button\\flappy_level_paratroopa")); #endregion }
public Pipe(Type type, float speedModifier) : base(type) { this.DeadTexture = ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_pipe"); this.Position = new Vector2(Statics.GAME_WIDTH, Statics.GAME_RANDOM.Next(Statics.GAME_HEIGHT / 4 - this.DeadTexture.Height / 2, Statics.GAME_HEIGHT / 4 - this.DeadTexture.Height / 4)); this.Width = this.DeadTexture.Width; this.Height = this.DeadTexture.Height; this.EntityType = type; this.MoveSpeed = _baseSpeed + speedModifier; this.ColorData = new Color[this.Width * this.Height]; this.DeadTexture.GetData(ColorData); }
public Bullet(Type type, float speedModifier) : base(type) { this.DeadTexture = ParallaxBackground.GetFromPng("Content\\Textures\\Entity\\flappy_bullet"); this.Position = new Vector2(Statics.GAME_WIDTH, Statics.GAME_RANDOM.Next((int)Statics.DEBUG_PLAYER.Y - (int)((this.DeadTexture.Height / 2) * this.Scale), (int)Statics.DEBUG_PLAYER.Y - (int)((this.DeadTexture.Height / 4) * this.Scale))); this.Width = this.DeadTexture.Width; this.Height = this.DeadTexture.Height; this.EntityType = type; this.MoveSpeed = _baseSpeed + speedModifier; this.ColorData = new Color[this.Width * this.Height]; this.DeadTexture.GetData(ColorData); }
public override void LoadContent() { _cursor_Texture = ParallaxBackground.GetFromPng("Content\\Textures\\flappy_cursor"); base.LoadContent(); }
public override void LoadContent() { Statics.TEXTURE_PIXEL = ParallaxBackground.GetFromPng("Content\\Textures\\flappy_pixel"); base.LoadContent(); }