- Timestamp:
- 2011-06-22 08:56:14 (12 years ago)
- Location:
- 2011/23/sijoseha/Fera Proelia/Fera Proelia
- Files:
-
- 13 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/Beast.cs
r2079 r2141 7 7 namespace Fera_Proelia 8 8 { 9 public class Beast 9 public class Beast : GameObject 10 10 { 11 public Vector2 Position { get; set; }12 public Vector2 Size { get; set; }13 public Texture2D Image { get; set; }14 15 11 public Beast(Vector2 position, float width, float height) 12 :base(width, height) 16 13 { 17 14 Position = position; -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/Fera Proelia.csproj
r2119 r2141 87 87 <ItemGroup> 88 88 <Compile Include="Beast.cs" /> 89 <Compile Include="GameObject.cs" /> 90 <Compile Include="GameplayScreen.cs" /> 89 91 <Compile Include="GameScreen.cs" /> 90 92 <Compile Include="HUD.cs" /> 93 <Compile Include="InputState.cs" /> 94 <Compile Include="ISelectable.cs" /> 95 <Compile Include="MainMenuScreen.cs" /> 96 <Compile Include="MenuEntry.cs" /> 97 <Compile Include="MenuScreen.cs" /> 91 98 <Compile Include="Properties\AssemblyInfo.cs" /> 92 99 <Compile Include="ScreenManager.cs" /> 100 <Compile Include="Tile.cs" /> 93 101 <None Include="Properties\AppManifest.xml"> 94 102 <XnaPlatformSpecific>true</XnaPlatformSpecific> -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/Fera Proelia.csproj.Debug.cachefile
r2124 r2141 1 1 Content\debugImage.xnb 2 2 Content\hudBg.xnb 3 Content\menuFont.xnb 4 Content\groundTexture.xnb -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/Fera_Proelia.cs
r2079 r2141 19 19 { 20 20 GraphicsDeviceManager graphics; 21 SpriteBatch spriteBatch;22 21 23 private Viewport gameView, hudView; 24 Beast beast; 22 ScreenManager screenManager; 25 23 26 24 public Fera_Proelia() 27 25 { 28 26 graphics = new GraphicsDeviceManager(this); 27 graphics.IsFullScreen = true; 29 28 Content.RootDirectory = "Content"; 30 31 // Frame rate is 30 fps by default for Windows Phone.32 TargetElapsedTime = TimeSpan.FromTicks(333333);33 }34 35 /// <summary>36 /// Allows the game to perform any initialization it needs to before starting to run.37 /// This is where it can query for any required services and load any non-graphic38 /// related content. Calling base.Initialize will enumerate through any components39 /// and initialize them as well.40 /// </summary>41 protected override void Initialize()42 {43 // TODO: Add your initialization logic here44 graphics.IsFullScreen = true;45 29 graphics.SupportedOrientations = DisplayOrientation.Portrait; 46 30 graphics.PreferredBackBufferWidth = 480; 47 31 graphics.PreferredBackBufferHeight = 800; 48 graphics.ApplyChanges(); 49 base.Initialize(); 50 } 32 // Frame rate is 30 fps by default for Windows Phone. 33 TargetElapsedTime = TimeSpan.FromTicks(333333); 51 34 52 /// <summary> 53 /// LoadContent will be called once per game and is the place to load 54 /// all of your content. 55 /// </summary> 56 protected override void LoadContent() 57 { 58 // Create a new SpriteBatch, which can be used to draw textures. 59 spriteBatch = new SpriteBatch(GraphicsDevice); 60 61 gameView = new Viewport(new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height - 200)); 62 hudView = new Viewport(new Rectangle(0, Window.ClientBounds.Height - 200, Window.ClientBounds.Width, 200)); 35 screenManager = new ScreenManager(this); 36 Components.Add(screenManager); 63 37 64 beast = new Beast(new Vector2(0, 0), 32, 32); 65 beast.Image = Content.Load<Texture2D>("debugImage"); 66 // TODO: use this.Content to load your game content here 67 } 68 69 /// <summary> 70 /// UnloadContent will be called once per game and is the place to unload 71 /// all content. 72 /// </summary> 73 protected override void UnloadContent() 74 { 75 // TODO: Unload any non ContentManager content here 76 } 77 78 /// <summary> 79 /// Allows the game to run logic such as updating the world, 80 /// checking for collisions, gathering input, and playing audio. 81 /// </summary> 82 /// <param name="gameTime">Provides a snapshot of timing values.</param> 83 protected override void Update(GameTime gameTime) 84 { 85 // Allows the game to exit 86 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) 87 this.Exit(); 88 89 // TODO: Add your update logic here 90 91 base.Update(gameTime); 38 screenManager.AddScreen(new MainMenuScreen()); 92 39 } 93 40 … … 99 46 { 100 47 GraphicsDevice.Clear(Color.CornflowerBlue); 101 GraphicsDevice.Viewport = gameView;102 spriteBatch.Begin();103 spriteBatch.Draw(beast.Image, beast.Position, Color.White);104 spriteBatch.End();105 GraphicsDevice.Viewport = hudView;106 spriteBatch.Begin();107 spriteBatch.Draw(beast.Image, beast.Position, Color.White);108 spriteBatch.Draw(beast.Image, new Vector2(50,100), Color.White);109 spriteBatch.Draw(beast.Image, new Vector2(70, 100), Color.White);110 spriteBatch.End();111 48 // TODO: Add your drawing code here 112 49 -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/GameScreen.cs
r2124 r2141 3 3 using Microsoft.Xna.Framework; 4 4 using Microsoft.Xna.Framework.Graphics; 5 using Microsoft.Xna.Framework.Input.Touch; 5 6 6 7 namespace Fera_Proelia 7 8 { 9 public enum ScreenState 10 { 11 Active, 12 Hidden, 13 } 8 14 public abstract class GameScreen 9 15 { 10 public bool IsActive { get { return !otherScreenHasFocus; } } 16 public bool IsActive 17 { 18 get { return !otherScreenHasFocus && screenState == ScreenState.Active; } 19 } 11 20 bool otherScreenHasFocus; 21 22 public bool IsExiting 23 { 24 get { return isExiting; } 25 protected internal set { isExiting = value; } 26 } 27 28 bool isExiting = false; 12 29 13 30 public ScreenManager ScreenManager … … 18 35 ScreenManager screenManager; 19 36 37 public ScreenState ScreenState 38 { 39 get { return screenState; } 40 protected set { screenState = value; } 41 } 42 43 ScreenState screenState = ScreenState.Hidden; 44 45 public GestureType EnabledGestures 46 { 47 get { return enabledGestures; } 48 protected set 49 { 50 enabledGestures = value; 51 } 52 } 53 GestureType enabledGestures = GestureType.None; 54 20 55 public GameScreen() 21 56 { … … 25 60 public virtual void UnloadContent() { } 26 61 27 public virtual void Update(GameTime gameTime, bool otherScreenHasFocus )62 public virtual void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) 28 63 { 29 64 this.otherScreenHasFocus = otherScreenHasFocus; 65 if (isExiting) 66 { 67 ScreenManager.RemoveScreen(this); 68 } 69 else if (coveredByOtherScreen) 70 { 71 screenState = ScreenState.Hidden; 72 } 73 else 74 { 75 screenState = ScreenState.Active; 76 } 30 77 } 78 79 public virtual void HandleInput(InputState input) { } 80 31 81 public virtual void Draw(GameTime gameTime) { } 32 82 -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/ScreenManager.cs
r2124 r2141 4 4 using Microsoft.Xna.Framework.Content; 5 5 using Microsoft.Xna.Framework.Graphics; 6 using Microsoft.Xna.Framework.Input; 7 using Microsoft.Xna.Framework.Input.Touch; 6 8 7 9 namespace Fera_Proelia … … 12 14 List<GameScreen> screensToUpdate = new List<GameScreen>(); 13 15 16 InputState input = new InputState(); 17 14 18 SpriteBatch spriteBatch; 19 SpriteFont menuFont; 15 20 16 21 bool isInitialized; 17 22 18 23 public SpriteBatch SpriteBatch { get { return spriteBatch; } } 24 public SpriteFont MenuFont { get { return menuFont; } } 19 25 20 26 public ScreenManager(Game game) 21 27 : base(game) 22 28 { 29 TouchPanel.EnabledGestures = GestureType.None; 23 30 } 24 31 … … 33 40 ContentManager content = Game.Content; 34 41 spriteBatch = new SpriteBatch(GraphicsDevice); 35 42 menuFont = content.Load<SpriteFont>("menuFont"); 36 43 foreach (GameScreen screen in screens) 37 44 { … … 50 57 public override void Update(GameTime gameTime) 51 58 { 59 input.Update(); 52 60 screensToUpdate.Clear(); 53 61 foreach (GameScreen screen in screens) … … 55 63 56 64 bool otherScreenHasFocus = !Game.IsActive; 65 bool coveredByOtherScreen = false; 57 66 58 67 while (screensToUpdate.Count > 0) … … 60 69 GameScreen screen = screensToUpdate[screensToUpdate.Count - 1]; 61 70 screensToUpdate.RemoveAt(screensToUpdate.Count - 1); 62 63 screen.Update(gameTime, otherScreenHasFocus); 71 screen.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); 72 if (screen.ScreenState == ScreenState.Active) 73 { 74 if (!otherScreenHasFocus) 75 { 76 screen.HandleInput(input); 77 otherScreenHasFocus = true; 78 } 79 } 64 80 } 65 81 … … 84 100 } 85 101 screens.Add(screen); 102 TouchPanel.EnabledGestures = screen.EnabledGestures; 86 103 } 87 104 -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/obj/Windows Phone/Debug/Fera Proelia.csproj.FileListAbsolute.txt
r2124 r2141 13 13 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\debugImage.xnb 14 14 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\hudBg.xnb 15 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\menuFont.xnb 16 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\groundTexture.xnb 17 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Fera Proelia.xap 18 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\obj\Windows Phone\Debug\XapCacheFile.xml 19 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\AppManifest.xaml 20 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\obj\Windows Phone\Debug\WMAppManifest.xml.g 21 D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\obj\Windows Phone\Debug\WMAppManifest.xml 22 bin\Windows Phone\Debug\GameThumbnail.png -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/obj/Windows Phone/Debug/XapCacheFile.xml
r2124 r2141 1 <xapCache source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Fera Proelia.xap" wasSigned="False" certificateThumbprint="" TimeStampUrl="" lastWriteTime="17.6.2011 18:09:59"> 2 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\Background.png" archivePath="Background.png" lastWriteTime="16.6.2011 22:26:33" /> 3 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\GameThumbnail.png" archivePath="GameThumbnail.png" lastWriteTime="16.6.2011 22:26:33" /> 4 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\AppManifest.xaml" archivePath="AppManifest.xaml" lastWriteTime="16.6.2011 22:27:26" /> 5 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\obj\Windows Phone\Debug\WMAppManifest.xml" archivePath="WMAppManifest.xml" lastWriteTime="16.6.2011 22:27:26" /> 6 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Fera Proelia.dll" archivePath="Fera Proelia.dll" lastWriteTime="17.6.2011 18:09:59" /> 7 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\debugImage.xnb" archivePath="Content\debugImage.xnb" lastWriteTime="17.6.2011 18:07:05" /> 8 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\hudBg.xnb" archivePath="Content\hudBg.xnb" lastWriteTime="17.6.2011 18:07:05" /> 1 <xapCache source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Fera Proelia.xap" wasSigned="False" certificateThumbprint="" TimeStampUrl="" lastWriteTime="21.6.2011 21:59:52"> 2 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\Background.png" archivePath="Background.png" lastWriteTime="17.6.2011 8:19:55" /> 3 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\GameThumbnail.png" archivePath="GameThumbnail.png" lastWriteTime="17.6.2011 8:19:55" /> 4 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\AppManifest.xaml" archivePath="AppManifest.xaml" lastWriteTime="17.6.2011 9:42:42" /> 5 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\obj\Windows Phone\Debug\WMAppManifest.xml" archivePath="WMAppManifest.xml" lastWriteTime="17.6.2011 8:19:55" /> 6 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Fera Proelia.dll" archivePath="Fera Proelia.dll" lastWriteTime="21.6.2011 21:59:51" /> 7 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\debugImage.xnb" archivePath="Content\debugImage.xnb" lastWriteTime="20.6.2011 10:40:59" /> 8 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\hudBg.xnb" archivePath="Content\hudBg.xnb" lastWriteTime="20.6.2011 10:40:59" /> 9 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\menuFont.xnb" archivePath="Content\menuFont.xnb" lastWriteTime="21.6.2011 10:08:42" /> 10 <file source="D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\groundTexture.xnb" archivePath="Content\groundTexture.xnb" lastWriteTime="21.6.2011 14:29:18" /> 9 11 </xapCache> -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera Proelia/obj/Windows Phone/Debug/cachefile-{D61D4EFB-D076-4A82-A048-9E0EC82420B4}-targetpath.txt
r2124 r2141 1 1 Content\debugImage.xnb 2 2 Content\hudBg.xnb 3 Content\menuFont.xnb 4 Content\groundTexture.xnb -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera ProeliaContent/Fera ProeliaContent.contentproj
r2119 r2141 56 56 </Compile> 57 57 </ItemGroup> 58 <ItemGroup> 59 <Compile Include="menuFont.spritefont"> 60 <Name>menuFont</Name> 61 <Importer>FontDescriptionImporter</Importer> 62 <Processor>FontDescriptionProcessor</Processor> 63 </Compile> 64 </ItemGroup> 65 <ItemGroup> 66 <Compile Include="groundTexture.png"> 67 <Name>groundTexture</Name> 68 <Importer>TextureImporter</Importer> 69 <Processor>TextureProcessor</Processor> 70 </Compile> 71 </ItemGroup> 58 72 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 59 73 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2011/23/sijoseha/Fera Proelia/Fera Proelia/Fera ProeliaContent/obj/Windows Phone/Debug/ContentPipeline.xml
r2124 r2141 9 9 <Options>None</Options> 10 10 <Output>D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\debugImage.xnb</Output> 11 <Time>2011-06-1 6T22:37:48.8337831+03:00</Time>11 <Time>2011-06-17T08:19:54.7030248+03:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\hudBg.xnb</Output> 20 <Time>2011-06-17T17:44:41.4557698+03:00</Time> 20 <Time>2011-06-17T09:46:37.7807565+03:00</Time> 21 </Item> 22 <Item> 23 <Source>menuFont.spritefont</Source> 24 <Name>menuFont</Name> 25 <Importer>FontDescriptionImporter</Importer> 26 <Processor>FontDescriptionProcessor</Processor> 27 <Options>None</Options> 28 <Output>D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\menuFont.xnb</Output> 29 <Time>2011-06-21T09:13:23.9580847+03:00</Time> 30 </Item> 31 <Item> 32 <Source>groundTexture.png</Source> 33 <Name>groundTexture</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>D:\Temp\sijoseha\Fera Proelia\Fera Proelia\Fera Proelia\bin\Windows Phone\Debug\Content\groundTexture.xnb</Output> 38 <Time>2011-06-21T14:29:01.9912063+03:00</Time> 21 39 </Item> 22 40 <BuildSuccessful>true</BuildSuccessful> … … 34 52 <Assembly> 35 53 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 36 <Value>2010-08-23T1 2:41:18+03:00</Value>54 <Value>2010-08-23T13:41:18+03:00</Value> 37 55 </Assembly> 38 56 <Assembly> 39 57 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 40 <Value>2010-08-23T1 2:41:18+03:00</Value>58 <Value>2010-08-23T13:41:18+03:00</Value> 41 59 </Assembly> 42 60 <Assembly> 43 61 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 44 <Value>2010-08-23T1 2:41:18+03:00</Value>62 <Value>2010-08-23T13:41:18+03:00</Value> 45 63 </Assembly> 46 64 <Assembly> 47 65 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 48 <Value>2010-08-23T1 2:41:18+03:00</Value>66 <Value>2010-08-23T13:41:18+03:00</Value> 49 67 </Assembly> 50 68 <Assembly> 51 69 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 52 <Value>2010-08-23T1 2:41:18+03:00</Value>70 <Value>2010-08-23T13:41:18+03:00</Value> 53 71 </Assembly> 54 72 <Assembly> 55 73 <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 56 <Value>2010-08-23T1 2:41:18+03:00</Value>74 <Value>2010-08-23T13:41:18+03:00</Value> 57 75 </Assembly> 58 76 <Assembly> 59 77 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 60 <Value>201 0-10-04T19:11:18.5288743+03:00</Value>78 <Value>2011-01-07T11:35:54.8184098+02:00</Value> 61 79 </Assembly> 62 80 </Assemblies>
Note: See TracChangeset
for help on using the changeset viewer.