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 ); }
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); }
/// <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 ); }
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 }
/// <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 ); }
/// <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> (); }
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 }
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" ); }
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"); }
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; }
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; }
/// <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; }
/// <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; }
/// <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) { }
/// <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) { }
/// <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) { }
public BallSprite(FluxGame fluxGame) : this(fluxGame, DEFAULT_SIZE) { }
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 ); }
/// <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) { }
/// <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) { }
/// <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) { }
public BallSprite( FluxGame fluxGame ) : this(fluxGame, DEFAULT_SIZE) { }
/// <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) { }
/// <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> (); }
/// <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 ]) { }
public EqualTriangleTool(FluxGame game) : base(game) { }
public CursorComponent( FluxGame game ) { this._game = game; }
/// <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) { }
/// <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) { }
public CursorComponent(FluxGame game) { this._game = game; }
/// <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) { }
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); }
internal Background(FluxGame gaem) : base(gaem) { }
/// <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]) { }
public MousePointerLocationComponent(FluxGame fluxGame) { this._game = fluxGame; }