//-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public PlayerMinecartState()
 {
     minecartSpeed	= 1.0f;
     minecart		= null;
     trackTile		= null;
     minecartAnimationPlayer = new AnimationPlayer();
 }
        //-----------------------------------------------------------------------------
        // Constructor
        //-----------------------------------------------------------------------------
        public TileTurnstile()
        {
            arrowsAnimationPlayer = new AnimationPlayer();
            turnstileAnimationPlayer = new AnimationPlayer();

            Graphics.SyncPlaybackWithRoomTicks = false;
        }
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public RoomStateReward(Reward reward)
 {
     this.updateRoom			= false;
     this.animateRoom		= true;
     this.reward				= reward;
     this.chestPosition		= Point2I.Zero;
     this.useChest			= false;
     this.timer				= 0;
     this.animationPlayer	= new AnimationPlayer();
 }
示例#4
0
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public UnitTool()
 {
     unit				= null;
     drawAboveUnit		= false;
     animationPlayer		= new AnimationPlayer();
     collisionBox		= new Rectangle2I(-1, -1, 2, 2);
     toolType			= UnitToolType.Visual;
     isEquipped			= false;
     isPhysicsEnabled	= true;
     imageVariantID		= GameData.VARIANT_NONE;
     syncAnimationWithDirection	= true;
 }
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public TileGraphicsComponent(Tile tile)
 {
     this.tile						= tile;
     this.animationPlayer			= new AnimationPlayer();
     this.isVisible					= true;
     this.depthLayer					= DepthLayer.TileLayer1;
     this.imageVariant				= 0;
     this.raisedDrawOffset			= Point2I.Zero;
     this.drawOffset					= Point2I.Zero;
     this.syncPlaybackWithRoomTicks	= true;
     this.isAnimatedWhenPaused		= false;
     this.absoluteDrawPosition		= Vector2F.Zero;
     this.useAbsoluteDrawPosition	= false;
 }
 //-----------------------------------------------------------------------------
 // Constructors
 //-----------------------------------------------------------------------------
 public GraphicsComponent(Entity entity)
 {
     this.entity					= entity;
     this.animationPlayer		= new AnimationPlayer();
     this.sprite					= null;
     this.subStripIndex			= 0;
     this.isVisible				= true;
     this.isShadowVisible		= true;
     this.grassDrawOffset		= Point2I.Zero;
     this.ripplesDrawOffset		= Point2I.Zero;
     this.shadowDrawOffset		= Point2I.Zero;
     this.isGrassEffectVisible	= true;
     this.isRipplesEffectVisible	= true;
     this.grassAnimationTicks	= 0;
     this.drawOffset				= Point2I.Zero;
     this.isFlickering			= false;
     this.flickerAlternateDelay	= 2;
     this.flickerTimer			= 0;
     this.flickerIsVisible		= true;
     this.imageVariant			= GameData.VARIANT_NONE;
     this.isAnimatedWhenPaused	= false;
 }
示例#7
0
 public void DrawAnimation(AnimationPlayer animationPlayer, Vector2F position, Color color, float depth = 0.0f)
 {
     DrawAnimation(animationPlayer.SubStrip, animationPlayer.PlaybackTime, position, color, depth);
 }
示例#8
0
 public void DrawAnimation(AnimationPlayer animationPlayer, int variantID, Vector2F position, float depth = 0.0f)
 {
     DrawAnimation(animationPlayer.SubStrip, variantID, animationPlayer.PlaybackTime, position, depth);
 }
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public MonsterGaleState(EffectGale galeEffect)
 {
     this.galeEffect = galeEffect;
     galeAnimationPlayer = new AnimationPlayer();
 }
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public MonsterBurnState(int burnDamage)
 {
     this.burnDamage				= burnDamage;
     this.burnDuration			= GameSettings.MONSTER_BURN_DURATION;
     this.flameAnimationPlayer	= new AnimationPlayer();
 }
