当前位置: 首页>>代码示例>>C#>>正文


C# Geometry.Vector2F类代码示例

本文整理汇总了C#中ZeldaOracle.Common.Geometry.Vector2F的典型用法代码示例。如果您正苦于以下问题:C# Vector2F类的具体用法?C# Vector2F怎么用?C# Vector2F使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Vector2F类属于ZeldaOracle.Common.Geometry命名空间,在下文中一共展示了Vector2F类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Unit

        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Unit()
        {
            EnablePhysics();

            isKnockbackable			= true;
            isDamageable			= true;
            isPassable				= false;

            knockbackSpeed			= GameSettings.UNIT_KNOCKBACK_SPEED;
            knockbackDuration		= GameSettings.UNIT_KNOCKBACK_DURATION;
            hurtInvincibleDuration	= GameSettings.UNIT_HURT_INVINCIBLE_DURATION;
            hurtFlickerDuration		= GameSettings.UNIT_HURT_FLICKER_DURATION;

            knockbackTimer			= 0;
            hurtFlickerTimer		= 0;
            invincibleTimer			= 0;
            knockbackVelocity		= Vector2F.Zero;
            tools					= new HashSet<UnitTool>();

            syncAnimationWithDirection = false;
            direction		= Directions.Right;
            health			= 1;
            healthMax		= 1;
            direction		= Directions.Right;
            centerOffset	= new Point2I(8, 8);
        }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:29,代码来源:Unit.cs

