예제 #1
0
 public JetpackPowerUp(int x, int y)
 {
     Texture = ContentHelper.LoadTexture("Objects/jetpack");
     LoopSound = new Misc.SoundFx("Sounds/jetpack_engine");
     CollRectangle = new Rectangle(x, y, 32, 32);
     _animation = new Animation(Texture, DrawRectangle, 100, 0, AnimationType.Loop);
     Velocity.Y = -10f;
 }
예제 #2
0
        public CdPlayer(Vector2 position)
        {
            Texture = ContentHelper.LoadTexture("Objects/CDplayer_new");
            CollRectangle = new Rectangle((int)position.X, (int)position.Y, 32, 32);
            SourceRectangle = new Rectangle(0, 0, 32, 32);

            _animation = new Animation(Texture, DrawRectangle, 70, 0, AnimationType.Loop);
            LoopSound = new Misc.SoundFx("Sounds/loop");
            Velocity.Y = -10f;
        }
예제 #3
0
파일: Gem.cs 프로젝트: DuckKnightDuel/Adam
        public Gem(int centerX, int centerY, byte id)
        {
            _gemId = id;
            Texture = GameWorld.SpriteSheet;
            CollRectangle = new Rectangle(centerX, centerY, 16, 16);
            SourceRectangle = GetSourceRectangle();
            Velocity = new Vector2(GameWorld.RandGen.Next(-100, 100) / 10f, -GameWorld.RandGen.Next(100, 180) / 10f);
            Light = new Lights.DynamicPointLight(this, .5f, false, GetGemColor(), .8f);
            GameWorld.Instance.LightEngine.AddDynamicLight(Light);

            PickUpSound = new Misc.SoundFx("Sounds/Items/gold" + GameWorld.RandGen.Next(0, 5));

            OnPlayerPickUp += Gem_OnPlayerPickUp;
            CurrentCollisionType = CollisionType.Bouncy;
        }