Esempio n. 1
0
        public WallSprite( FluxGame fluxGame, Vector2 position, float width, float height )
            : base(fluxGame, new Vector2( width, height ), position)
        {
            Body = BodyFactory.CreateRectangle( Game.PhysicsWorld, ConvertUnits.ToSimUnits( Size.X ), ConvertUnits.ToSimUnits( Size.Y ), 1f, ConvertUnits.ToSimUnits( position ) );

            Origin = new Vector2( width / 2f, height / 2f );
        }
Esempio n. 2
0
        public WallSprite(FluxGame fluxGame, Vector2 position, float width, float height)
            : base(fluxGame, new Vector2(width, height), position)
        {
            Body = BodyFactory.CreateRectangle(Game.PhysicsWorld, ConvertUnits.ToSimUnits(Size.X), ConvertUnits.ToSimUnits(Size.Y), 1f, ConvertUnits.ToSimUnits(position));

            Origin = new Vector2(width / 2f, height / 2f);
        }
Esempio n. 3
0
        /// <summary>
        /// Creates the prefabs.
        /// </summary>
        /// <param name="game">The game.</param>
        public static void CreatePrefabs( FluxGame game )
        {
            MoveOverlaySprite = new MoveOverlaySprite( game );
            RotationOverlaySprite = new RotationOverlaySprite( game );

            game.SpriteManager.Add( MoveOverlaySprite );
            game.SpriteManager.Add( RotationOverlaySprite );
        }
Esempio n. 4
0
        public Player(FluxGame game)
        {
            this.game = game;

            Sprite = new BallSprite(game, new Vector2(game.HUD.Width / 4f, game.HUD.Height / 4f));
            game.HUD.HUDObjects.Add(new SpeedComponent(game));
            game.SpriteManager.Add(Sprite);
        }
        public CursorLocationComponent( FluxGame game )
        {
            this._game = game;

            #if XBOX
            this._position = new Vector2(55, 35);
            #else
            this._position = new Vector2( 30, game.HUD.Height - 65 );
            #endif
        }
        public CursorLocationComponent(FluxGame game)
        {
            this._game = game;

#if XBOX
            this._position = new Vector2(55, 35);
#else
            this._position = new Vector2(30, game.HUD.Height - 65);
#endif
        }
Esempio n. 7
0
        /// <summary>
        /// Creates the prefabs.
        /// </summary>
        /// <param name="game">The game.</param>
        public static void CreatePrefabs ( FluxGame game ) {

            MoveOverlaySprite = new MoveOverlaySprite( game );
            RotationOverlaySprite = new RotationOverlaySprite( game );


            game.SpriteManager.Add( MoveOverlaySprite );
            game.SpriteManager.Add( RotationOverlaySprite );

        }
Esempio n. 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ToolBox"/> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <param name="slots">The slots.</param>
        public ToolBox(FluxGame game, Slot[] slots)
        {
            this.game  = game;
            this.Slots = slots;

            this.screenSize = new Vector2(game.HUD.Width, game.HUD.Height);
            this.toolPos    = new Vector2(screenSize.X / 2, screenSize.Y - Size.Y / 2);

            this.ActiveBlocks = new List <Block> ();
        }
Esempio n. 9
0
        public FPSComponent(FluxGame game)
        {
            this._game   = game;
            this._format = new NumberFormatInfo()
            {
                NumberDecimalSeparator = "."
            };

#if XBOX
            this._position = new Vector2(55, 35);
#else
            this._position = new Vector2(30, 25);
#endif
        }
Esempio n. 10
0
        public ContentManager( FluxGame fluxGame, string theme )
        {
            BallTexture = fluxGame.Content.Load<Texture2D>( "Wood/Textures/BallTexture" );
            WallTexture = fluxGame.Content.Load<Texture2D>( "Wood/Textures/WallTexture" );
            CursorTexture = fluxGame.Content.Load<Texture2D>( "Wood/Textures/CursorTexture" );
            ToolBoxTexture = fluxGame.Content.Load<Texture2D>( "Wood/Textures/ToolBoxTexture" );
            TriangleTexture = fluxGame.Content.Load<Texture2D>( "Wood/Textures/TriangleTexture" );
            TriangleTexture_Hover = fluxGame.Content.Load<Texture2D>( "Wood/Textures/TriangleTexture_Hover" );
            RotationOverlay = fluxGame.Content.Load<Texture2D>( "Wood/Textures/RotationOverlay" );
            MoveOverlay = fluxGame.Content.Load<Texture2D>( "Wood/Textures/MoveOverlay" );

            FPSFont = fluxGame.Content.Load<SpriteFont>( "Fonts/fpsfont" );
            ToolBoxFont = fluxGame.Content.Load<SpriteFont>( "Fonts/ToolBoxFont" );
        }
