From 63a61ee2be3a902c27cd000d41b1a3a0280be21a Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Tue, 22 Oct 2013 23:11:13 -0500 Subject: First commit. Starting with MonoGame. --- README.md | 0 Super Polarity.sln | 20 +++++ Super Polarity.suo | Bin 0 -> 15872 bytes Super Polarity/Content/Graphics/player.xnb | Bin 0 -> 32203 bytes Super Polarity/Icon.ico | Bin 0 -> 32038 bytes Super Polarity/MainShip.cs | 49 ++++++++++ Super Polarity/Program.cs | 26 ++++++ Super Polarity/Properties/AssemblyInfo.cs | 36 ++++++++ Super Polarity/Super Polarity.csproj | 80 +++++++++++++++++ Super Polarity/Super Polarity.csproj.user | 3 + Super Polarity/Super Polarity.csproj~ | 76 ++++++++++++++++ Super Polarity/SuperPolarity.cs | 100 +++++++++++++++++++++ .../WindowsGL/Debug/Content/Graphics/player.xnb | Bin 0 -> 32203 bytes .../bin/WindowsGL/Debug/GameName1.vshost.exe | Bin 0 -> 11600 bytes .../WindowsGL/Debug/GameName1.vshost.exe.manifest | 11 +++ .../bin/WindowsGL/Debug/Lidgren.Network.dll | Bin 0 -> 118272 bytes .../bin/WindowsGL/Debug/MonoGame.Framework.dll | Bin 0 -> 637440 bytes Super Polarity/bin/WindowsGL/Debug/OpenTK.dll | Bin 0 -> 3290624 bytes Super Polarity/bin/WindowsGL/Debug/SDL.dll | Bin 0 -> 324096 bytes .../bin/WindowsGL/Debug/Super Polarity.exe | Bin 0 -> 39424 bytes .../bin/WindowsGL/Debug/Super Polarity.pdb | Bin 0 -> 19968 bytes .../bin/WindowsGL/Debug/Super Polarity.vshost.exe | Bin 0 -> 11600 bytes Super Polarity/bin/WindowsGL/Debug/Tao.Sdl.dll | Bin 0 -> 69632 bytes .../DesignTimeResolveAssemblyReferencesInput.cache | Bin 0 -> 5927 bytes .../obj/x86/Debug/ResolveAssemblyReference.cache | Bin 0 -> 17159 bytes .../Super Polarity.csproj.FileListAbsolute.txt | 11 +++ Super Polarity/obj/x86/Debug/Super Polarity.exe | Bin 0 -> 39424 bytes Super Polarity/obj/x86/Debug/Super Polarity.pdb | Bin 0 -> 19968 bytes 28 files changed, 412 insertions(+) create mode 100644 README.md create mode 100644 Super Polarity.sln create mode 100644 Super Polarity.suo create mode 100644 Super Polarity/Content/Graphics/player.xnb create mode 100644 Super Polarity/Icon.ico create mode 100644 Super Polarity/MainShip.cs create mode 100644 Super Polarity/Program.cs create mode 100644 Super Polarity/Properties/AssemblyInfo.cs create mode 100644 Super Polarity/Super Polarity.csproj create mode 100644 Super Polarity/Super Polarity.csproj.user create mode 100644 Super Polarity/Super Polarity.csproj~ create mode 100644 Super Polarity/SuperPolarity.cs create mode 100644 Super Polarity/bin/WindowsGL/Debug/Content/Graphics/player.xnb create mode 100644 Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe create mode 100644 Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe.manifest create mode 100644 Super Polarity/bin/WindowsGL/Debug/Lidgren.Network.dll create mode 100644 Super Polarity/bin/WindowsGL/Debug/MonoGame.Framework.dll create mode 100644 Super Polarity/bin/WindowsGL/Debug/OpenTK.dll create mode 100644 Super Polarity/bin/WindowsGL/Debug/SDL.dll create mode 100644 Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe create mode 100644 Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb create mode 100644 Super Polarity/bin/WindowsGL/Debug/Super Polarity.vshost.exe create mode 100644 Super Polarity/bin/WindowsGL/Debug/Tao.Sdl.dll create mode 100644 Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache create mode 100644 Super Polarity/obj/x86/Debug/ResolveAssemblyReference.cache create mode 100644 Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt create mode 100644 Super Polarity/obj/x86/Debug/Super Polarity.exe create mode 100644 Super Polarity/obj/x86/Debug/Super Polarity.pdb diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/Super Polarity.sln b/Super Polarity.sln new file mode 100644 index 0000000..20fcaa8 --- /dev/null +++ b/Super Polarity.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Super Polarity", "Super Polarity\Super Polarity.csproj", "{2585188B-339D-44CD-9599-1A80AA30DE13}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|x86.ActiveCfg = Debug|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|x86.Build.0 = Debug|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Super Polarity.suo b/Super Polarity.suo new file mode 100644 index 0000000..5f14b6d Binary files /dev/null and b/Super Polarity.suo differ diff --git a/Super Polarity/Content/Graphics/player.xnb b/Super Polarity/Content/Graphics/player.xnb new file mode 100644 index 0000000..55c6d4c Binary files /dev/null and b/Super Polarity/Content/Graphics/player.xnb differ diff --git a/Super Polarity/Icon.ico b/Super Polarity/Icon.ico new file mode 100644 index 0000000..13be62a Binary files /dev/null and b/Super Polarity/Icon.ico differ diff --git a/Super Polarity/MainShip.cs b/Super Polarity/MainShip.cs new file mode 100644 index 0000000..51d1eb3 --- /dev/null +++ b/Super Polarity/MainShip.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + class MainShip + { + public Texture2D PlayerTexture; + public Vector2 Position; + public bool Active; + public int Lives; + public int Multiplier; + public int Score; + public float Angle; + + public int Width + { + get { return PlayerTexture.Width; } + } + + public int Height + { + get { return PlayerTexture.Height; } + } + + public void Initialize(Texture2D texture, Vector2 position) + { + PlayerTexture = texture; + Position = position; + Active = true; + Multiplier = 1; + Lives = 3; + Score = 0; + } + + public void Update() + { + } + + public void Draw(SpriteBatch spriteBatch) + { + spriteBatch.Draw(PlayerTexture, Position, null, Color.White, Angle, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } +} diff --git a/Super Polarity/Program.cs b/Super Polarity/Program.cs new file mode 100644 index 0000000..6c3f614 --- /dev/null +++ b/Super Polarity/Program.cs @@ -0,0 +1,26 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +#endregion + +namespace SuperPolarity +{ +#if WINDOWS || LINUX + /// + /// The main class. + /// + public static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + using (var superPolarity = new SuperPolarity()) + superPolarity.Run(); + } + } +#endif +} diff --git a/Super Polarity/Properties/AssemblyInfo.cs b/Super Polarity/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..91a7e87 --- /dev/null +++ b/Super Polarity/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Super Polarity")] +[assembly: AssemblyProduct("Super Polarity")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7f0aa81c-c9ab-4b87-97eb-3b788199ed3e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Super Polarity/Super Polarity.csproj b/Super Polarity/Super Polarity.csproj new file mode 100644 index 0000000..dd5e1cd --- /dev/null +++ b/Super Polarity/Super Polarity.csproj @@ -0,0 +1,80 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {2585188B-339D-44CD-9599-1A80AA30DE13} + WinExe + Properties + SuperPolarity + Super Polarity + 512 + + + x86 + true + full + false + bin\WindowsGL\Debug\ + DEBUG;TRACE;WINDOWS + prompt + 4 + + + x86 + pdbonly + true + bin\WindowsGL\Release\ + TRACE;WINDOWS + prompt + 4 + + + Icon.ico + + + + + + + + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\OpenTK.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\MonoGame.Framework.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\Lidgren.Network.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\Tao.Sdl.dll + + + + + + + SDL.dll + Always + + + + + + + Always + + + + + \ No newline at end of file diff --git a/Super Polarity/Super Polarity.csproj.user b/Super Polarity/Super Polarity.csproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/Super Polarity/Super Polarity.csproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Super Polarity/Super Polarity.csproj~ b/Super Polarity/Super Polarity.csproj~ new file mode 100644 index 0000000..520cdc4 --- /dev/null +++ b/Super Polarity/Super Polarity.csproj~ @@ -0,0 +1,76 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {2585188B-339D-44CD-9599-1A80AA30DE13} + WinExe + Properties + GameName1 + Super Polarity + 512 + + + x86 + true + full + false + bin\WindowsGL\Debug\ + DEBUG;TRACE;WINDOWS + prompt + 4 + + + x86 + pdbonly + true + bin\WindowsGL\Release\ + TRACE;WINDOWS + prompt + 4 + + + Icon.ico + + + + + + + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\OpenTK.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\MonoGame.Framework.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\Lidgren.Network.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\Tao.Sdl.dll + + + + + + + SDL.dll + Always + + + + + + + + + diff --git a/Super Polarity/SuperPolarity.cs b/Super Polarity/SuperPolarity.cs new file mode 100644 index 0000000..40f1477 --- /dev/null +++ b/Super Polarity/SuperPolarity.cs @@ -0,0 +1,100 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Storage; +using Microsoft.Xna.Framework.GamerServices; +using SuperPolarity; +#endregion + +namespace SuperPolarity +{ + /// + /// This is the main type for your game + /// + public class SuperPolarity : Game + { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + + MainShip player; + + public SuperPolarity() + : base() + { + graphics = new GraphicsDeviceManager(this); + Content.RootDirectory = "Content"; + } + + /// + /// Allows the game to perform any initialization it needs to before starting to run. + /// This is where it can query for any required services and load any non-graphic + /// related content. Calling base.Initialize will enumerate through any components + /// and initialize them as well. + /// + protected override void Initialize() + { + player = new MainShip(); + + base.Initialize(); + } + + /// + /// LoadContent will be called once per game and is the place to load + /// all of your content. + /// + protected override void LoadContent() + { + // Create a new SpriteBatch, which can be used to draw textures. + spriteBatch = new SpriteBatch(GraphicsDevice); + + Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2); + + player.Initialize(Content.Load("Graphics\\player"), playerPosition); + } + + /// + /// UnloadContent will be called once per game and is the place to unload + /// all content. + /// + protected override void UnloadContent() + { + // TODO: Unload any non ContentManager content here + } + + /// + /// Allows the game to run logic such as updating the world, + /// checking for collisions, gathering input, and playing audio. + /// + /// Provides a snapshot of timing values. + protected override void Update(GameTime gameTime) + { + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) + Exit(); + + // TODO: Add your update logic here + + base.Update(gameTime); + } + + /// + /// This is called when the game should draw itself. + /// + /// Provides a snapshot of timing values. + protected override void Draw(GameTime gameTime) + { + GraphicsDevice.Clear(Color.CornflowerBlue); + + spriteBatch.Begin(); + + player.Draw(spriteBatch); + + spriteBatch.End(); + + base.Draw(gameTime); + } + } +} diff --git a/Super Polarity/bin/WindowsGL/Debug/Content/Graphics/player.xnb b/Super Polarity/bin/WindowsGL/Debug/Content/Graphics/player.xnb new file mode 100644 index 0000000..55c6d4c Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/Content/Graphics/player.xnb differ diff --git a/Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe b/Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe differ diff --git a/Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe.manifest b/Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/Super Polarity/bin/WindowsGL/Debug/GameName1.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Super Polarity/bin/WindowsGL/Debug/Lidgren.Network.dll b/Super Polarity/bin/WindowsGL/Debug/Lidgren.Network.dll new file mode 100644 index 0000000..fd45367 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/Lidgren.Network.dll differ diff --git a/Super Polarity/bin/WindowsGL/Debug/MonoGame.Framework.dll b/Super Polarity/bin/WindowsGL/Debug/MonoGame.Framework.dll new file mode 100644 index 0000000..c087ac2 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/MonoGame.Framework.dll differ diff --git a/Super Polarity/bin/WindowsGL/Debug/OpenTK.dll b/Super Polarity/bin/WindowsGL/Debug/OpenTK.dll new file mode 100644 index 0000000..b1cd2e9 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/OpenTK.dll differ diff --git a/Super Polarity/bin/WindowsGL/Debug/SDL.dll b/Super Polarity/bin/WindowsGL/Debug/SDL.dll new file mode 100644 index 0000000..628cdfc Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/SDL.dll differ diff --git a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe new file mode 100644 index 0000000..a73e117 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe differ diff --git a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb new file mode 100644 index 0000000..adf5387 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb differ diff --git a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.vshost.exe b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.vshost.exe differ diff --git a/Super Polarity/bin/WindowsGL/Debug/Tao.Sdl.dll b/Super Polarity/bin/WindowsGL/Debug/Tao.Sdl.dll new file mode 100644 index 0000000..d2e2d47 Binary files /dev/null and b/Super Polarity/bin/WindowsGL/Debug/Tao.Sdl.dll differ diff --git a/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..3cba31e Binary files /dev/null and b/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Super Polarity/obj/x86/Debug/ResolveAssemblyReference.cache b/Super Polarity/obj/x86/Debug/ResolveAssemblyReference.cache new file mode 100644 index 0000000..d619ccb Binary files /dev/null and b/Super Polarity/obj/x86/Debug/ResolveAssemblyReference.cache differ diff --git a/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt b/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..b8ea3e8 --- /dev/null +++ b/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt @@ -0,0 +1,11 @@ +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\SDL.dll +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Lidgren.Network.dll +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\MonoGame.Framework.dll +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\OpenTK.dll +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Tao.Sdl.dll +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\obj\x86\Debug\Super Polarity.exe +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\obj\x86\Debug\Super Polarity.pdb +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Super Polarity.exe +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Super Polarity.pdb +C:\Users\Miau\Documents\Visual Studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Content\Graphics\player.xnb diff --git a/Super Polarity/obj/x86/Debug/Super Polarity.exe b/Super Polarity/obj/x86/Debug/Super Polarity.exe new file mode 100644 index 0000000..a73e117 Binary files /dev/null and b/Super Polarity/obj/x86/Debug/Super Polarity.exe differ diff --git a/Super Polarity/obj/x86/Debug/Super Polarity.pdb b/Super Polarity/obj/x86/Debug/Super Polarity.pdb new file mode 100644 index 0000000..adf5387 Binary files /dev/null and b/Super Polarity/obj/x86/Debug/Super Polarity.pdb differ -- cgit From 9899ae5d21c559b98386be48c5a80e63db10552d Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Tue, 22 Oct 2013 23:19:19 -0500 Subject: Adds Visual Studio gitignore --- .gitignore | 151 ++++++++++++++++++++++++++++++++++ Super Polarity/Super Polarity.csproj~ | 76 ----------------- 2 files changed, 151 insertions(+), 76 deletions(-) create mode 100644 .gitignore delete mode 100644 Super Polarity/Super Polarity.csproj~ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0881b8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,151 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +!packages/*/build/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store diff --git a/Super Polarity/Super Polarity.csproj~ b/Super Polarity/Super Polarity.csproj~ deleted file mode 100644 index 520cdc4..0000000 --- a/Super Polarity/Super Polarity.csproj~ +++ /dev/null @@ -1,76 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {2585188B-339D-44CD-9599-1A80AA30DE13} - WinExe - Properties - GameName1 - Super Polarity - 512 - - - x86 - true - full - false - bin\WindowsGL\Debug\ - DEBUG;TRACE;WINDOWS - prompt - 4 - - - x86 - pdbonly - true - bin\WindowsGL\Release\ - TRACE;WINDOWS - prompt - 4 - - - Icon.ico - - - - - - - - - ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\OpenTK.dll - - - ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\MonoGame.Framework.dll - - - ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\Lidgren.Network.dll - - - ..\..\..\..\..\..\..\Program Files (x86)\MSBuild\..\MonoGame\v3.0\Assemblies\WindowsGL\Tao.Sdl.dll - - - - - - - SDL.dll - Always - - - - - - - - - -- cgit From 95d7601b7742ed560a9d8e00269217f62fc7ce32 Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Sun, 10 Nov 2013 22:11:08 -0600 Subject: Chubas's House happened. --- .../Super Polarity Content.csproj | 65 ++++++++++ .../Graphics/circle.png | Bin 0 -> 355 bytes .../Graphics/diamond.png | Bin 0 -> 388 bytes .../Graphics/main-ship.png | Bin 0 -> 1838 bytes .../Graphics/negative-cruiser.png | Bin 0 -> 3283 bytes .../Graphics/negative-destroyer.png | Bin 0 -> 1720 bytes .../Graphics/negative-scout.png | Bin 0 -> 1487 bytes .../Graphics/negative-supercruiser.png | Bin 0 -> 3097 bytes .../Graphics/neutral-cruiser.png | Bin 0 -> 2924 bytes .../Graphics/neutral-destroyer.png | Bin 0 -> 1559 bytes .../Graphics/neutral-scout.png | Bin 0 -> 1305 bytes .../Graphics/neutral-ship.png | Bin 0 -> 1579 bytes .../Graphics/neutral-supercruiser.png | Bin 0 -> 2969 bytes .../Graphics/positive-cruiser.png | Bin 0 -> 3290 bytes .../Graphics/positive-destroyer.png | Bin 0 -> 1738 bytes .../Graphics/positive-scout.png | Bin 0 -> 1486 bytes .../Graphics/positive-ship.png | Bin 0 -> 1812 bytes .../Graphics/positive-supercruiser.png | Bin 0 -> 3093 bytes .../Graphics/star.png | Bin 0 -> 380 bytes .../Super Polarity ContentContent.contentproj | 141 ++++++++++++++++++++ Super Polarity.sln | 142 ++++++++++++++++++++ Super Polarity.suo | Bin 15872 -> 31744 bytes Super Polarity/Content/Graphics/circle.xnb | Bin 0 -> 1211 bytes Super Polarity/Content/Graphics/diamond.xnb | Bin 0 -> 1211 bytes Super Polarity/Content/Graphics/main-ship.xnb | Bin 0 -> 11707 bytes .../Content/Graphics/negative-cruiser.xnb | Bin 0 -> 72187 bytes .../Content/Graphics/negative-destroyer.xnb | Bin 0 -> 11707 bytes Super Polarity/Content/Graphics/negative-scout.xnb | Bin 0 -> 5707 bytes .../Content/Graphics/negative-supercruiser.xnb | Bin 0 -> 72187 bytes .../Content/Graphics/neutral-cruiser.xnb | Bin 0 -> 72187 bytes .../Content/Graphics/neutral-destroyer.xnb | Bin 0 -> 11707 bytes Super Polarity/Content/Graphics/neutral-scout.xnb | Bin 0 -> 5707 bytes Super Polarity/Content/Graphics/neutral-ship.xnb | Bin 0 -> 11707 bytes .../Content/Graphics/neutral-supercruiser.xnb | Bin 0 -> 72187 bytes .../Content/Graphics/positive-cruiser.xnb | Bin 0 -> 72187 bytes .../Content/Graphics/positive-destroyer.xnb | Bin 0 -> 11707 bytes Super Polarity/Content/Graphics/positive-scout.xnb | Bin 0 -> 5707 bytes Super Polarity/Content/Graphics/positive-ship.xnb | Bin 0 -> 11707 bytes .../Content/Graphics/positive-supercruiser.xnb | Bin 0 -> 72187 bytes Super Polarity/Content/Graphics/star.xnb | Bin 0 -> 1147 bytes Super Polarity/InputController.cs | 118 +++++++++++++++++ Super Polarity/MainShip.cs | 143 ++++++++++++++++++++- Super Polarity/Particle.cs | 51 ++++++++ Super Polarity/ParticleEngine.cs | 75 +++++++++++ Super Polarity/Super Polarity.csproj | 62 ++++++++- Super Polarity/SuperPolarity.cs | 16 ++- .../bin/WindowsGL/Debug/Super Polarity.exe | Bin 39424 -> 46080 bytes .../bin/WindowsGL/Debug/Super Polarity.pdb | Bin 19968 -> 36352 bytes .../DesignTimeResolveAssemblyReferencesInput.cache | Bin 5927 -> 8028 bytes .../Super Polarity.csproj.FileListAbsolute.txt | 23 +++- Super Polarity/obj/x86/Debug/Super Polarity.exe | Bin 39424 -> 46080 bytes Super Polarity/obj/x86/Debug/Super Polarity.pdb | Bin 19968 -> 36352 bytes 52 files changed, 823 insertions(+), 13 deletions(-) create mode 100644 Super Polarity Content/Super Polarity Content/Super Polarity Content.csproj create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/circle.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/diamond.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/main-ship.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/negative-cruiser.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/negative-destroyer.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/negative-scout.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/negative-supercruiser.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-cruiser.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-destroyer.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-scout.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-ship.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-supercruiser.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/positive-cruiser.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/positive-destroyer.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/positive-scout.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/positive-ship.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/positive-supercruiser.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Graphics/star.png create mode 100644 Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj create mode 100644 Super Polarity/Content/Graphics/circle.xnb create mode 100644 Super Polarity/Content/Graphics/diamond.xnb create mode 100644 Super Polarity/Content/Graphics/main-ship.xnb create mode 100644 Super Polarity/Content/Graphics/negative-cruiser.xnb create mode 100644 Super Polarity/Content/Graphics/negative-destroyer.xnb create mode 100644 Super Polarity/Content/Graphics/negative-scout.xnb create mode 100644 Super Polarity/Content/Graphics/negative-supercruiser.xnb create mode 100644 Super Polarity/Content/Graphics/neutral-cruiser.xnb create mode 100644 Super Polarity/Content/Graphics/neutral-destroyer.xnb create mode 100644 Super Polarity/Content/Graphics/neutral-scout.xnb create mode 100644 Super Polarity/Content/Graphics/neutral-ship.xnb create mode 100644 Super Polarity/Content/Graphics/neutral-supercruiser.xnb create mode 100644 Super Polarity/Content/Graphics/positive-cruiser.xnb create mode 100644 Super Polarity/Content/Graphics/positive-destroyer.xnb create mode 100644 Super Polarity/Content/Graphics/positive-scout.xnb create mode 100644 Super Polarity/Content/Graphics/positive-ship.xnb create mode 100644 Super Polarity/Content/Graphics/positive-supercruiser.xnb create mode 100644 Super Polarity/Content/Graphics/star.xnb create mode 100644 Super Polarity/InputController.cs create mode 100644 Super Polarity/Particle.cs create mode 100644 Super Polarity/ParticleEngine.cs diff --git a/Super Polarity Content/Super Polarity Content/Super Polarity Content.csproj b/Super Polarity Content/Super Polarity Content/Super Polarity Content.csproj new file mode 100644 index 0000000..4cc2f56 --- /dev/null +++ b/Super Polarity Content/Super Polarity Content/Super Polarity Content.csproj @@ -0,0 +1,65 @@ + + + + + {8528C189-5B94-48F8-8C64-D4D6658E52F6} + {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Windows + x86 + Library + Properties + ContentBuilder + IgnoreMe + v4.0 + Client + v4.0 + bin\$(Configuration) + Windows + HiDef + 70f11b5f-d758-4efc-943f-95989437d224 + Library + x86 + false + + + Windows + + + Windows8 + + + Android + + + iOS + + + OSX + + + Linux + + + PSM + + + + + + + {468F8415-7D38-4718-B0B4-E18F1A427136} + Super Polarity ContentContent %28Content%29 + Content + + + + + + \ No newline at end of file diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/circle.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/circle.png new file mode 100644 index 0000000..ede9996 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/circle.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/diamond.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/diamond.png new file mode 100644 index 0000000..f06a523 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/diamond.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/main-ship.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/main-ship.png new file mode 100644 index 0000000..168ce43 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/main-ship.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-cruiser.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-cruiser.png new file mode 100644 index 0000000..0461e90 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-cruiser.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-destroyer.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-destroyer.png new file mode 100644 index 0000000..25244f2 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-destroyer.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-scout.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-scout.png new file mode 100644 index 0000000..fdc372b Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-scout.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-supercruiser.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-supercruiser.png new file mode 100644 index 0000000..344ef93 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/negative-supercruiser.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-cruiser.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-cruiser.png new file mode 100644 index 0000000..3f5be69 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-cruiser.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-destroyer.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-destroyer.png new file mode 100644 index 0000000..458ec8e Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-destroyer.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-scout.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-scout.png new file mode 100644 index 0000000..e7a1364 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-scout.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-ship.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-ship.png new file mode 100644 index 0000000..6b0a767 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-ship.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-supercruiser.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-supercruiser.png new file mode 100644 index 0000000..183b71c Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/neutral-supercruiser.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-cruiser.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-cruiser.png new file mode 100644 index 0000000..62da8bc Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-cruiser.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-destroyer.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-destroyer.png new file mode 100644 index 0000000..735d473 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-destroyer.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-scout.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-scout.png new file mode 100644 index 0000000..1970625 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-scout.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-ship.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-ship.png new file mode 100644 index 0000000..9d07a8c Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-ship.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-supercruiser.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-supercruiser.png new file mode 100644 index 0000000..6b2a77b Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/positive-supercruiser.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Graphics/star.png b/Super Polarity Content/Super Polarity ContentContent/Graphics/star.png new file mode 100644 index 0000000..4f207f4 Binary files /dev/null and b/Super Polarity Content/Super Polarity ContentContent/Graphics/star.png differ diff --git a/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj b/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj new file mode 100644 index 0000000..4e7a9f0 --- /dev/null +++ b/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj @@ -0,0 +1,141 @@ + + + + {468F8415-7D38-4718-B0B4-E18F1A427136} + {96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Windows + x86 + Library + Properties + Super_Polarity_ContentContentContent + v4.0 + v4.0 + Windows + bin\$(MonoGamePlatform)\$(Configuration) + Content + x86 + + + Windows + + + Windows8 + + + Android + + + iOS + + + OSX + + + Linux + + + PSM + + + + + + + + + + $(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGameContentProcessors.dll + + + + + main-ship + TextureProcessor + + + negative-cruiser + TextureProcessor + + + negative-destroyer + TextureProcessor + + + negative-scout + TextureProcessor + + + negative-supercruiser + TextureProcessor + + + neutral-cruiser + TextureProcessor + + + neutral-destroyer + TextureProcessor + + + neutral-scout + TextureProcessor + + + neutral-ship + TextureProcessor + + + neutral-supercruiser + TextureProcessor + + + positive-cruiser + TextureProcessor + + + positive-destroyer + TextureProcessor + + + positive-scout + TextureProcessor + + + positive-ship + TextureProcessor + + + positive-supercruiser + TextureProcessor + + + + + + + + circle + TextureImporter + TextureProcessor + + + diamond + TextureImporter + TextureProcessor + + + star + TextureImporter + TextureProcessor + + + + + \ No newline at end of file diff --git a/Super Polarity.sln b/Super Polarity.sln index 20fcaa8..6742318 100644 --- a/Super Polarity.sln +++ b/Super Polarity.sln @@ -3,16 +3,158 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C# Express 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Super Polarity", "Super Polarity\Super Polarity.csproj", "{2585188B-339D-44CD-9599-1A80AA30DE13}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Super Polarity Content", "Super Polarity Content\Super Polarity Content\Super Polarity Content.csproj", "{8528C189-5B94-48F8-8C64-D4D6658E52F6}" +EndProject +Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "Super Polarity ContentContent", "Super Polarity Content\Super Polarity ContentContent\Super Polarity ContentContent.contentproj", "{468F8415-7D38-4718-B0B4-E18F1A427136}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Android|Any CPU = Android|Any CPU + Android|Mixed Platforms = Android|Mixed Platforms + Android|x86 = Android|x86 + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 + iOS|Any CPU = iOS|Any CPU + iOS|Mixed Platforms = iOS|Mixed Platforms + iOS|x86 = iOS|x86 + Linux|Any CPU = Linux|Any CPU + Linux|Mixed Platforms = Linux|Mixed Platforms + Linux|x86 = Linux|x86 + OSX|Any CPU = OSX|Any CPU + OSX|Mixed Platforms = OSX|Mixed Platforms + OSX|x86 = OSX|x86 + PSM|Any CPU = PSM|Any CPU + PSM|Mixed Platforms = PSM|Mixed Platforms + PSM|x86 = PSM|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 + Windows|Any CPU = Windows|Any CPU + Windows|Mixed Platforms = Windows|Mixed Platforms + Windows|x86 = Windows|x86 + Windows8|Any CPU = Windows8|Any CPU + Windows8|Mixed Platforms = Windows8|Mixed Platforms + Windows8|x86 = Windows8|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2585188B-339D-44CD-9599-1A80AA30DE13}.Android|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Android|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Android|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Android|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Android|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|Any CPU.ActiveCfg = Debug|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|Mixed Platforms.Build.0 = Debug|x86 {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|x86.ActiveCfg = Debug|x86 {2585188B-339D-44CD-9599-1A80AA30DE13}.Debug|x86.Build.0 = Debug|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.iOS|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.iOS|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.iOS|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.iOS|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.iOS|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Linux|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Linux|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Linux|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Linux|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Linux|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.OSX|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.OSX|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.OSX|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.OSX|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.OSX|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.PSM|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.PSM|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.PSM|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.PSM|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.PSM|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|Mixed Platforms.Build.0 = Release|x86 {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|x86.ActiveCfg = Release|x86 {2585188B-339D-44CD-9599-1A80AA30DE13}.Release|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows|x86.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows8|Any CPU.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows8|Mixed Platforms.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows8|Mixed Platforms.Build.0 = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows8|x86.ActiveCfg = Release|x86 + {2585188B-339D-44CD-9599-1A80AA30DE13}.Windows8|x86.Build.0 = Release|x86 + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Android|Any CPU.ActiveCfg = Android|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Android|Any CPU.Build.0 = Android|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Android|Mixed Platforms.ActiveCfg = Android|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Android|Mixed Platforms.Build.0 = Android|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Android|x86.ActiveCfg = Android|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Debug|Any CPU.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Debug|Any CPU.Build.0 = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Debug|Mixed Platforms.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Debug|Mixed Platforms.Build.0 = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Debug|x86.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.iOS|Any CPU.ActiveCfg = iOS|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.iOS|Any CPU.Build.0 = iOS|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.iOS|Mixed Platforms.ActiveCfg = iOS|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.iOS|Mixed Platforms.Build.0 = iOS|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.iOS|x86.ActiveCfg = iOS|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Linux|Any CPU.ActiveCfg = Linux|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Linux|Any CPU.Build.0 = Linux|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Linux|Mixed Platforms.ActiveCfg = Linux|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Linux|Mixed Platforms.Build.0 = Linux|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Linux|x86.ActiveCfg = Linux|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.OSX|Any CPU.ActiveCfg = OSX|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.OSX|Any CPU.Build.0 = OSX|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.OSX|Mixed Platforms.ActiveCfg = OSX|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.OSX|Mixed Platforms.Build.0 = OSX|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.OSX|x86.ActiveCfg = OSX|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.PSM|Any CPU.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.PSM|Any CPU.Build.0 = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.PSM|Mixed Platforms.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.PSM|Mixed Platforms.Build.0 = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.PSM|x86.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Release|Any CPU.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Release|Any CPU.Build.0 = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Release|Mixed Platforms.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Release|Mixed Platforms.Build.0 = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Release|x86.ActiveCfg = PSM|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows|Any CPU.ActiveCfg = Windows|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows|Any CPU.Build.0 = Windows|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows|Mixed Platforms.ActiveCfg = Windows|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows|Mixed Platforms.Build.0 = Windows|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows|x86.ActiveCfg = Windows|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows8|Any CPU.ActiveCfg = Windows8|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows8|Any CPU.Build.0 = Windows8|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows8|Mixed Platforms.ActiveCfg = Windows8|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows8|Mixed Platforms.Build.0 = Windows8|Any CPU + {8528C189-5B94-48F8-8C64-D4D6658E52F6}.Windows8|x86.ActiveCfg = Windows8|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Android|Any CPU.ActiveCfg = Android|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Android|Mixed Platforms.ActiveCfg = Android|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Android|x86.ActiveCfg = Android|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Debug|Any CPU.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Debug|Mixed Platforms.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Debug|x86.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.iOS|Any CPU.ActiveCfg = iOS|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.iOS|Mixed Platforms.ActiveCfg = iOS|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.iOS|x86.ActiveCfg = iOS|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Linux|Any CPU.ActiveCfg = Linux|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Linux|Mixed Platforms.ActiveCfg = Linux|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Linux|x86.ActiveCfg = Linux|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.OSX|Any CPU.ActiveCfg = OSX|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.OSX|Mixed Platforms.ActiveCfg = OSX|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.OSX|x86.ActiveCfg = OSX|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.PSM|Any CPU.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.PSM|Mixed Platforms.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.PSM|x86.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Release|Any CPU.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Release|Mixed Platforms.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Release|x86.ActiveCfg = PSM|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Windows|Any CPU.ActiveCfg = Windows|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Windows|Mixed Platforms.ActiveCfg = Windows|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Windows|x86.ActiveCfg = Windows|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Windows8|Any CPU.ActiveCfg = Windows8|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Windows8|Mixed Platforms.ActiveCfg = Windows8|Any CPU + {468F8415-7D38-4718-B0B4-E18F1A427136}.Windows8|x86.ActiveCfg = Windows8|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Super Polarity.suo b/Super Polarity.suo index 5f14b6d..c83e2df 100644 Binary files a/Super Polarity.suo and b/Super Polarity.suo differ diff --git a/Super Polarity/Content/Graphics/circle.xnb b/Super Polarity/Content/Graphics/circle.xnb new file mode 100644 index 0000000..3471449 Binary files /dev/null and b/Super Polarity/Content/Graphics/circle.xnb differ diff --git a/Super Polarity/Content/Graphics/diamond.xnb b/Super Polarity/Content/Graphics/diamond.xnb new file mode 100644 index 0000000..8bda70c Binary files /dev/null and b/Super Polarity/Content/Graphics/diamond.xnb differ diff --git a/Super Polarity/Content/Graphics/main-ship.xnb b/Super Polarity/Content/Graphics/main-ship.xnb new file mode 100644 index 0000000..7108e2f Binary files /dev/null and b/Super Polarity/Content/Graphics/main-ship.xnb differ diff --git a/Super Polarity/Content/Graphics/negative-cruiser.xnb b/Super Polarity/Content/Graphics/negative-cruiser.xnb new file mode 100644 index 0000000..5c9f41d Binary files /dev/null and b/Super Polarity/Content/Graphics/negative-cruiser.xnb differ diff --git a/Super Polarity/Content/Graphics/negative-destroyer.xnb b/Super Polarity/Content/Graphics/negative-destroyer.xnb new file mode 100644 index 0000000..fe13745 Binary files /dev/null and b/Super Polarity/Content/Graphics/negative-destroyer.xnb differ diff --git a/Super Polarity/Content/Graphics/negative-scout.xnb b/Super Polarity/Content/Graphics/negative-scout.xnb new file mode 100644 index 0000000..a5a2e7a Binary files /dev/null and b/Super Polarity/Content/Graphics/negative-scout.xnb differ diff --git a/Super Polarity/Content/Graphics/negative-supercruiser.xnb b/Super Polarity/Content/Graphics/negative-supercruiser.xnb new file mode 100644 index 0000000..b77f364 Binary files /dev/null and b/Super Polarity/Content/Graphics/negative-supercruiser.xnb differ diff --git a/Super Polarity/Content/Graphics/neutral-cruiser.xnb b/Super Polarity/Content/Graphics/neutral-cruiser.xnb new file mode 100644 index 0000000..ac99113 Binary files /dev/null and b/Super Polarity/Content/Graphics/neutral-cruiser.xnb differ diff --git a/Super Polarity/Content/Graphics/neutral-destroyer.xnb b/Super Polarity/Content/Graphics/neutral-destroyer.xnb new file mode 100644 index 0000000..69b5924 Binary files /dev/null and b/Super Polarity/Content/Graphics/neutral-destroyer.xnb differ diff --git a/Super Polarity/Content/Graphics/neutral-scout.xnb b/Super Polarity/Content/Graphics/neutral-scout.xnb new file mode 100644 index 0000000..5e9ff59 Binary files /dev/null and b/Super Polarity/Content/Graphics/neutral-scout.xnb differ diff --git a/Super Polarity/Content/Graphics/neutral-ship.xnb b/Super Polarity/Content/Graphics/neutral-ship.xnb new file mode 100644 index 0000000..04259be Binary files /dev/null and b/Super Polarity/Content/Graphics/neutral-ship.xnb differ diff --git a/Super Polarity/Content/Graphics/neutral-supercruiser.xnb b/Super Polarity/Content/Graphics/neutral-supercruiser.xnb new file mode 100644 index 0000000..1389842 Binary files /dev/null and b/Super Polarity/Content/Graphics/neutral-supercruiser.xnb differ diff --git a/Super Polarity/Content/Graphics/positive-cruiser.xnb b/Super Polarity/Content/Graphics/positive-cruiser.xnb new file mode 100644 index 0000000..b65d2bd Binary files /dev/null and b/Super Polarity/Content/Graphics/positive-cruiser.xnb differ diff --git a/Super Polarity/Content/Graphics/positive-destroyer.xnb b/Super Polarity/Content/Graphics/positive-destroyer.xnb new file mode 100644 index 0000000..d773175 Binary files /dev/null and b/Super Polarity/Content/Graphics/positive-destroyer.xnb differ diff --git a/Super Polarity/Content/Graphics/positive-scout.xnb b/Super Polarity/Content/Graphics/positive-scout.xnb new file mode 100644 index 0000000..2b8f9fe Binary files /dev/null and b/Super Polarity/Content/Graphics/positive-scout.xnb differ diff --git a/Super Polarity/Content/Graphics/positive-ship.xnb b/Super Polarity/Content/Graphics/positive-ship.xnb new file mode 100644 index 0000000..e4e21f1 Binary files /dev/null and b/Super Polarity/Content/Graphics/positive-ship.xnb differ diff --git a/Super Polarity/Content/Graphics/positive-supercruiser.xnb b/Super Polarity/Content/Graphics/positive-supercruiser.xnb new file mode 100644 index 0000000..2ecca79 Binary files /dev/null and b/Super Polarity/Content/Graphics/positive-supercruiser.xnb differ diff --git a/Super Polarity/Content/Graphics/star.xnb b/Super Polarity/Content/Graphics/star.xnb new file mode 100644 index 0000000..763addf Binary files /dev/null and b/Super Polarity/Content/Graphics/star.xnb differ diff --git a/Super Polarity/InputController.cs b/Super Polarity/InputController.cs new file mode 100644 index 0000000..405b3ab --- /dev/null +++ b/Super Polarity/InputController.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework.Input; + +namespace SuperPolarity +{ + static class InputController + { + static Dictionary>> Listeners; + static Dictionary> RegisteredKeys; + static Dictionary> RegisteredButtons; + + static GamePadState InputGamePadState; + static KeyboardState InputKeyboardState; + + /* + * Registered Events. + * + * You register: name of the event (ie. attack) and a key associated with it. + * or button... Left Stick /always/ dispatches move event. + */ + + static InputController() + { + Listeners = new Dictionary>>(); + InputKeyboardState = new KeyboardState(); + InputGamePadState = new GamePadState(); + } + + public static void UpdateInput() + { + Poll(); + DispatchMoveEvents(); + DispatchRegisteredEvents(); + } + + private static void Poll() + { + InputGamePadState = GamePad.GetState(Microsoft.Xna.Framework.PlayerIndex.One); + InputKeyboardState = Keyboard.GetState(); + } + + private static void DispatchRegisteredEvents() + { + } + + private static void DispatchMoveEvents() + { + float xMovement = 0.0f; + float yMovement = 0.0f; + // Dispatch the moveX / MoveY events every frame. + + xMovement = InputGamePadState.ThumbSticks.Left.X; + yMovement = -InputGamePadState.ThumbSticks.Left.Y; + + Console.WriteLine("Dispatching Input {0}", InputKeyboardState.IsKeyDown(Keys.Left)); + + if (InputKeyboardState.IsKeyDown(Keys.Left)) + { + xMovement = -1.0f; + } + + if (InputKeyboardState.IsKeyDown(Keys.Right)) + { + xMovement = 1.0f; + } + + if (InputKeyboardState.IsKeyDown(Keys.Up)) + { + yMovement = -1.0f; + } + + if (InputKeyboardState.IsKeyDown(Keys.Down)) + { + yMovement = 1.0f; + } + + Dispatch("moveX", xMovement); + Dispatch("moveY", yMovement); + } + + public static void Bind(string eventName, Action listener) + { + List> newListenerList; + List> listenerList; + bool foundListeners; + + if (!Listeners.ContainsKey(eventName)) { + newListenerList = new List>(); + Listeners.Add(eventName, newListenerList); + } + + foundListeners = Listeners.TryGetValue(eventName, out listenerList); + + listenerList.Add(listener); + } + + public static void Dispatch(string eventName, float value) + { + List> listenerList; + bool foundListeners; + + foundListeners = Listeners.TryGetValue(eventName, out listenerList); + + if (!foundListeners) + { + return; + } + + foreach (Action method in listenerList) + { + method(value); + } + } + } +} diff --git a/Super Polarity/MainShip.cs b/Super Polarity/MainShip.cs index 51d1eb3..ac7a775 100644 --- a/Super Polarity/MainShip.cs +++ b/Super Polarity/MainShip.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace SuperPolarity @@ -11,12 +12,21 @@ namespace SuperPolarity { public Texture2D PlayerTexture; public Vector2 Position; + public Vector2 Origin; public bool Active; public int Lives; public int Multiplier; public int Score; public float Angle; + // Physics Properties + Vector2 Velocity; + Vector2 Acceleration; + + float MaxVelocity; + float AccelerationRate; + ParticleEngine particleEngine; + public int Width { get { return PlayerTexture.Width; } @@ -27,7 +37,7 @@ namespace SuperPolarity get { return PlayerTexture.Height; } } - public void Initialize(Texture2D texture, Vector2 position) + public void Initialize(ContentManager Content, Texture2D texture, Vector2 position) { PlayerTexture = texture; Position = position; @@ -35,15 +45,142 @@ namespace SuperPolarity Multiplier = 1; Lives = 3; Score = 0; + + Origin = new Vector2(PlayerTexture.Width / 2, PlayerTexture.Height / 2); + Velocity = new Vector2(0, 0); + Acceleration = new Vector2(0, 0); + + MaxVelocity = 5; + AccelerationRate = 10; + + List texturesList = new List(); + texturesList.Add(Content.Load("Graphics\\circle")); + texturesList.Add(Content.Load("Graphics\\diamond")); + texturesList.Add(Content.Load("Graphics\\star")); + + particleEngine = new ParticleEngine(texturesList, Position); + + BindInput(); + } + + void BindInput() + { + InputController.Bind("moveX", HandleHorizontalMovement); + InputController.Bind("moveY", HandleVerticalMovement); + } + + public void HandleHorizontalMovement(float value) + { + Acceleration.X = value * AccelerationRate; + } + + public void HandleVerticalMovement(float value) + { + Acceleration.Y = value * AccelerationRate; + } + + public void AutoDeccelerate(GameTime gameTime) + { + if (Acceleration.X == 0 && Velocity.X > 0) { + if (AccelerationRate * gameTime.ElapsedGameTime.TotalSeconds > Velocity.X) + { + Velocity.X = 0; + Acceleration.X = 0; + } + else + { + Acceleration.X = -AccelerationRate; + } + } + + if (Acceleration.X == 0 && Velocity.X < 0) + { + if (-AccelerationRate * gameTime.ElapsedGameTime.TotalSeconds < Velocity.X) + { + Velocity.X = 0; + Acceleration.X = 0; + } + else + { + Acceleration.X = AccelerationRate; + } + } + + if (Acceleration.Y == 0 && Velocity.Y > 0) + { + if (AccelerationRate * gameTime.ElapsedGameTime.TotalSeconds > Velocity.Y) + { + Velocity.Y = 0; + Acceleration.Y = 0; + } + else + { + Acceleration.Y = -AccelerationRate; + } + } + + if (Acceleration.Y == 0 && Velocity.Y < 0) + { + if (-AccelerationRate * gameTime.ElapsedGameTime.TotalSeconds < Velocity.Y) + { + Velocity.Y = 0; + Acceleration.Y = 0; + } + else + { + Acceleration.Y = AccelerationRate; + } + } + } + + public void Update(GameTime gameTime) + { + Move(gameTime); + ChangeAngle(); + particleEngine.EmitterLocation = Position; + particleEngine.Update(); + } + + public void Move(GameTime gameTime) + { + AutoDeccelerate(gameTime); + + Velocity.X = Velocity.X + Acceleration.X * (float) gameTime.ElapsedGameTime.TotalSeconds; + Velocity.Y = Velocity.Y + Acceleration.Y * (float) gameTime.ElapsedGameTime.TotalSeconds; + + if (Velocity.X > MaxVelocity) + { + Velocity.X = MaxVelocity; + } + + if (Velocity.X < -MaxVelocity) + { + Velocity.X = -MaxVelocity; + } + + if (Velocity.Y > MaxVelocity) + { + Velocity.Y = MaxVelocity; + } + + if (Velocity.Y < -MaxVelocity) + { + Velocity.Y = -MaxVelocity; + } + + Position.X = Position.X + Velocity.X; + Position.Y = Position.Y + Velocity.Y; } - public void Update() + public void ChangeAngle() { + Angle = (float) Math.Atan2(Velocity.Y, Velocity.X); } public void Draw(SpriteBatch spriteBatch) { - spriteBatch.Draw(PlayerTexture, Position, null, Color.White, Angle, Vector2.Zero, 1f, SpriteEffects.None, 0f); + particleEngine.Draw(spriteBatch); + spriteBatch.Draw(PlayerTexture, Position, null, Color.White, Angle, Origin, 1f, SpriteEffects.None, 0f); } } } diff --git a/Super Polarity/Particle.cs b/Super Polarity/Particle.cs new file mode 100644 index 0000000..d65bac6 --- /dev/null +++ b/Super Polarity/Particle.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + class Particle + { + public Texture2D Texture { get; set; } + public Vector2 Position { get; set; } + public Vector2 Velocity { get; set; } + public float Angle { get; set; } + public float AngularVelocity { get; set; } + public Color Color { get; set; } + public float Size { get; set; } + public int TTL { get; set; } + + public Particle(Texture2D texture, Vector2 position, Vector2 velocity, + float angle, float angularVelocity, Color color, float size, int ttl) + { + Texture = texture; + Position = position; + Velocity = velocity; + Angle = angle; + AngularVelocity = angularVelocity; + Color = color; + Size = size; + TTL = ttl; + } + + public void Update() + { + TTL--; + Position += Velocity; + Angle += AngularVelocity; + } + + public void Draw(SpriteBatch spriteBatch) + { + Rectangle sourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height); + Vector2 origin = new Vector2(Texture.Width / 2, Texture.Height / 2); + + spriteBatch.Draw(Texture, Position, sourceRectangle, Color, + Angle, origin, Size, SpriteEffects.None, 0f); + } + + } +} diff --git a/Super Polarity/ParticleEngine.cs b/Super Polarity/ParticleEngine.cs new file mode 100644 index 0000000..5cf6bdb --- /dev/null +++ b/Super Polarity/ParticleEngine.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + class ParticleEngine + { + private Random random; + public Vector2 EmitterLocation { get; set; } + private List particles; + private List textures; + + public ParticleEngine(List textures, Vector2 location) + { + EmitterLocation = location; + this.textures = textures; + this.particles = new List(); + random = new Random(); + } + + private Particle GenerateNewParticle() + { + Texture2D texture = textures[random.Next(textures.Count)]; + Vector2 position = EmitterLocation; + Vector2 velocity = new Vector2( + 1f * (float)(random.NextDouble() * 2 - 1), + 1f * (float)(random.NextDouble() * 2 - 1)); + float angle = 0; + float angularVelocity = 0.1f * (float)(random.NextDouble() * 2 - 1); + Color color = new Color( + (float)random.NextDouble(), + (float)random.NextDouble(), + (float)random.NextDouble()); + float size = (float)random.NextDouble(); + + int ttl = 20 + random.Next(40); + + return new Particle(texture, position, velocity, angle, angularVelocity, color, size, ttl); + } + + public void Update() + { + int total = 10; + + for (int i = 0; i < total; i++) + { + particles.Add(GenerateNewParticle()); + } + + for (int particle = 0; particle < particles.Count; particle++) + { + particles[particle].Update(); + if (particles[particle].TTL <= 0) + { + particles.RemoveAt(particle); + particle--; + } + } + } + + public void Draw(SpriteBatch spriteBatch) + { + //spriteBatch.Begin(); + for (int index = 0; index < particles.Count; index++) + { + particles[index].Draw(spriteBatch); + } + //spriteBatch.End(); + } + } +} diff --git a/Super Polarity/Super Polarity.csproj b/Super Polarity/Super Polarity.csproj index dd5e1cd..a616ee4 100644 --- a/Super Polarity/Super Polarity.csproj +++ b/Super Polarity/Super Polarity.csproj @@ -35,7 +35,10 @@ Icon.ico + + + @@ -63,11 +66,64 @@ - - + + + + Always - + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + Segoe UI Mono + + + 14 + + + 0 + + + true + + + + + + + + + + + + ~ + + + + diff --git a/Super Polarity/ActorFactory.cs b/Super Polarity/ActorFactory.cs index 4ebbb4c..3a2dbab 100644 --- a/Super Polarity/ActorFactory.cs +++ b/Super Polarity/ActorFactory.cs @@ -10,7 +10,7 @@ namespace SuperPolarity { static class ActorFactory { - static internal Game Game; + static internal SuperPolarity Game; static public MainShip CreateMainShip(Vector2 position) { @@ -48,7 +48,7 @@ namespace SuperPolarity return ship; } - internal static void SetGame(Game game) + internal static void SetGame(SuperPolarity game) { ActorFactory.Game = game; } diff --git a/Super Polarity/ActorManager.cs b/Super Polarity/ActorManager.cs index 1b4ef96..8cd265a 100644 --- a/Super Polarity/ActorManager.cs +++ b/Super Polarity/ActorManager.cs @@ -10,9 +10,9 @@ namespace SuperPolarity static class ActorManager { - static Game Game; + static SuperPolarity Game; static int OutlierBounds; - static List Actors; + static IList Actors; static ActorManager() { @@ -50,12 +50,16 @@ namespace SuperPolarity static void CheckActors() { - var i = 0; - foreach (Actor actor in Actors) + for (var i = Actors.Count - 1; i >= 0; i--) { - i++; - foreach (Actor other in Actors.Skip(i)) + if (i >= Actors.Count) { + i = Actors.Count - 1; + } + Actor actor = Actors[i]; + for (var j = i - 1; j >= 0; j--) { + Actor other = Actors[j]; + CheckCollision(actor, other); if (actor.GetType().IsSubclassOf(typeof(Ship)) && other.GetType().IsSubclassOf(typeof(Ship))) @@ -68,6 +72,13 @@ namespace SuperPolarity static void CheckCollision(Actor actor, Actor other) { + var collision = Rectangle.Intersect(actor.Box, other.Box); + var inverseCollision = Rectangle.Intersect(other.Box, actor.Box); + if (!collision.IsEmpty && !actor.Dying && !other.Dying) + { + actor.Collide(other, collision); + other.Collide(actor, inverseCollision); + } } @@ -103,7 +114,7 @@ namespace SuperPolarity } } - internal static void SetGame(Game game) + internal static void SetGame(SuperPolarity game) { Game = game; } diff --git a/Super Polarity/Actors/Actor.cs b/Super Polarity/Actors/Actor.cs index 588ff14..8c71af0 100644 --- a/Super Polarity/Actors/Actor.cs +++ b/Super Polarity/Actors/Actor.cs @@ -10,7 +10,7 @@ namespace SuperPolarity { class Actor { - protected Game game; + protected SuperPolarity game; public List Children; @@ -18,6 +18,9 @@ namespace SuperPolarity protected Texture2D Texture; protected Vector2 Origin; public bool Active; + public Rectangle Box; + protected Vector4 BoxDimensions; + protected Texture2D BoxTexture; // Physical Properties public Vector2 Position; @@ -28,6 +31,13 @@ namespace SuperPolarity // Constraints / Behavior protected float MaxVelocity; protected float AccelerationRate; + protected int HP; + protected bool Immortal; + public bool Dying; + public int Value; + protected Color Color; + + public Actor Parent; public int Width { @@ -39,7 +49,7 @@ namespace SuperPolarity get { return Texture.Height; } } - public Actor(Game newGame) + public Actor(SuperPolarity newGame) { game = newGame; } @@ -58,6 +68,27 @@ namespace SuperPolarity MaxVelocity = 5; AccelerationRate = 10; + + HP = 1; + Immortal = false; + BoxDimensions.X = 20; + BoxDimensions.Y = 20; + BoxDimensions.W = 20; + BoxDimensions.Z = 20; + + Dying = false; + Value = 1; + + InitBox(); + BoxTexture = new Texture2D(game.GraphicsDevice, 1, 1); + BoxTexture.SetData(new Color[] { Color.White }); + + Color = Color.White; + } + + protected void InitBox() + { + Box = new Rectangle((int)(Position.X - BoxDimensions.X), (int)(Position.Y - BoxDimensions.X), (int)(BoxDimensions.X + BoxDimensions.W), (int)(BoxDimensions.Y + BoxDimensions.Z)); } public void AutoDeccelerate(GameTime gameTime) @@ -120,6 +151,13 @@ namespace SuperPolarity Move(gameTime); ChangeAngle(); CheckOutliers(); + UpdateBox(); + } + + protected virtual void UpdateBox() + { + Box.X = (int)(Position.X - BoxDimensions.X); + Box.Y = (int)(Position.Y - BoxDimensions.Y); } public virtual void Move(GameTime gameTime) @@ -167,7 +205,8 @@ namespace SuperPolarity child.Draw(spriteBatch); } - spriteBatch.Draw(Texture, Position, null, Color.White, Angle, Origin, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(Texture, Position, null, Color, Angle, Origin, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25)); } void CheckOutliers() @@ -183,5 +222,26 @@ namespace SuperPolarity } } } + + public virtual void Collide(Actor other, Rectangle collision) + { + } + + public void TakeDamage(int amount) + { + if (!Immortal) + { + HP = HP - amount; + if (HP < 0) + { + Die(); + } + } + } + + protected virtual void Die() + { + Dying = true; + } } } diff --git a/Super Polarity/Actors/Bullet.cs b/Super Polarity/Actors/Bullet.cs index 6862e69..5a7be03 100644 --- a/Super Polarity/Actors/Bullet.cs +++ b/Super Polarity/Actors/Bullet.cs @@ -10,8 +10,9 @@ namespace SuperPolarity class Bullet : Actor { protected ParticleEngine particleEngine; + public int Power; - public Bullet(Game newGame) + public Bullet(SuperPolarity newGame) : base(newGame) { } @@ -24,6 +25,11 @@ namespace SuperPolarity public override void Initialize(Texture2D texture, Vector2 position) { base.Initialize(texture, position); + BoxDimensions.X = 10; + BoxDimensions.Y = 10; + BoxDimensions.W = 10; + BoxDimensions.Z = 10; + InitBox(); particleEngine = ParticleEffectFactory.CreateBullet(position); } @@ -32,7 +38,10 @@ namespace SuperPolarity Velocity.X = (float)(MaxVelocity * Math.Cos(Angle)); Velocity.Y = (float)(MaxVelocity * Math.Sin(Angle)); + Power = 1; + Position += Velocity; + UpdateBox(); particleEngine.Update(); particleEngine.EmitterLocation = Position; @@ -43,5 +52,21 @@ namespace SuperPolarity base.Draw(spriteBatch); particleEngine.Draw(spriteBatch); } + + public override void Collide(Actor other, Rectangle collision) + { + if (Dying) { return; } + if (other.GetType().IsAssignableFrom(typeof(StandardShip))) + { + Die(); + return; + } + } + + protected override void Die() + { + ActorManager.CheckOut(this); + Parent.Children.Remove(this); + } } } diff --git a/Super Polarity/Actors/MainShip.cs b/Super Polarity/Actors/MainShip.cs index 1f4f22a..616f16e 100644 --- a/Super Polarity/Actors/MainShip.cs +++ b/Super Polarity/Actors/MainShip.cs @@ -20,7 +20,11 @@ namespace SuperPolarity protected bool Shooting; protected int ShotCooldown; - public MainShip(Game newGame) : base(newGame) {} + protected float CurrentImmortalTime; + protected float MaxImmortalTime; + protected bool Flashing; + + public MainShip(SuperPolarity newGame) : base(newGame) {} ~MainShip() { @@ -38,6 +42,13 @@ namespace SuperPolarity SetPolarity(Polarity.Positive); ShotCooldown = 50; + MaxImmortalTime = 1500; + + BoxDimensions.X = 2; + BoxDimensions.Y = 2; + BoxDimensions.W = 2; + BoxDimensions.Z = 2; + InitBox(); BindInput(); } @@ -57,7 +68,11 @@ namespace SuperPolarity protected void HandleShot(float value) { - Children.Add(ActorFactory.CreateBullet(Position, Angle)); + var bullet = ActorFactory.CreateBullet(Position, Angle); + + Children.Add(bullet); + bullet.Parent = this; + Shooting = true; Timer t = new Timer(new TimerCallback(UnlockShot)); t.Change(ShotCooldown, Timeout.Infinite); @@ -97,6 +112,7 @@ namespace SuperPolarity { base.SwitchPolarity(); SwitchParticleEngine(CurrentPolarity); + game.Player.ResetMultiplier(); } public override void SetPolarity(Polarity newPolarity) @@ -127,9 +143,35 @@ namespace SuperPolarity particleEngine.EmitterLocation = Position; particleEngine.Update(); ConstrainToEdges(); + UpdateImmortality(gameTime); Shooting = false; } + public void UpdateImmortality(GameTime gameTime) + { + if (Immortal) + { + CurrentImmortalTime += gameTime.ElapsedGameTime.Milliseconds; + + if (Flashing) + { + Color = new Color(255, 255, 255, 128); + } + else + { + Color = Color.White; + } + + Flashing = !Flashing; + + if (CurrentImmortalTime > MaxImmortalTime) + { + Immortal = false; + Color = Color.White; + } + } + } + public override void Move(GameTime gameTime) { base.Move(gameTime); @@ -207,5 +249,28 @@ namespace SuperPolarity particleEngine.Draw(spriteBatch); base.Draw(spriteBatch); } + + public override void Collide(Actor other, Rectangle collision) + { + if (other.GetType().IsAssignableFrom(typeof(StandardShip)) && + !Immortal) + { + Die(); + } + } + + protected override void Die() + { + game.Player.Lives = game.Player.Lives - 1; + game.Player.ResetMultiplier(); + if (game.Player.Lives < 0) + { + Dying = true; + } + else { + Immortal = true; + CurrentImmortalTime = 0; + } + } } } diff --git a/Super Polarity/Actors/Ship.cs b/Super Polarity/Actors/Ship.cs index b4706ac..2839c97 100644 --- a/Super Polarity/Actors/Ship.cs +++ b/Super Polarity/Actors/Ship.cs @@ -11,7 +11,6 @@ namespace SuperPolarity { public enum Polarity : byte { Negative, Positive, Neutral }; - protected uint HP; public Polarity CurrentPolarity; public uint MagneticRadius; @@ -22,10 +21,12 @@ namespace SuperPolarity protected bool Magnetizing; - public Ship(Game newGame) : base(newGame) { + public Ship(SuperPolarity newGame) : base(newGame) { MagneticRadius = 250; RepelRadius = 100; + HP = 5; + FleeVelocity = 5; ActVelocity = 2; ChargeVelocity = 1.5f; diff --git a/Super Polarity/Actors/StandardShip.cs b/Super Polarity/Actors/StandardShip.cs index 50a671a..556be0f 100644 --- a/Super Polarity/Actors/StandardShip.cs +++ b/Super Polarity/Actors/StandardShip.cs @@ -20,7 +20,7 @@ namespace SuperPolarity protected Random Random; protected bool AddingAngle; - public StandardShip(Game newGame) : base(newGame) {} + public StandardShip(SuperPolarity newGame) : base(newGame) {} public override void Initialize(Texture2D texture, Vector2 position) { @@ -37,6 +37,8 @@ namespace SuperPolarity RotationFactor = (float) (3 * Math.PI / 180); Random = new Random(BitConverter.ToInt32(cryptoResult, 0)); AddingAngle = true; + + HP = 5; } public override void Magnetize(Ship ship, float distance, float angle) @@ -56,6 +58,7 @@ namespace SuperPolarity } ChangeAngle(); Position += Velocity; + UpdateBox(); Magnetizing = false; } @@ -110,5 +113,33 @@ namespace SuperPolarity Velocity.Y = -Velocity.Y; } } + + public override void Collide(Actor other, Rectangle collision) + { + if (Dying) + { + return; + } + + if (other.GetType() == typeof(MainShip)) + { + Die(); + return; + } + + if (other.GetType() == typeof(Bullet)) + { + var theBullet = (Bullet)other; + TakeDamage(theBullet.Power); + } + } + + protected override void Die() + { + ActorManager.CheckOut(this); + Renderer.CheckOut(this); + game.Player.AddScore(Value); + game.Player.AddMultiplier(1); + } } } diff --git a/Super Polarity/Content/Fonts/SegoeUIMono14.xnb b/Super Polarity/Content/Fonts/SegoeUIMono14.xnb new file mode 100644 index 0000000..51c4abd Binary files /dev/null and b/Super Polarity/Content/Fonts/SegoeUIMono14.xnb differ diff --git a/Super Polarity/GameScreen.cs b/Super Polarity/GameScreen.cs new file mode 100644 index 0000000..4404b16 --- /dev/null +++ b/Super Polarity/GameScreen.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; + +namespace SuperPolarity +{ + class GameScreen : Screen + { + public GameScreen(SuperPolarity newGame) : base(newGame) {} + + public override void Initialize() + { + InputController.RegisterEventForButton("changePolarity", Buttons.A); + InputController.RegisterEventForKey("changePolarity", Keys.Z); + + InputController.RegisterEventForButton("shoot", Buttons.X); + InputController.RegisterEventForKey("shoot", Keys.X); + } + + public override void LoadContent() + { + Vector2 playerPosition = new Vector2(Game.GraphicsDevice.Viewport.TitleSafeArea.X, Game.GraphicsDevice.Viewport.TitleSafeArea.Y + Game.GraphicsDevice.Viewport.TitleSafeArea.Height / 2); + + Renderer.CheckIn(ActorFactory.CreateMainShip(playerPosition)); + Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200))); + Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200))); + } + + public override void Update(GameTime gameTime) + { + InputController.UpdateInput(); + ActorManager.Update(gameTime); + } + + public override void Draw(SpriteBatch spriteBatch) + { + Renderer.Draw(spriteBatch); + } + } +} diff --git a/Super Polarity/MenuItem.cs b/Super Polarity/MenuItem.cs new file mode 100644 index 0000000..77561a9 --- /dev/null +++ b/Super Polarity/MenuItem.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperPolarity +{ + class MenuItem : Widget + { + } +} diff --git a/Super Polarity/MenuWidget.cs b/Super Polarity/MenuWidget.cs new file mode 100644 index 0000000..8131e50 --- /dev/null +++ b/Super Polarity/MenuWidget.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperPolarity +{ + class MenuWidget : Widget + { + } +} diff --git a/Super Polarity/Player.cs b/Super Polarity/Player.cs new file mode 100644 index 0000000..25e66da --- /dev/null +++ b/Super Polarity/Player.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperPolarity +{ + public class Player + { + public int Score; + public int Multiplier; + public int Lives; + + public Player() + { + Score = 0; + Multiplier = 1; + Lives = 3; + } + + public void AddScore(int value) + { + Score = Score + (value * Multiplier); + } + + public void AddMultiplier(int value) + { + Multiplier = Multiplier + 1; + } + + public void ResetMultiplier() + { + Multiplier = 1; + } + + public void Draw() + { + + } + + public void Update() + { + + } + } +} diff --git a/Super Polarity/ScoreScreen.cs b/Super Polarity/ScoreScreen.cs new file mode 100644 index 0000000..b96ae9b --- /dev/null +++ b/Super Polarity/ScoreScreen.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperPolarity +{ + class ScoreScreen : Screen + { + public ScoreScreen(SuperPolarity newGame) : base(newGame) {} + + public override void Initialize() + { + } + } +} diff --git a/Super Polarity/Screen.cs b/Super Polarity/Screen.cs new file mode 100644 index 0000000..8cea5c9 --- /dev/null +++ b/Super Polarity/Screen.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + class Screen + { + protected SuperPolarity Game; + public Screen(SuperPolarity game) + { + Game = game; + } + + public virtual void Update(GameTime gameTime) + { + } + + public virtual void Draw(SpriteBatch spriteBatch) + { + } + + public virtual void LoadContent() + { + } + + public virtual void Initialize() + { + } + + public virtual void CleanUp() + { + } + } +} diff --git a/Super Polarity/ScreenManager.cs b/Super Polarity/ScreenManager.cs new file mode 100644 index 0000000..04c10a4 --- /dev/null +++ b/Super Polarity/ScreenManager.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + static class ScreenManager + { + static Stack Screens; + static SuperPolarity Game; + + static ScreenManager() + { + Screens = new Stack(); + } + + static public void Push(Screen screen) + { + Screens.Push(screen); + } + + static public void Pop() + { + Screens.Pop(); + } + + static public void Update(GameTime gameTime) + { + Screens.Peek().Update(gameTime); + } + + static public void Draw(SpriteBatch spriteBatch) + { + foreach (Screen screen in Screens) + { + screen.Draw(spriteBatch); + } + } + + internal static void SetGame(SuperPolarity game) + { + Game = game; + } + } +} diff --git a/Super Polarity/Super Polarity.csproj b/Super Polarity/Super Polarity.csproj index 193edde..2cd1d08 100644 --- a/Super Polarity/Super Polarity.csproj +++ b/Super Polarity/Super Polarity.csproj @@ -39,17 +39,26 @@ + + + + + + + + + @@ -78,6 +87,9 @@ + + Always + Always diff --git a/Super Polarity/SuperPolarity.cs b/Super Polarity/SuperPolarity.cs index 21d1ed4..6689167 100644 --- a/Super Polarity/SuperPolarity.cs +++ b/Super Polarity/SuperPolarity.cs @@ -17,20 +17,33 @@ namespace SuperPolarity /// public class SuperPolarity : Game { - public static GraphicsDeviceManager graphics; + public GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public static int OutlierBounds; + public Player Player; + + Screen EntryScreen; + + SpriteFont DebugFont; + public SuperPolarity() : base() { - SuperPolarity.graphics = new GraphicsDeviceManager(this); - SuperPolarity.graphics.PreferMultiSampling = true; + graphics = new GraphicsDeviceManager(this); + graphics.PreferMultiSampling = true; + graphics.PreferredBackBufferWidth = 1280; + graphics.PreferredBackBufferHeight = 720; + graphics.ToggleFullScreen(); + Content.RootDirectory = "Content"; ActorFactory.SetGame(this); ParticleEffectFactory.SetGame(this); ActorManager.SetGame(this); + ScreenManager.SetGame(this); + + EntryScreen = (Screen)new GameScreen(this); } /// @@ -43,13 +56,19 @@ namespace SuperPolarity { base.Initialize(); - OutlierBounds = 100; + InputController.RegisterEventForKey("fullScreenToggle", Keys.F11); + InputController.Bind("fullScreenToggle", HandleFullScreenToggle); - InputController.RegisterEventForButton("changePolarity", Buttons.A); - InputController.RegisterEventForKey("changePolarity", Keys.Z); + EntryScreen.Initialize(); + ScreenManager.Push(EntryScreen); - InputController.RegisterEventForButton("shoot", Buttons.X); - InputController.RegisterEventForKey("shoot", Keys.X); + OutlierBounds = 100; + } + + protected void HandleFullScreenToggle(float value) + { + graphics.ToggleFullScreen(); + graphics.ApplyChanges(); } /// @@ -61,11 +80,10 @@ namespace SuperPolarity // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); - Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2); + EntryScreen.LoadContent(); - Renderer.CheckIn(ActorFactory.CreateMainShip(playerPosition)); - Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200))); - Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200))); + Player = new Player(); + DebugFont = Content.Load("Fonts\\SegoeUIMono14"); } /// @@ -87,10 +105,7 @@ namespace SuperPolarity if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); - // TODO: Add your update logic here - - InputController.UpdateInput(); - ActorManager.Update(gameTime); + ScreenManager.Update(gameTime); base.Update(gameTime); } @@ -105,7 +120,11 @@ namespace SuperPolarity spriteBatch.Begin(); - Renderer.Draw(spriteBatch); + ScreenManager.Draw(spriteBatch); + + spriteBatch.DrawString(DebugFont, "Score: " + Player.Score.ToString(), new Vector2(10, 10), Color.LightGray); + spriteBatch.DrawString(DebugFont, "Multiplier: " + Player.Multiplier.ToString(), new Vector2(10, 30), Color.LightGray); + spriteBatch.DrawString(DebugFont, "Lives: " + Player.Lives.ToString(), new Vector2(10, 50), Color.LightGray); spriteBatch.End(); diff --git a/Super Polarity/TitleScreen.cs b/Super Polarity/TitleScreen.cs new file mode 100644 index 0000000..5b33218 --- /dev/null +++ b/Super Polarity/TitleScreen.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperPolarity +{ + class TitleScreen : Screen + { + public TitleScreen(SuperPolarity newGame) : base(newGame) {} + } +} diff --git a/Super Polarity/Widget.cs b/Super Polarity/Widget.cs new file mode 100644 index 0000000..65c3fd2 --- /dev/null +++ b/Super Polarity/Widget.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SuperPolarity +{ + class Widget + { + public IList Children; + public Dictionary>> Listeners; + + public virtual void AppendChild(Widget widget) + { + Children.Add(widget); + } + + public virtual void Bind(string eventName, Action eventListener) + { + List> newListenerList; + List> listenerList; + bool foundListeners; + + if (!Listeners.ContainsKey(eventName)) + { + newListenerList = new List>(); + Listeners.Add(eventName, newListenerList); + } + + foundListeners = Listeners.TryGetValue(eventName, out listenerList); + + listenerList.Add(eventListener); + } + + public virtual void Unbind(string eventName, Action eventListener) + { + // NOT YET IMPLEMENTED; + } + + public virtual void Dispatch(string eventName, float value) + { + List> listenerList; + bool foundListeners; + + foundListeners = Listeners.TryGetValue(eventName, out listenerList); + + if (!foundListeners) + { + return; + } + + foreach (Action method in listenerList) + { + method(value); + } + } + } +} diff --git a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe index 906274f..0612174 100644 Binary files a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe and b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.exe differ diff --git a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb index 837ce9b..670745d 100644 Binary files a/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb and b/Super Polarity/bin/WindowsGL/Debug/Super Polarity.pdb differ diff --git a/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache index c87641f..c7e2aaa 100644 Binary files a/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Super Polarity/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt b/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt index aa6ffb3..9c92990 100644 --- a/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt +++ b/Super Polarity/obj/x86/Debug/Super Polarity.csproj.FileListAbsolute.txt @@ -28,3 +28,4 @@ C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarit C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Content\Graphics\star.xnb C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Content\Graphics\negative-ship.xnb C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Content\Graphics\square.xnb +C:\Users\Miau\documents\visual studio 2010\Projects\Super Polarity\Super Polarity\bin\WindowsGL\Debug\Content\Fonts\SegoeUIMono14.xnb diff --git a/Super Polarity/obj/x86/Debug/Super Polarity.exe b/Super Polarity/obj/x86/Debug/Super Polarity.exe index 906274f..0612174 100644 Binary files a/Super Polarity/obj/x86/Debug/Super Polarity.exe and b/Super Polarity/obj/x86/Debug/Super Polarity.exe differ diff --git a/Super Polarity/obj/x86/Debug/Super Polarity.pdb b/Super Polarity/obj/x86/Debug/Super Polarity.pdb index 837ce9b..670745d 100644 Binary files a/Super Polarity/obj/x86/Debug/Super Polarity.pdb and b/Super Polarity/obj/x86/Debug/Super Polarity.pdb differ -- cgit From 097781e6ad3f7bb1c13c16ff7b6bb7219764fb29 Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Fri, 22 Nov 2013 06:53:08 -0600 Subject: Stuffffffff --- .../Super Polarity ContentContent.contentproj | 8 ++- Super Polarity.suo | Bin 38400 -> 58880 bytes Super Polarity/ActorFactory.cs | 78 +++++++++++++++++++++ Super Polarity/Actors/Actor.cs | 20 +++--- Super Polarity/Actors/Bullet.cs | 2 + Super Polarity/Actors/Ship.cs | 12 ++-- Super Polarity/Actors/StandardShip.cs | 18 +++-- Super Polarity/BasicGenerator.cs | 71 +++++++++++++++++++ Super Polarity/GameScreen.cs | 15 +++- Super Polarity/Super Polarity.csproj | 3 +- .../bin/WindowsGL/Debug/Super Polarity.exe | Bin 60928 -> 62976 bytes .../bin/WindowsGL/Debug/Super Polarity.pdb | Bin 112128 -> 116224 bytes Super Polarity/neutral-supercruiser.xnb | Bin 0 -> 72187 bytes .../DesignTimeResolveAssemblyReferencesInput.cache | Bin 8384 -> 8367 bytes .../Super Polarity.csproj.FileListAbsolute.txt | 2 +- Super Polarity/obj/x86/Debug/Super Polarity.exe | Bin 60928 -> 62976 bytes Super Polarity/obj/x86/Debug/Super Polarity.pdb | Bin 112128 -> 116224 bytes 17 files changed, 205 insertions(+), 24 deletions(-) create mode 100644 Super Polarity/BasicGenerator.cs create mode 100644 Super Polarity/neutral-supercruiser.xnb diff --git a/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj b/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj index 1aedf53..2b327e7 100644 --- a/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj +++ b/Super Polarity Content/Super Polarity ContentContent/Super Polarity ContentContent.contentproj @@ -110,7 +110,6 @@ - @@ -144,6 +143,13 @@ TextureProcessor + + + SegoeUIMono14 + FontDescriptionImporter + FontDescriptionProcessor + +