コード例 #1
0
ファイル: PlayerManager.cs プロジェクト: Raynd/XNA_RPG
 public PlayerManager(Game1 game)
 {
     currentPlayer = 1;
     this.game = game;
     charList = (List<Character>)game.Services.GetService(typeof(List<Character>));
     this.gameTime = (GameTime)game.Services.GetService(typeof(GameTime));
 }
コード例 #2
0
ファイル: ChampionOne.cs プロジェクト: Raynd/XNA_RPG
        public ChampionOne(Game1 game, int xLoc, int yLoc, int playerIndex)
            : base(game, xLoc, yLoc)
        {
            map = (BattleMap)game.Services.GetService(typeof(BattleMap));
            gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager));
            screenManager = (ScreenManager)game.Services.GetService(typeof(ScreenManager));
            this.game = game;
            walk = new Texture2D[2];
            attack = new Texture2D[5];
            PlayerIndex = playerIndex;

            Initialize();
            LoadContent();

            this.Move(xLoc, yLoc);
            PlayerIndex = playerIndex;
            HasMoved = false;
            HasAttacked = false;
            Alive = true;
            CharType = "champion";
            MoveDistance = 4;
            HealthPoints = 50;
            Strength = 20;
            PDefense = 15;
            MDefense = 15;
            Dexterity = 10;
            AttackRange = 1;
            CurrentHealth = HealthPoints;
            Gold = 500;
            Level = 2;
            Experience = 0;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: Mainmatsu/Learning
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: EvilWar/WindowsGame2
        static void ShowScreenSaver(IntPtr parentHwnd)
        {
            using (Game1 game = new Game1(parentHwnd))
            {
                game.Run();

            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: EvilWar/WindowsGame2
        static void ShowScreenSaver()
        {
            using (Game1 game = new Game1())
                {
                    game.Run();

                }
        }
コード例 #6
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // When the constructor is called assign the static instance to be the object
            Instance = this;
        }
コード例 #7
0
ファイル: GameStateClass.cs プロジェクト: huskpurin/MIS103
        public static void changeState(GameState gs, Game1 game)
        {
            currentGameState = gs;

            if (gs == GameState.Menu)
                game.Window.Title = "Menu";
            else if (gs == GameState.CountryGuide)
                game.Window.Title = "Guide";
            else if (gs == GameState.GameNormal)
                game.Window.Title = "";
            else if (gs == GameState.GameTime)
                game.Window.Title = "";
            else if (gs == GameState.GamePractice)
                game.Window.Title = "";
            else if (gs == GameState.Help)
                game.Window.Title = "";
        }
コード例 #8
0
ファイル: MainMenuScreen.cs プロジェクト: Raynd/XNA_RPG
        /// <summary>
        public MainMenuScreen(Game1 game)
            : base("Main Menu")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");
            this.game = game;

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(exitMenuEntry);

            gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager));
        }
コード例 #9
0
ファイル: MercenaryCamp.cs プロジェクト: Raynd/XNA_RPG
        public MercenaryCamp(Game1 game, int xLoc, int yLoc)
            : base(game, xLoc, yLoc)
        {
            map = (BattleMap)game.Services.GetService(typeof(BattleMap));
            gameStateManager = (GameStateManager)game.Services.GetService(typeof(GameStateManager));
            map.GetSquare(yLoc, xLoc).setCurrentChar(this);

            Initialize();
            LoadContent();

            position.X = xLoc * 60;
            position.Y = yLoc * 60 + 20;
            Alive = true;
            HasAttacked = false;
            HasMoved = false;
            CharType = "camp";
            HealthPoints = 100;
        }
コード例 #10
0
ファイル: OptionsScreen.cs プロジェクト: Raynd/XNA_RPG
        public OptionsScreen(Game1 game)
        {
            const string usageText = "Play Against AI?\n"
                                        + "A: Yes B: No";
            this.message = message + usageText;

            IsPopup = true;

            TransitionOnTime = TimeSpan.FromSeconds(0.2);
            TransitionOffTime = TimeSpan.FromSeconds(0.2);

            menuAccept = new InputAction(
                new Buttons[] { Buttons.A },
                new Keys[] { Keys.A },
                true);
            menuCancel = new InputAction(
                new Buttons[] { Buttons.B },
                new Keys[] { Keys.B },
                true);

            this.game = game;
        }
コード例 #11
0
ファイル: PlayerManager.cs プロジェクト: Raynd/XNA_RPG
 public void LoadAI(Game1 game)
 {
     ai = (OpponentAI)game.Services.GetService(typeof(OpponentAI));
 }