Esempio n. 11
0
        public ContentManager(FluxGame fluxGame, string theme)
        {
            BallTexture           = fluxGame.Content.Load <Texture2D>("Wood/Textures/BallTexture");
            WallTexture           = fluxGame.Content.Load <Texture2D>("Wood/Textures/WallTexture");
            CursorTexture         = fluxGame.Content.Load <Texture2D>("Wood/Textures/CursorTexture");
            ToolBoxTexture        = fluxGame.Content.Load <Texture2D>("Wood/Textures/ToolBoxTexture");
            TriangleTexture       = fluxGame.Content.Load <Texture2D>("Wood/Textures/TriangleTexture");
            TriangleTexture_Hover = fluxGame.Content.Load <Texture2D>("Wood/Textures/TriangleTexture_Hover");
            RotationOverlay       = fluxGame.Content.Load <Texture2D>("Wood/Textures/RotationOverlay");
            MoveOverlay           = fluxGame.Content.Load <Texture2D>("Wood/Textures/MoveOverlay");


            FPSFont     = fluxGame.Content.Load <SpriteFont>("Fonts/fpsfont");
            ToolBoxFont = fluxGame.Content.Load <SpriteFont>("Fonts/ToolBoxFont");
        }
Esempio n. 12
0
        public BallSprite(FluxGame fluxGame, Vector2 spawnPos)
            : base(fluxGame, DEFAULT_SIZE, spawnPos)
        {
            this.spawnPos = spawnPos;
            this.Body     = BodyFactory.CreateCircle(Game.PhysicsWorld, ConvertUnits.ToSimUnits(Size.X), 1f, ConvertUnits.ToSimUnits(spawnPos));
            this.Body.CreateFixture(new CircleShape(ConvertUnits.ToSimUnits(Size.X), 2f));
            this.Body.FixtureList[0].Restitution = .2f;
            this.Body.BodyType = BodyType.Dynamic;

            this.Body.AngularDamping = 25f;
            this.Body.Friction       = 25f;

            Origin         = Size;
            this.ZoomScale = Size.X / 25f;
        }
Esempio n. 13
0
        public BallSprite( FluxGame fluxGame, Vector2 spawnPos )
            : base(fluxGame, DEFAULT_SIZE, spawnPos)
        {
            this.spawnPos = spawnPos;
            this.Body = BodyFactory.CreateCircle( Game.PhysicsWorld, ConvertUnits.ToSimUnits( Size.X ), 1f, ConvertUnits.ToSimUnits( spawnPos ) );
            this.Body.CreateFixture ( new CircleShape ( ConvertUnits.ToSimUnits ( Size.X ), 2f ) );
            this.Body.FixtureList[ 0 ].Restitution = .2f;
            this.Body.BodyType = BodyType.Dynamic;

            this.Body.AngularDamping = 25f;
            this.Body.Friction = 25f;

            Origin = Size;
            this.ZoomScale = Size.X / 25f;
        }
Esempio n. 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EqualTriangleBlock"/> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <param name="size">The size.</param>
        /// <param name="position">The position.</param>
        public EqualTriangleBlock(FluxGame game, Vector2 size, Vector2 position)
            : base(game, position)
        {
            float width      = ConvertUnits.ToSimUnits(size.X);
            float height     = ConvertUnits.ToSimUnits(size.Y);
            float halfWidth  = width * 0.5f;
            float halfHeight = height * 0.5f;

            float       top     = -halfHeight;
            float       bottom  = halfHeight;
            float       left    = -halfHeight;
            const float centerX = 0;
            float       right   = halfWidth;

            Vector2[] vertices = { new Vector2(centerX, top), new Vector2(right, bottom), new Vector2(left, bottom) };
            Vertices = new Vertices(vertices);

            Body          = BodyFactory.CreatePolygon(game.PhysicsWorld, Vertices, 1f, game.Camera.ConvertScreenLocationToWorldLocation(position));
            Body.BodyType = BodyType.Static;

            Origin = size / 2f;
        }
Esempio n. 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EqualTriangleBlock"/> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <param name="size">The size.</param>
        /// <param name="position">The position.</param>
        public EqualTriangleBlock( FluxGame game, Vector2 size, Vector2 position )
            : base(game, position)
        {
            float width = ConvertUnits.ToSimUnits( size.X );
            float height = ConvertUnits.ToSimUnits( size.Y );
            float halfWidth = width * 0.5f;
            float halfHeight = height * 0.5f;

            float top = -halfHeight;
            float bottom = halfHeight;
            float left = -halfHeight;
            const float centerX = 0;
            float right = halfWidth;

            Vector2[] vertices = { new Vector2( centerX, top ), new Vector2( right, bottom ), new Vector2( left, bottom ) };
            Vertices = new Vertices( vertices );

            Body = BodyFactory.CreatePolygon( game.PhysicsWorld, Vertices, 1f, game.Camera.ConvertScreenLocationToWorldLocation( position ) );
            Body.BodyType = BodyType.Static;

            Origin = size / 2f;
        }
 public MousePointerLocationComponent( FluxGame fluxGame )
 {
     this._game = fluxGame;
 }