示例2: PlayerJumpToState

 //-----------------------------------------------------------------------------
 // Constructors
 //-----------------------------------------------------------------------------
 public PlayerJumpToState()
 {
     destination				= Vector2F.Zero;
     destinationZPosition	= 0.0f;
     jumpDuration			= 26;
     endAction				= null;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:10,代码来源:PlayerJumpToState.cs

示例3: ViewControl

 //-----------------------------------------------------------------------------
 // Constructors
 //-----------------------------------------------------------------------------
 public ViewControl()
 {
     this.viewSize		= GameSettings.VIEW_SIZE;
     this.panSpeed		= GameSettings.VIEW_PAN_SPEED;
     this.position		= Vector2F.Zero;
     this.shakeOffset	= Vector2F.Zero;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:10,代码来源:ViewControl.cs

示例4: OnSwingTilePeak

 public override void OnSwingTilePeak(int angle, Vector2F hitPoint)
 {
     if ((angle == Directions.ToAngle(SwingDirection)
         || !limitTilesToDirection) && player.IsOnGround)
     {
         CutTilesAtPoint(hitPoint);
     }
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:8,代码来源:PlayerBaseSwingSwordState.cs

示例5: EventTile

 //-----------------------------------------------------------------------------
 // Constructors
 //-----------------------------------------------------------------------------
 public EventTile()
 {
     roomControl		= null;
     eventData		= null;
     position		= Vector2F.Zero;
     size			= Point2I.One;
     properties		= new Properties();
     collisionBox	= new Rectangle2I(0, 0, 16, 16);
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:12,代码来源:EventTile.cs

示例6: Initialize

        //-----------------------------------------------------------------------------
        // Overridden methods
        //-----------------------------------------------------------------------------
        public override void Initialize()
        {
            base.Initialize();

            // Find the center position of the hole tile.
            Point2I location = RoomControl.GetTileLocation(position);
            holeCenterPosition = (Vector2F) location + new Vector2F(0.5f, 0.5f);
            holeCenterPosition *= GameSettings.TILE_SIZE;
        }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:12,代码来源:EffectFallingObject.cs

示例7: Line2F

 /** <summary> Constructs a line with the specified position and size. </summary> */
 public Line2F(Vector2F point, float width, float height, bool asSize)
 {
     if (!asSize) {
     this.End1	= point;
     this.End2	= point + new Vector2F(width, height);
     }
     else {
     this.End1	= point;
     this.End2	= new Vector2F(width, height);
     }
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:12,代码来源:Line2F.cs

示例8: DamageInfo

 public DamageInfo(int amount, Vector2F sourcePosition)
 {
     this.amount				= amount;
     this.hasSource			= true;
     this.sourcePosition		= sourcePosition;
     this.applyKnockBack		= true;
     this.knockbackDuration	= -1;
     this.flicker			= true;
     this.flickerDuration	= GameSettings.MONSTER_HURT_FLICKER_DURATION;
     this.invincibleDuration	= -1;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:11,代码来源:DamageInfo.cs

示例9: AnalogStick

        //========= CONSTRUCTORS =========
        /** <summary> Constructs the default control. </summary> */
        public AnalogStick()
        {
            this.directions			= new InputControl[4];
            this.disabledState		= DisableState.Enabled;
            this.position			= Vector2F.Zero;
            this.deadZone			= 0.28;
            this.directionDeadZone	= new Vector2F(0.83f, 0.83f);

            for (int i = 0; i < 4; i++)
            this.directions[i] = new InputControl();
        }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:13,代码来源:AnalogStick.cs

示例10: Intersecting

        //-----------------------------------------------------------------------------
        // Static methods
        //-----------------------------------------------------------------------------
        public static bool Intersecting(CollisionModel model,
										Vector2F modelPosition,
										Rectangle2F box,
										Vector2F boxPosition)
        {
            Rectangle2F boxTranslated = Rectangle2F.Translate(box, boxPosition - modelPosition);
            for (int i = 0; i < model.boxes.Count; i++) {
                Rectangle2F modelBox = model.boxes[i];
                if (boxTranslated.Intersects(modelBox))
                    return true;
            }
            return false;
        }
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:16,代码来源:CollisionModel.cs

示例11: TileGraphicsComponent

 //-----------------------------------------------------------------------------
 // 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;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:17,代码来源:TileGraphicsComponent.cs

示例12: Entity

 //-----------------------------------------------------------------------------
 // Constructors
 //-----------------------------------------------------------------------------
 public Entity()
 {
     roomControl		= null;
     isAlive			= false;
     isInRoom		= false;
     isInitialized	= false;
     position		= Vector2F.Zero;
     zPosition		= 0.0f;
     physics			= new PhysicsComponent(this);
     graphics		= new GraphicsComponent(this);
     originOffset	= Point2I.Zero;
     centerOffset	= Point2I.Zero;
     actionAlignDistance = 5;
 }
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:17,代码来源:Entity.cs

示例13: into

        private Entity transformedEntity; // The entity this entity has transformed into (bomb -> explosion)

        #endregion Fields

        #region Constructors

        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Entity()
        {
            entityIndex			= -1;
            roomControl			= null;
            isAlive				= false;
            isInRoom			= false;
            isInitialized		= false;
            transformedEntity	= null;
            soundBounce			= null;
            position			= Vector2F.Zero;
            zPosition			= 0.0f;
            previousPosition	= Vector2F.Zero;
            previousZPosition	= 0.0f;
            physics				= new PhysicsComponent(this);
            graphics			= new GraphicsComponent(this);
            centerOffset		= Point2I.Zero;
            actionAlignDistance	= 5;
        }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:27,代码来源:Entity.cs

示例14: Graphics2D

        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        // Constructs a 2D graphics object containing the sprite batch.
        public Graphics2D(SpriteBatch spriteBatch)
        {
            // Containment
            this.spriteBatch			= spriteBatch;
            this.preivousRenderTargets	= new Stack<RenderTargetBinding[]>();

            // Drawing Settings
            this.translation			= Vector2F.Zero;
            this.useTranslation			= true;
            this.useIntPrecision		= false;

            // Vector Graphics
            this.white1x1				= new Texture2D(spriteBatch.GraphicsDevice, 1, 1);
            this.white2x2				= new Texture2D(spriteBatch.GraphicsDevice, 2, 2);
            this.white1x1.SetData(new Color[] { Color.White });
            this.white2x2.SetData(new Color[] { Color.White, Color.White, Color.White, Color.White });

            this.drawingColor			= XnaColor.White;
        }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:23,代码来源:Graphics2D.cs

示例15: NearestFromVector

 public static int NearestFromVector(Vector2F vector)
 {
     // Cheap algorithm for turning a vector into an axis-aligned direction.
     if (vector.X > 0) {
         if (vector.X >= Math.Abs(vector.Y))
             return Directions.Right;
         else if (vector.Y < 0)
             return Directions.Up;
         else
             return Directions.Down;
     }
     else {
         if (-vector.X >= Math.Abs(vector.Y))
             return Directions.Left;
         else if (vector.Y < 0)
             return Directions.Up;
         else
             return Directions.Down;
     }
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:20,代码来源:Direction.cs


注:本文中的ZeldaOracle.Common.Geometry.Vector2F类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。