コード例 #1
0
 /*
  * Constructor
  */
 public UserControlledSprite(SpriteSheet spriteSheet, Vector2 position, 
     CollisionOffset collisionOffset, Vector2 speed, Vector2 friction)
     : base(spriteSheet, position, collisionOffset)
 {
     this.speed = speed;
     this.friction = friction;
 }
コード例 #2
0
ファイル: Platform.cs プロジェクト: asherrna/SeriousChallenge
 public Platform(Texture2D image, Vector2 position)
     : base(new SpriteSheet(image,new Point(1, 1),0.5f), new Vector2(600, 600),new CollisionOffset(0, 0, 39, 0))
 {
     spriteSheet = new SpriteSheet(image, new Point(1,1), 0.8f);
     spriteSheet.addSegment(platformFrameSize, new Point(0, 0), new Point(18, 0), 50);
     spriteSheet.setCurrentSegment(0);
     this.position = position;
 }
コード例 #3
0
        // constructor
        public DbzPlayer(SpriteSheet spriteSheet, Vector2 position,
            CollisionOffset collisionOffset, Vector2 speed, Vector2 friction, SoundEffect sound1, SoundEffect sound2, Point frameSize, PlayerIndex playerIndex)
            : base(spriteSheet, position, collisionOffset, speed, friction)
        {
            dbzPlayerNum = playerIndex;
            if (playerIndex.Equals(PlayerIndex.Two))
            {
                base.position.X = 800; 
                effects = SpriteEffects.FlipHorizontally;
                dbzPlayerKeys.Add(Keys.I);
                dbzPlayerKeys.Add(Keys.K);
                dbzPlayerKeys.Add(Keys.J);
                dbzPlayerKeys.Add(Keys.L);
                dbzPlayerKeys.Add(Keys.N);
                dbzPlayerKeys.Add(Keys.O);
                dbzPlayerKeys.Add(Keys.U);
            }
            else
            {
                base.position.X = 200;
                dbzPlayerKeys.Add(Keys.W);
                dbzPlayerKeys.Add(Keys.S);
                dbzPlayerKeys.Add(Keys.A);
                dbzPlayerKeys.Add(Keys.D);
                dbzPlayerKeys.Add(Keys.Space);
                dbzPlayerKeys.Add(Keys.E);
                dbzPlayerKeys.Add(Keys.Q);
            }
            dbzFrameSize = frameSize;
            chargeSound = sound1;
            ssLoop = sound2;
            chargeSoundInstance = chargeSound.CreateInstance();
            ssLoopInstance = ssLoop.CreateInstance();
            ssLoopInstance.IsLooped = true;

        }
コード例 #4
0
ファイル: AutomatedSprite.cs プロジェクト: grmoe/Platform
 public AutomatedSprite(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collionOffset, Vector2 speed)
     : base(spriteSheet, position, collionOffset)
 {
     this.speed = speed;
     this.velocity = new Vector2(-1, 0);
 }
コード例 #5
0
ファイル: Sprite.cs プロジェクト: grmoe/Platform
 public Sprite(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collisionOffset)
 {
     this.spriteSheet = spriteSheet;
     this.position = position;
     this.collisionOffset = collisionOffset;
 }
コード例 #6
0
 public Sprite(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collisionOffset)
 {
     this.spriteSheet     = spriteSheet;
     this.position        = position;
     this.collisionOffset = collisionOffset;
 }