Esempio n. 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveOverlaySprite"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 /// <param name="size">The size.</param>
 /// <param name="position">The position.</param>
 public MoveOverlaySprite( FluxGame game, Vector2 size, Vector2 position )
     : base(game, size, position)
 {
 }
Esempio n. 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EqualTriangleBlock"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public EqualTriangleBlock( FluxGame game )
     : this(game, DEFAULT_SIZE)
 {
 }
Esempio n. 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EqualTriangleBlock"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 /// <param name="position">The position.</param>
 public EqualTriangleBlock( FluxGame game, Vector2 position )
     : this(game, DEFAULT_SIZE, position)
 {
 }
Esempio n. 20
0
 public BallSprite(FluxGame fluxGame)
     : this(fluxGame, DEFAULT_SIZE)
 {
 }
Esempio n. 21
0
 public SpeedComponent( FluxGame game )
 {
     this._game = game;
     this._position = new Vector2( game.HUD.Width - ContentManager.FPSFont.MeasureString( "ABCDE" ).X - 4,
                                   game.HUD.Height - ContentManager.FPSFont.MeasureString( "|" ).Y - 4 );
 }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MySprite"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public RotationOverlaySprite(FluxGame game) : this(game, Vector2.Zero, Vector2.Zero)
 {
 }
Esempio n. 23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MySprite"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public RotationOverlaySprite( FluxGame game )
     : this(game, Vector2.Zero, Vector2.Zero)
 {
 }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveOverlaySprite"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public MoveOverlaySprite( FluxGame game )
     : this(game, Vector2.Zero, Vector2.Zero)
 {
 }
Esempio n. 25
0
 public BallSprite( FluxGame fluxGame )
     : this(fluxGame, DEFAULT_SIZE)
 {
 }
Esempio n. 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveOverlaySprite"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public MoveOverlaySprite(FluxGame game) : this(game, Vector2.Zero, Vector2.Zero)
 {
 }
Esempio n. 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ToolBox"/> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <param name="slots">The slots.</param>
        public ToolBox( FluxGame game, Slot[] slots )
        {
            this.game = game;
            this.Slots = slots;

            this.screenSize = new Vector2 ( game.HUD.Width, game.HUD.Height );
            this.toolPos = new Vector2 ( screenSize.X / 2, screenSize.Y - Size.Y / 2 );

            this.ActiveBlocks = new List<Block> ();
        }
Esempio n. 28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToolBox"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public ToolBox( FluxGame game )
     : this(game, new Slot[ 6 ])
 {
 }
Esempio n. 29
0
 public EqualTriangleTool(FluxGame game) : base(game)
 {
 }
Esempio n. 30
0
 public CursorComponent( FluxGame game )
 {
     this._game = game;
 }
Esempio n. 31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MySprite"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 /// <param name="size">The size.</param>
 /// <param name="position">The position.</param>
 public RotationOverlaySprite(FluxGame game, Vector2 size, Vector2 position)
     : base(game, size, position)
 {
 }
Esempio n. 32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EqualTriangleBlock"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 /// <param name="position">The position.</param>
 public EqualTriangleBlock(FluxGame game, Vector2 position)
     : this(game, DEFAULT_SIZE, position)
 {
 }
Esempio n. 33
0
 public CursorComponent(FluxGame game)
 {
     this._game = game;
 }
Esempio n. 34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EqualTriangleBlock"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public EqualTriangleBlock(FluxGame game)
     : this(game, DEFAULT_SIZE)
 {
 }
Esempio n. 35
0
 public SpeedComponent(FluxGame game)
 {
     this._game     = game;
     this._position = new Vector2(game.HUD.Width - ContentManager.FPSFont.MeasureString("ABCDE").X - 4,
                                  game.HUD.Height - ContentManager.FPSFont.MeasureString("|").Y - 4);
 }
Esempio n. 36
0
 internal Background(FluxGame gaem)
     : base(gaem)
 {
 }
Esempio n. 37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToolBox"/> class.
 /// </summary>
 /// <param name="game">The game.</param>
 public ToolBox(FluxGame game)
     : this(game, new Slot[6])
 {
 }
Esempio n. 38
0
 public MousePointerLocationComponent(FluxGame fluxGame)
 {
     this._game = fluxGame;
 }