本文整理汇总了C#中Microsoft.Xna.Framework.Game类的典型用法代码示例。如果您正苦于以下问题:C# Game类的具体用法?C# Game怎么用?C# Game使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Game类属于Microsoft.Xna.Framework命名空间,在下文中一共展示了Game类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Human
public Human(Game game, SpriteBatch screenSpriteBatch,
PlayerSide playerSide)
: base(game, screenSpriteBatch)
{
string idleTextureName = "";
this.playerSide = playerSide;
if (playerSide == PlayerSide.Left)
{
catapultPosition = new Vector2(140, 332);
idleTextureName = "Textures/Catapults/Blue/blueIdle/blueIdle";
}
else
{
catapultPosition = new Vector2(600, 332);
spriteEffect = SpriteEffects.FlipHorizontally;
idleTextureName = "Textures/Catapults/Red/redIdle/redIdle";
}
Catapult = new Catapult(game, screenSpriteBatch,
idleTextureName, catapultPosition,
spriteEffect,
playerSide == PlayerSide.Left
? false : true, true);
}
开发者ID:VoronFX,项目名称:SummerPractice,代码行数:25,代码来源:Human.cs
示例2: Board
public Board(Game game, int posX = 224, int posY = 64, int width = 384, int height = 384)
: base(game) {
State = EBoardState.Initialize;
Score = 0;
Bounds = new Rectangle(posX, posY, width, height);
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:Board.cs
示例3: InputComponent
public InputComponent(Game game)
: base(game)
{
InteractTrigger = new Trigger<bool>();
ApplyTrigger = new Trigger<bool>();
InventoryTrigger = new Trigger<bool>();
JumpTrigger = new Trigger<bool>();
SlotLeftTrigger = new Trigger<bool>();
SlotRightTrigger = new Trigger<bool>();
SlotTrigger = new Trigger<bool>[SlotTriggerLength];
for (int i = 0; i < SlotTrigger.Length; i++)
SlotTrigger[i] = new Trigger<bool>();
gamepad = new GamePadInput();
keyboard = new KeyboardInput();
mouse = new MouseInput(game);
screenMouse = new MouseScreenInput();
inputDevices = new List<IInputSet>{
gamepad,
keyboard,
mouse
};
screenInputDevices = new List<IScreenInputSet>{
screenMouse
};
}
开发者ID:Vengarioth,项目名称:octoawesome,代码行数:28,代码来源:InputComponent.cs
示例4: ActionScene
public ActionScene(
IController playerOneController,
IController playerTwoController,
Game game,
Texture2D theTexture,
Texture2D backgroundTexture,
Rectangle screenBounds,
SpriteFont font,
Vector2 gameoverPosition)
: this(game, theTexture, backgroundTexture, font, gameoverPosition)
{
this.TwoPlayers = true;
this._player1 = new Player(Game, ref this._actionTexture, new Vector2(x: screenBounds.Width / 3, y: 0), new Rectangle(323, 15, 30, 30), playerOneController);
this._player1.Initialize();
Components.Add(this._player1);
this._scorePlayer2 = new Score(game, font, Color.Red)
{
Position =
new Vector2(
this.Game.Window.ClientBounds.Width - 200, 10)
};
Components.Add(this._scorePlayer2);
this._player2 = new Player(Game, ref this._actionTexture, new Vector2((int)(screenBounds.Width / 1.5), 0), new Rectangle(360, 17, 30, 30), playerTwoController);
this._player2.Initialize();
Components.Add(this._player2);
}
开发者ID:ImaginaryDevelopment,项目名称:RockRainEnhanced,代码行数:26,代码来源:ActionScene.cs
示例5: clsButton
private Texture2D texturaSelecionado; // botão em estado selecionado
#endregion Fields
#region Constructors
public clsButton(Game game, Texture2D TexturaNaoSelecionado, Texture2D TexturaSelecionado, Vector2 Posicao, EventHandler evento)
{
texturaNaoSelecionado = TexturaNaoSelecionado;
texturaSelecionado = TexturaSelecionado;
posicao = Posicao;
eventoClick = evento;
}
开发者ID:BigDogsGames,项目名称:XNA-TrabM2,代码行数:13,代码来源:clsButton.cs
示例6: ScreenItem
public ScreenItem(Game game, ApplicationSkin applicationSkin, float x, float y, float width, float height)
: base(game)
{
_position = new Vector2(x, y);
_size = new Vector2(width, height);
skin = applicationSkin;
}
开发者ID:jyavoc,项目名称:Project-Gaia,代码行数:7,代码来源:ScreenItem.cs
示例7: GameWindow
public GameWindow(Game game, RectangleF frame) : base (frame)
{
if (game == null)
throw new ArgumentNullException("game");
_game = game;
_platform = (MacGamePlatform)_game.Services.GetService(typeof(MacGamePlatform));
//LayerRetainsBacking = false;
//LayerColorFormat = EAGLColorFormat.RGBA8;
this.AutoresizingMask = MonoMac.AppKit.NSViewResizingMask.HeightSizable
| MonoMac.AppKit.NSViewResizingMask.MaxXMargin
| MonoMac.AppKit.NSViewResizingMask.MinYMargin
| MonoMac.AppKit.NSViewResizingMask.WidthSizable;
RectangleF rect = NSScreen.MainScreen.Frame;
clientBounds = new Rectangle (0,0,(int)rect.Width,(int)rect.Height);
// Enable multi-touch
//MultipleTouchEnabled = true;
// Initialize GameTime
_updateGameTime = new GameTime ();
_drawGameTime = new GameTime ();
// Initialize _lastUpdate
_lastUpdate = DateTime.Now;
}
开发者ID:adison,项目名称:Tank-Wars,代码行数:28,代码来源:GameWindow.cs
示例8: APNGHelper
public APNGHelper(Game game, string pngFile)
{
this.game = game;
var image = new APNG(pngFile);
numPlays = (int)image.acTLChunk.NumPlays;
baseFrame = new APNGFrame(game, image.DefaultImage);
if (image.IsSimplePNG)
{
CurrentFrame = baseFrame.FrameTexture;
}
else
{
numPlays = (int)image.acTLChunk.NumPlays;
foreach (Frame frame in image.Frames)
{
frameList.Add(new APNGFrame(this.game, frame));
}
sb = new SpriteBatch(this.game.GraphicsDevice);
RenderEachFrame();
CurrentFrame = renderedTextureList[0];
}
}
开发者ID:xupefei,项目名称:APNG.NET,代码行数:28,代码来源:APNGHelper.cs
示例9: Interface
public Interface(Game game)
: base(game)
{
_font = Game.Content.Load<SpriteFont>("Test");
_heartTexture = Game.Content.Load<Texture2D>("heart");
_potionTexture = Game.Content.Load<Texture2D>("potion");
}
开发者ID:floAr,项目名称:WarTornLands,代码行数:7,代码来源:Interface.cs
示例10: Player
public Player(Game game, Character character)
{
gameRef = (Game1)game;
camera = new Camera(gameRef.ScreenRectangle);
this.character = character;
Sprite.Position = new Vector2(1000, 1000);
}
开发者ID:Nanuq,项目名称:DragonSlice,代码行数:7,代码来源:Player.cs
示例11: Cursor
// this constructor doesn't really do much of anything, just calls the base
// constructor, and saves the contentmanager so it can be used in
// LoadContent.
public Cursor(Game game, ContentManager content)
: base(game)
{
this.content = content;
currentMouseState = Mouse.GetState();
previousMouseState = Mouse.GetState();
}
开发者ID:holtkampw,项目名称:UH-Engine,代码行数:10,代码来源:Cursor.cs
示例12: ScreenManager
/// <summary>
/// Constructs a new screen manager component.
/// </summary>
public ScreenManager(Game game)
: base(game)
{
// we must set EnabledGestures before we can query for them, but
// we don't assume the game wants to read them.
TouchPanel.EnabledGestures = GestureType.None;
}
开发者ID:nezek6,项目名称:Wizardry,代码行数:10,代码来源:ScreenManager.cs
示例13: PauseScreenController
public PauseScreenController(Game game, SpriteBatch sb)
: base(game)
{
spriteBatch = sb;
// graphics = new GraphicsDevice(game);
// TODO: Construct any child components here
}
开发者ID:calebperkins,项目名称:Ensembler,代码行数:7,代码来源:PauseScreen.cs
示例14: Cmc
public Cmc(Game game)
: base(game)
{
cmcTextures = new Texture2D[3];
cmcTextures[0] = game.Content.Load<Texture2D>("cmc1");
cmcTextures[1] = game.Content.Load<Texture2D>("cmc2");
cmcTextures[2] = game.Content.Load<Texture2D>("cmc3");
cmcTexels = new Color[3][];
for (int i = 0; i < 3; i++)
{
cmcTexels[i] = new Color[WIDTH * HEIGHT];
cmcTextures[i].GetData<Color>(cmcTexels[i]);
}
cmcChannels = new Color[][] {
new Color[] { new Color(210, 20, 255), new Color(220, 220, 220) }, //Purple and gray for Sweetie Belle
new Color[] { new Color(255, 150, 40), new Color(255, 64, 192) }, //Orange and maroon for Scootaloo
new Color[] { new Color(255, 255, 0), new Color(255, 0, 64) } //Yellow and red for Apple Bloom
};
texture = new Texture2D(device, WIDTH, HEIGHT);
textureColors = new Color[WIDTH * HEIGHT];
PrecalculatePoints();
}
开发者ID:noxo,项目名称:SecondRealityponyWinRT,代码行数:26,代码来源:Cmc.cs
示例15:
public EntitéPhysiqueGraphique(Game jeu, string nomModele, Vector3 position,Vector3 dimension, float intervalMAJ)
:base(jeu,position, intervalMAJ)
{
Dimension = dimension;
NomModèle = nomModele;
Échelle = 1;
}
开发者ID:karmoka,项目名称:NouveauProjetSIM,代码行数:7,代码来源:EntitéPhysiqueGraphique.cs
示例16: CarObject
public CarObject(Game game, Model model,Model wheels, bool FWDrive,
bool RWDrive,
float maxSteerAngle,
float steerRate,
float wheelSideFriction,
float wheelFwdFriction,
float wheelTravel,
float wheelRadius,
float wheelZOffset,
float wheelRestingFrac,
float wheelDampingFrac,
int wheelNumRays,
float driveTorque,
float gravity)
: base(game, model)
{
car = new Car(FWDrive, RWDrive, maxSteerAngle, steerRate,
wheelSideFriction, wheelFwdFriction, wheelTravel, wheelRadius,
wheelZOffset, wheelRestingFrac, wheelDampingFrac,
wheelNumRays, driveTorque, gravity);
this.body = car.Chassis.Body;
this.collision = car.Chassis.Skin;
this.wheel = wheels;
SetCarMass(100.0f);
}
开发者ID:shakalandro,项目名称:3DTestGame,代码行数:27,代码来源:CarObject.cs
示例17: FrameRateCounter
public FrameRateCounter(Game game)
: base(game)
{
this.frameRate = 0;
this.frameCounter = 0;
this.secondsPassed = 0;
}
开发者ID:Actualcookie,项目名称:GraphicsPract3,代码行数:7,代码来源:FrameRateCounter.cs
示例18: SplashScreen
public SplashScreen(Game game)
: base(game)
{
this.game = game;
game1 = (Game1)game;
// TODO: Construct any child components here
}
开发者ID:sirchip,项目名称:sadc-gamejam-test,代码行数:7,代码来源:SplashScreen.cs
示例19: SceneManager
public SceneManager(Game game)
: base(game)
{
Game.Components.Add(this);
Game.Services.AddService(typeof(SceneManager), this);
Game.Services.AddService(typeof(ISceneManager), this);
}
开发者ID:DelBero,项目名称:XnaScrap,代码行数:7,代码来源:SceneManager.cs
示例20: GameObject
public GameObject(Game1 game, Vector2 startLocation)
{
this.Game = game;
this.Location = startLocation;
this.Transparency = 1;
SpriteEffect = SpriteEffects.None;
}
开发者ID:Sedatb23,项目名称:Kapitein-Kat,代码行数:7,代码来源:GameObject.cs
注:本文中的Microsoft.Xna.Framework.Game类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论