示例#11
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Player()
        {
            direction			= Directions.Down;
            useDirection		= 0;
            useAngle			= 0;
            autoRoomTransition	= false;
            syncAnimationWithDirection = true;
            movement = new PlayerMoveComponent(this);

            // Unit properties.
            originOffset	= new Point2I(0, -2);
            centerOffset	= new Point2I(0, -8);
            Health			= 4 * 3;
            MaxHealth		= 4 * 3;
            swimmingSkills	= PlayerSwimmingSkills.CantSwim;
            invincibleTimer	= 0;
            tunic			= PlayerTunics.GreenTunic;

            // Physics.
            Physics.CollisionBox		= new Rectangle2F(-4, -10, 8, 9);
            Physics.SoftCollisionBox	= new Rectangle2F(-6, -14, 12, 13);
            Physics.CollideWithWorld	= true;
            Physics.CollideWithEntities	= true;
            Physics.CollideWithRoomEdge	= true;
            Physics.HasGravity			= true;

            // Graphics.
            Graphics.ShadowDrawOffset = originOffset;
            Graphics.DrawOffset = new Point2I(-8, -16);

            // Create the basic player states.
            state			= null;
            stateNormal		= new PlayerNormalState();
            stateBusy		= new PlayerBusyState();
            stateSwim		= new PlayerSwimState();
            stateLadder		= new PlayerLadderState();
            stateLedgeJump	= new PlayerLedgeJumpState();
            stateSwing		= new PlayerSwingState();
            stateHoldSword	= new PlayerHoldSwordState();
            stateSpinSword	= new PlayerSpinSwordState();

            toolAnimation	= new AnimationPlayer();
        }
示例#12
0
 // Draw an animation player at the given time.
 public void DrawAnimationPlayer(AnimationPlayer animationPlayer, int imageVariant, float time, Vector2F position, DepthLayer depth, Vector2F depthOrigin)
 {
     if (animationPlayer.Sprite != null)
         DrawSprite(animationPlayer.Sprite, imageVariant, position, depth, depthOrigin);
     else if (animationPlayer.SubStrip != null)
         DrawAnimation(animationPlayer.SubStrip, imageVariant, time, position, depth, depthOrigin);
 }
示例#13
0
 //-----------------------------------------------------------------------------
 // Entity Drawing Functions (with variants, with depth origin)
 //-----------------------------------------------------------------------------
 // Draw an animation player.
 public void DrawAnimationPlayer(AnimationPlayer animationPlayer, int imageVariant, Vector2F position, DepthLayer depth, Vector2F depthOrigin)
 {
     DrawAnimationPlayer(animationPlayer, imageVariant, animationPlayer.PlaybackTime, position, depth, depthOrigin);
 }
示例#14
0
 //-----------------------------------------------------------------------------
 // Entity Drawing Functions (no variants, with depth origin)
 //-----------------------------------------------------------------------------
 // Draw an animation player.
 public void DrawAnimationPlayer(AnimationPlayer animationPlayer, Vector2F position, DepthLayer depth, Vector2F depthOrigin)
 {
     DrawAnimationPlayer(animationPlayer, 0, position, depth, depthOrigin);
 }
示例#15
0
 // Draw an animation player at the given playback time.
 public void DrawAnimationPlayer(AnimationPlayer animationPlayer, int imageVariant, float time, Vector2F position, DepthLayer depth)
 {
     DrawAnimationPlayer(animationPlayer, imageVariant, time, position, depth, Vector2F.Zero);
 }
示例#16
0
 //-----------------------------------------------------------------------------
 // Entity Drawing Functions (no variants, no depth origin)
 //-----------------------------------------------------------------------------
 // Draw an animation player.
 public void DrawAnimationPlayer(AnimationPlayer animationPlayer, Vector2F position, DepthLayer depth)
 {
     DrawAnimationPlayer(animationPlayer, 0, position, depth, Vector2F.Zero);
 }