ã¯ããã«
ãã®èšäºã§ã¯ãWindows Phoneçšã®Snakeã®ç°¡åãªããŒãžã§ã³ãäœæããæ¹æ³ã瀺ããŸãã ãžã§ã¹ãã£ãŒã䜿çšããŠãããŸããŸãªæ¹åã«ãããåããããšãã§ããŸãã ã¢ããªã±ãŒã·ã§ã³ã¯ãã¡ãã¥ãŒç»é¢ãã²ãŒã èªäœãããã³ã²ãŒã ã®çµæã衚瀺ãããæçµç»é¢ã§æ§æãããŸãã
Windows Phone 7.1 SDK
Windows Phone 7ãå®è¡ããŠããããã€ã¹çšã®ã¢ããªã±ãŒã·ã§ã³ãéçºããã«ã¯ãWindows Phone 7.1 SDKãã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ææ°ããŒãžã§ã³ã¯ãã¡ãããããŠã³ããŒãã§ããŸãã
Windows Phoneã²ãŒã
æ°ããWindows Phoneã²ãŒã ã®éçºãéå§ããã«ã¯ãMicrosoft Visual Studioãèµ·åããæ°ãããããžã§ã¯ããäœæããŠãWindows Phoneã²ãŒã ïŒ4.0ïŒãã³ãã¬ãŒããéžæããŸãã ãããžã§ã¯ãåãšããŠSnakeItã䜿çšããŸãã
ãã®äŸã§ã¯ãCïŒã䜿çšããŠã²ãŒã ãéçºããŸãã
ã²ãŒã çšã®ç»åã®æºå
ãŸããé£ã¹ç©ãšããèªäœã«ã·ã³ãã«ãªã°ã©ãã£ãã¯èŠçŽ ãè¿œå ããŸãã è¡šé¢å šäœã§ç¹°ãè¿ãããšãã§ãã25x25ã®ç»åã䜿çšããŸãã
é£ã¹ç©
ãã©ãŠã¶ã§SnakeItãããžã§ã¯ããœãªã¥ãŒã·ã§ã³ã®ã³ã³ãã³ããå³ã¯ãªãã¯ãã[è¿œå ]> [æ°ããã¢ã€ãã ...]ãéžæããŸãã
ãããããããã¡ã€ã«ãéžæããFootTile.bmpãšããååãä»ããŸã
é£ã¹ç©ã瀺ãããã«25x25ã®ç·ã®é·æ¹åœ¢ãæããŸãã ãã¡ã€ã«ãå¿ããã«ä¿åããŠãã ããã
ãã
åãææ³ã䜿çšããŠãããèªäœã®èµ€ãæ£æ¹åœ¢ãæããŸãã ç»åã«SnakeTile.bmpãšããååãä»ããŸãã
ã²ãŒã ãã©ã³ã
ç»åã®äœæã«äœ¿çšããã®ãšåãæ¹æ³ã§ãã²ãŒã ã®ãã©ã³ããäœæã§ããŸãã ãœãªã¥ãŒã·ã§ã³ãšã¯ã¹ãããŒã©ãŒã§ãããžã§ã¯ãã®ã³ã³ãã³ããå³ã¯ãªãã¯ãã[è¿œå ]> [æ°ããã¢ã€ãã ...]ãéžæããŸãã
Sprite FontãéžæããSegoe20.spritefontãšããååãä»ããŸãã
Project Explorerã§ãã©ã³ããããã«ã¯ãªãã¯ãããã®ãµã€ãºã20ã«èšå®ããŸããå¿ããã«ãã©ã³ããä¿åããŠãã ããã
é£åã®é£åã¯ã©ã¹ãäœæãã
ãœãªã¥ãŒã·ã§ã³ãšã¯ã¹ãããŒã©ãŒã§ãããžã§ã¯ãã®ã³ã³ãã³ããå³ã¯ãªãã¯ãã[è¿œå ]> [æ°ããã¢ã€ãã ]ãéžæããŸããã€ã³ã¹ããŒã«ãããŠãããã³ãã¬ãŒãã®ãªã¹ãã§[ã³ãŒã]ãéžæããFoodã¯ã©ã¹ãäœæããŸãã
ãã®ã¯ã©ã¹ã¯ããã¯ã¹ãã£ïŒãã¯ã¹ãã£ãã¿ã€ãïŒããã³äœçœ®ïŒäœçœ®ïŒã«é¢ããæ å ±ãæ ŒçŽããŸãã å¹ ãšé«ãã®å¯žæ³ã¯ãGame1ã¯ã©ã¹ã§è¡çªãå®çŸ©ããããã«äœ¿çšãããŸãã
using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace SnakeIt { class Food { // Texture representing the food public Texture2D Texture; // Position of the food relative to the upper left side of the screen public Vector2 Position; // Get the width of the food public int Width { get { return Texture.Width; } } // Get the height of the food public int Height { get { return Texture.Height; } } // Set Food Texture and Position public void Initialize(Texture2D texture, Vector2 position) { Texture = texture; Position = position; } // Draw Food to the Screen public void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Texture, Position, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } } }
Snakeã¯ã©ã¹ã®äœæ
Foodã¯ã©ã¹ãäœæããã®ãšåãæ¹æ³ã§Snakeã¯ã©ã¹ãäœæããŸãã
䜿çšå¯èœãªåå空é
XNA FrameworkãšCollectionsã®Listã¯ã©ã¹ã䜿çšããŠãããã®ãã¹ãŠã®ã¿ã€ã«ãåŠçããŸãã
using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic;
ããããã£
ãããå®çŸ©ããã«ã¯ããã®ããããã£ã®ããã€ããå®çŸ©ããŸãã ããã®ç»åããã¯ã¹ãã£ãã¯ã¹ãã£ãšããŠããŒãããç»é¢ã®äžå€®ã«ããã®åæäœçœ®ãèšå®ããŸãïŒããã¯Game1ã¯ã©ã¹ã®åŸåã§å®è£ ããŸãïŒã ãã¹ãŠã®ã¹ããŒã¯ã»ã«ã¯ãsnakeTilesãªã¹ãã«ä¿åãããŸãã ããã®åãã®æ¹åã¯ããžã§ã¹ãã£ãŒã䜿çšããŠGame1ã¯ã©ã¹ã§å¶åŸ¡ãããŸãã
// public Texture2D Texture; // public Vector2 Position; // public List<Tile> snakeTiles; // public float speed; const float speedIncrement = 0.2f; // // 1==, 2==, 3==, 4== public int direction; // -> public bool newTile;
åæå
Game1ã¯Snakeãªããžã§ã¯ããåæåããŸãã ã¹ããŒã¯ãã¯ã¹ãã£ãããŒãããããã®åæäœçœ®ãèšå®ãããŸãã ããã®ãã¹ãŠã®ããããã£ã¯ãæåã®èµ·åæããã³ãã¬ã€ã€ãŒãåã³ã²ãŒã ãå®äºããããšãã«ããã©ã«ãã®ããããã£ã«ãªã»ãããããŸãã ããã©ã«ãã§ã¯ãããã¯å·Šã«5ãã¯ã»ã«ç§»åãããã®é ã®ã»ã«ãäœæãããŸãã
// public void Initialize(Texture2D texture, Vector2 position) { Position = position; Texture = texture; Reset(); } // ( ) public void Reset() { speed = 5f; direction = 1; Tile tile = new Tile(Texture, Position); snakeTiles = new List<Tile>(); snakeTiles.Add(tile); newTile = false; }
æŽæ°ãã
ã²ãŒã ã¯ã¡ãœãããåŒã³åºããŠãæ°ããã²ãŒã ã¹ãããããšã«ãããæŽæ°ããŸãã ãã®æ¹æ³ã§ã¯ãèã®é ã®äœçœ®ãèŠã€ããŸãïŒããã¯snakeTilesãªã¹ãã®æåã®ã»ã«ã§ãïŒã ããã«æ°ããã»ã«ãè¿œå ããå¿ èŠãããå ŽåïŒã€ãŸããé£ã¹ç©ãé£ã¹ããããšãïŒãheadPostionã®æ°ããã»ã«ãäœæããsnakeTilesãªã¹ãã«è¿œå ããŸãã 次ã«ãããã®é ã ããåãããŠããã®ãµã€ãºã倧ããããŸãã ããã®æ°ããã»ã«ããã¯ãäºæ³ãããªãå ŽåãæåŸã®ã»ã«ãããã®ãé ãã«ç§»åããã ãã§ãããèªäœãæ°ããäœçœ®ã«ç§»åããŸãã
public void Update() { // Vector2 headPosition = snakeTiles[0].Position; // if (newTile) { // Tile tile = new Tile(Texture, headPosition); // SnakeTiles ( HeadPosition, ) snakeTiles.Insert(1, tile); } // , "" else if (snakeTiles.Count > 1) { Tile last = snakeTiles[snakeTiles.Count - 1]; last.Position = headPosition; snakeTiles.RemoveAt(snakeTiles.Count-1); snakeTiles.Insert(0, last); } // if (newTile) { speed += speedIncrement; newTile = false; } // "" switch (direction) { case 1: snakeTiles[0].Position.X -= speed; break; case 2: snakeTiles[0].Position.Y -= speed; break; case 3: snakeTiles[0].Position.X += speed; break; case 4: snakeTiles[0].Position.Y += speed; break; } }
æç»
åã¹ããŒã¯ã»ã«ã¯ãDrawïŒïŒã¡ãœããã§æç»ãããŸãã ãã®ã¡ãœããã¯ãGame1ã¯ã©ã¹ããåŒã³åºãããŸãã
public void Draw(SpriteBatch spriteBatch) { for (int i = 0; i < snakeTiles.Count; i++) { spriteBatch.Draw(snakeTiles[i].Texture, snakeTiles[i].Position, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } }
Tileã¯ã©ã¹ïŒSnakeã¯ã©ã¹ã«é¢é£ãããã¹ããããã¯ã©ã¹ïŒ
ãã¹ããããTileã¯ã©ã¹ãäœæããŸãã ãã®ã¯ã©ã¹ã¯ãããã®çŽ°èã決å®ããŸãã åã»ã«ã«ã¯ãäœçœ®ãšãã¯ã¹ãã£ããããŸãã
class Tile { public Vector2 Position; public Texture2D Texture; public Tile(Texture2D texture, Vector2 position) { Position = position; Texture = texture; } // public int Width { get { return Texture.Width; } } // public int Height { get { return Texture.Height; } } }
ã¯ã©ã¹ã²ãŒã 1
Game1ã¯ã©ã¹ã¯ãWindows Phone XNA Gamesã«åºã¥ãã²ãŒã ã®ã¡ã€ã³ã¯ã©ã¹ã§ãã ããã§ãã²ãŒã ã®ã³ã³ãã³ãã®åæåãšããŒããè¡ãããŸãã ãžã§ã¹ãã£ãŒãšè¡çªæ€åºã¯ãUpdateã¡ãœãããšåŒã°ããã²ãŒã ã¡ãœããã§äœ¿çšãããŸãã Drawã¯GameModeããããã£ã«ãã£ãŠã²ãŒã ã¢ãŒãããã§ãã¯ãã察å¿ããç»é¢ãæç»ããŸãã
åå空é
éåžžã®XNAããã³Touchã¯ã©ã¹ã䜿çšããŠããžã§ã¹ãã£ãŒãå®çŸ©ããŸãã
using System; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input.Touch;
ããããã£
GraphicsDeviceManageã¯ã©ã¹ã䜿çšããŠãçŸåšã®ãã£ã¹ãã¬ã€ã«é¢ããæ å ±ãååŸããŸãã SpriteBatchã¯ã©ã¹ã¯ãç»é¢ã«æ å ±ã衚瀺ããããã«äœ¿çšãããŸãã ã¡ãã¥ãŒãã²ãŒã èªäœããŸãã¯ã²ãŒã å®äºã¢ãŒããæç»ããããã«ãDrawïŒïŒã¡ãœããã§äœãèµ·ãã£ãŠããããå¶åŸ¡ããããã«ãããŸããŸãªã²ãŒã ã¢ãŒãã䜿çšããããšã«ããŸããã ããã¯ãç»é¢äžã®ããŸããŸãªã¢ãŒãã®æç»ãåŠçããéåžžã«ç°¡åãªæ¹æ³ã§ãã ããã«ããã®åé¡ã解決ããããã®ççºçãªã¢ãããŒããå¯èœã§ãïŒãªã³ã¯ïŒ Game State Managementãåç §ïŒã çŸåšã®ã²ãŒã ã¢ãŒãã¯Modeããããã£ã«æ ŒçŽããããã¹ãŠã®çš®é¡ã®ã¢ãŒãã¯GameModeã®åæãšããŠå®çŸ©ãããŸãã
// private GraphicsDeviceManager graphics; // private SpriteBatch spriteBatch; // private Snake snake; // private Food food; // private SpriteFont segoe20; // private Vector2 scorePosition; // private float score; private const float FOOD_POINTS = 20; // GameMode Mode; // enum GameMode {Menu, Running, Complete}
ã³ã³ã¹ãã©ã¯ã¿ãŒ
ãŸããGraphicsDeviceManageã¯ã©ã¹ã«æ¥ç¶ãããã£ã¬ã¯ããªã«ãã¹ãŠã®ã³ã³ãã³ãã¹ãã©ã€ããšãã©ã³ããæå®ããŸãã ããã©ã«ãã§ã¯ããã¬ãŒã ã¬ãŒãã¯30ãã¬ãŒã /ç§ã«èšå®ãããŠããŸãã ãŸããã¿ããããã³ããªãã¯ãžã§ã¹ãã£ãŒãæå¹ã«ããå¿ èŠããããŸãã ããŸããŸãªã²ãŒã ã¢ãŒãã¯ã¿ãããžã§ã¹ãã£ãŒã䜿çšããŠå€æŽãããããã®åãã¯ããªãã¯ãžã§ã¹ãã£ãŒã«ãã£ãŠå¶åŸ¡ãããŸãã
public Game1() { // graphics = new GraphicsDeviceManager(this); // Content.RootDirectory = "Content"; // 30 Windows Phone. TargetElapsedTime = TimeSpan.FromTicks(333333); // . InactiveSleepTime = TimeSpan.FromSeconds(1); // Tap Flick TouchPanel.EnabledGestures = GestureType.Tap | GestureType.Flick; }
ã²ãŒã ã®åæå
Initializeã¡ãœããã䜿çšãããšãã²ãŒã èªäœãéå§ããåã«ãã²ãŒã ãšãã®ãã¹ãŠã®ãªãœãŒã¹ãåæåããã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãã ããã§ã¯ãã²ãŒã ã¢ãŒããèšå®ããé£ã¹ç©ãšããèªäœã®ãªããžã§ã¯ããäœæããŸãã
protected override void Initialize() { // Menu, Menu Draw() Mode = GameMode.Menu; // snake = new Snake(); food = new Food(); // 0 score = 0f; base.Initialize(); }
ã¹ãã©ã€ããšãã©ã³ããããŠã³ããŒããã
LoadContentã¯ããã¹ãŠã®ãã¡ã€ã«ãèªã¿èŸŒãããã«äžåºŠåŒã³åºãããŸãã ãŸããSpriteBatchã䜿çšããŠã°ã©ãã£ãã¯ããã€ã¹ã«æ¥ç¶ããåŸã§ç»é¢äžã«ãªããžã§ã¯ããæç»ã§ããããã«ããŸãã 次ã«ãé£ã¹ç©ãšèã®ãã¯ã¹ãã£ãã¢ããããŒãããŠäœæããŸãã ãã®æç¹ã§ã察å¿ããSnakeã¯ã©ã¹ãšFoodã¯ã©ã¹ã§Initializeã¡ãœãããåŒã³åºãããŸãã ãŸãããã©ã³ããäœæããäœçœ®ãèšç®ããŠãã€ã³ãæ°ã衚瀺ããŸãã
protected override void LoadContent() { // SpriteBatch spriteBatch = new SpriteBatch(GraphicsDevice); // Vector2 snakePosition = new Vector2( GraphicsDevice.Viewport.TitleSafeArea.X + GraphicsDevice.Viewport.TitleSafeArea.Width / 2, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2); snake.Initialize(Content.Load<Texture2D>("SnakeTile"), snakePosition); // Vector2 foodPosition = RandPosition(); food.Initialize(Content.Load<Texture2D>("FoodTile"), foodPosition); // segoe20 = this.Content.Load<SpriteFont>("Segoe20"); // scorePosition = new Vector2(20, 20); }
ã²ãŒã æŽæ°
æŽæ°ã¯ãã²ãŒã ãæŽæ°ããããã®ããžãã¯ãå®è£ ããŸãïŒè¡çªãã§ãã¯ãå ¥åãžã®å¿çããªãŒãã£ãªã®åçã ããã§ã¯ãã²ãŒã ã®å®è¡äžã«ããã®äœçœ®ãæŽæ°ãããããšé£ç©ãšã®è¡çªããã§ãã¯ããŸãã ã²ãŒã ãå®è¡ãããŠãããã©ããã«é¢ä¿ãªãããã®ã¡ãœãããåŒã³åºããããã³ã«ãã¹ãŠã®ãžã§ã¹ãã£ãŒããã§ãã¯ãããŸãã
protected override void Update(GameTime gameTime) { // if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); if (Mode == GameMode.Running) { snake.Update(); CheckCollision(); } CheckGestures(); base.Update(gameTime); }
è¡çªã確èªãã
é£ã¹ç©ãšããã®ãé ãã®äœçœ®ã¯ã察å¿ããRectangleãªããžã§ã¯ãã§èšç®ãããŸãã ãã®åŸãçµã¿èŸŒã¿ã®äº€å·®ã¡ãœããã䜿çšããŠãé·æ¹åœ¢ã®äº€å·®ã決å®ã§ããŸãã ãã®å Žåãããã«ããé£äºã決å®ãããå Žåããã€ã³ãæ°ãå¢ãããŠã©ã³ãã ãªæ°ããäœçœ®ã«é£ç©ã¹ãã©ã€ããäœæããŸãïŒããã«èªåèªèº«ãæŽæ°ããŠæ°ããã»ã«ãè¿œå ããå¿ èŠãããããšãäŒããŸãïŒã ããã®é ãç»é¢ãè¶ããå Žåãã²ãŒã ã¯çµäºãããšèŠãªãããŸãã
private void CheckCollision() { // int snakeHeadX = (int)snake.snakeTiles[0].Position.X; int snakeHeadY = (int)snake.snakeTiles[0].Position.Y; Rectangle rectangle1 = new Rectangle(snakeHeadX, snakeHeadY, snake.snakeTiles[0].Width, snake.snakeTiles[0].Height); Rectangle rectangle2 = new Rectangle((int)food.Position.X, (int)food.Position.Y, food.Width, food.Height); // if (rectangle1.Intersects(rectangle2)) { // score += FOOD_POINTS; // food.Position = RandPosition(); // snake.newTile = true; } // if (snakeHeadX < 0 || snakeHeadY < 0 || snakeHeadX + snake.snakeTiles[0].Width > GraphicsDevice.Viewport.Width || snakeHeadY + snake.snakeTiles[0].Height > GraphicsDevice.Viewport.Height) { Mode = GameMode.Complete; } }
以äžã®æ¹æ³ã¯ãããŒãã¹ãã©ã€ããæ°ããã©ã³ãã ãªäœçœ®ã«ç§»åããããã«äœ¿çšãããŸãã
private Vector2 RandPosition() { // Random random = new Random(); Vector2 position = new Vector2( GraphicsDevice.Viewport.TitleSafeArea.X + random.Next(GraphicsDevice.Viewport.TitleSafeArea.Width - 45) + 20, GraphicsDevice.Viewport.TitleSafeArea.Y + random.Next(GraphicsDevice.Viewport.TitleSafeArea.Height - 45) + 20); return position; }
ãžã§ã¹ãã£ãŒãã§ãã¯
ãžã§ã¹ãã£ãŒã¯ãæ¯åUpdateã¡ãœããã§ãã§ãã¯ãããŸãã æåã«ãæ°ãããžã§ã¹ãã£ã䜿çšå¯èœãã©ããã確èªãã䜿çšå¯èœãªå Žåã¯èªã¿åããŸãã Flickã®ãããªãžã§ã¹ãã£ãŒãå®çŸ©ãããŠããå ŽåãDeltaå€ãååŸããŸãã ãã®åŸãããã¯é©åãªæ¹åã«ç§»åããŸãã ãã¬ã€ã€ãŒã¯ãããå察æ¹åã«åããããšã¯ã§ããŸããïŒã²ãŒã ã¯çµäºããŸãïŒã ã¿ãããžã§ã¹ãã£ãæ€åºããããšãã²ãŒã ã¢ãŒããå€æŽãããŸãïŒã¡ãã¥ãŒããæ°ããã²ãŒã ãéå§ããããã²ãŒã ãåèµ·åããŸãïŒã
private void CheckGestures() { // ? while (TouchPanel.IsGestureAvailable) { // GestureSample gesture = TouchPanel.ReadGesture(); // Flick Tap? switch (gesture.GestureType) { case GestureType.Flick: // ? Single x = gesture.Delta.X, y = gesture.Delta.Y; // ? if (Math.Abs(x) > Math.Abs(y)) { // left or right if (x < 0) { if (snake.direction == 3 && snake.snakeTiles.Count() > 1) Mode = GameMode.Complete; else snake.direction = 1; // } else { if (snake.direction == 1 && snake.snakeTiles.Count() > 1) Mode = GameMode.Complete; else snake.direction = 3; // } } else { // ? if (y < 0) { if (snake.direction == 4 && snake.snakeTiles.Count() > 1) Mode = GameMode.Complete; else snake.direction = 2; // } else { if (snake.direction == 2 && snake.snakeTiles.Count() > 1) Mode = GameMode.Complete; else snake.direction = 4; // } } break; case GestureType.Tap: // Menu Running if (Mode == GameMode.Menu) { Mode = GameMode.Running; } // Complete Running else if (Mode == GameMode.Complete) { snake.Reset(); score = 0f; Mode = GameMode.Running; } break; } } }
ãã£ã¹ãã¬ã€ã²ãŒã
Drawã¡ãœããã¯ãã²ãŒã ãèªåèªèº«ãæããšãã«åŒã³åºãããŸãã ãã®äŸã§ã¯ãéè²ã®èæ¯ã®ã¿ã䜿çšãããŠããŸãã ãã®ã¡ãœããã¯ãã²ãŒã ã¢ãŒãããã§ãã¯ãã察å¿ããç»é¢ãæç»ããŸãã ã²ãŒã ãæåã«èªã¿èŸŒãŸãããšããFreeSnakeãã¿ããããŠç»é¢ãéå§ããšããããã¹ãã衚瀺ãããŸãã ãŠãŒã¶ãŒãã²ãŒã ããã¬ã€ãããšããããããã®é€ããã€ã³ãæ°ã衚瀺ãããŸãã åŸç¹ãšåãã¬ã€ã®ç³ãåºã«é¢ããæ å ±ã¯ãã²ãŒã ã®æåŸã«è¡šç€ºãããŸãã
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // spriteBatch.Begin(); if (Mode == GameMode.Menu) { string GameStart = "FreeSnake\nTap the Screen to Start"; Vector2 stringSize = segoe20.MeasureString(GameStart); spriteBatch.DrawString(segoe20, GameStart, new Vector2((GraphicsDevice.Viewport.Width - stringSize.X) / 2, (GraphicsDevice.Viewport.Height - stringSize.Y) / 2), Color.White); } else if (Mode == GameMode.Running) { // snake.Draw(spriteBatch); // food.Draw(spriteBatch); // spriteBatch.DrawString(segoe20, "Score:"+score, scorePosition, Color.White); } else if (Mode == GameMode.Complete) { snake.Draw(spriteBatch); string GameOver = "Game Over\nScore : " + score +"\nTap the Screen to Restart"; Vector2 stringSize = segoe20.MeasureString(GameOver); spriteBatch.DrawString(segoe20, GameOver, new Vector2((GraphicsDevice.Viewport.Width - stringSize.X) / 2, (GraphicsDevice.Viewport.Height - stringSize.Y) / 2), Color.White); } // spriteBatch.End(); base.Draw(gameTime); }
ãããã«
ãã®äŸã§ã¯ãWindows Phoneçšã®ãžã§ã¹ãã£ãŒã²ãŒã ãäœæããããã«å¿ èŠãªåºæ¬æ å ±ã瀺ããŸããã
çµæãšããŠåŸãããã²ãŒã ã®ãœãŒã¹ã³ãŒãã¯ã ããã«ãããŸã ã
ãããŠããäžã€
ãŸãã5æ20æ¥ãŸã§ã«ãã³ã³ãã¹ãã Best Applications Free Promotion ãã®ã¢ããªã±ãŒã·ã§ã³ãNokiaããã³Microsoftããåãåãããããšããç¥ããããŸãã Windows Phone 7çšã®ã¢ããªã±ãŒã·ã§ã³ãšã²ãŒã ãéä¿¡ããŠãNokia Lumia 800ã¹ããŒããã©ã³ãç²åŸãããã£ã³ã¹ãç²åŸããNokiaããã³Microsoftãã©ãããã©ãŒã ã§ã¢ããªã±ãŒã·ã§ã³ãç¡æã§å®£äŒããŠãã ããã