From 63419029fbda7d3f2f3d5984c3d2c77f341dbd79 Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Mon, 10 Feb 2014 22:14:10 -0600 Subject: Works in win, compiles in mac --- SuperPolarityMac/Content/logo.png | Bin 0 -> 8994 bytes SuperPolarityMac/Game1.cs | 110 ++++++++++++++ SuperPolarityMac/Info.plist | 17 +++ SuperPolarityMac/Main.cs | 44 ++++++ SuperPolarityMac/Program.cs | 56 ++++--- SuperPolarityMac/Project.cs | 0 SuperPolarityMac/Properties/AssemblyInfo.cs | 27 ++++ SuperPolarityMac/SuperPolarityMac.csproj | 220 ++++++++++++++++++++++++++-- SuperPolarityMac/SuperPolarityMac.sln | 23 +++ SuperPolarityMac/SuperPolarityMac.userprefs | 13 ++ 10 files changed, 478 insertions(+), 32 deletions(-) create mode 100644 SuperPolarityMac/Content/logo.png create mode 100644 SuperPolarityMac/Game1.cs create mode 100644 SuperPolarityMac/Info.plist create mode 100644 SuperPolarityMac/Main.cs create mode 100644 SuperPolarityMac/Project.cs create mode 100644 SuperPolarityMac/Properties/AssemblyInfo.cs create mode 100644 SuperPolarityMac/SuperPolarityMac.sln create mode 100644 SuperPolarityMac/SuperPolarityMac.userprefs (limited to 'SuperPolarityMac') diff --git a/SuperPolarityMac/Content/logo.png b/SuperPolarityMac/Content/logo.png new file mode 100644 index 0000000..701c1b5 Binary files /dev/null and b/SuperPolarityMac/Content/logo.png differ diff --git a/SuperPolarityMac/Game1.cs b/SuperPolarityMac/Game1.cs new file mode 100644 index 0000000..c0756a1 --- /dev/null +++ b/SuperPolarityMac/Game1.cs @@ -0,0 +1,110 @@ +#region File Description +//----------------------------------------------------------------------------- +// SuperPolarityMacGame.cs +// +// Microsoft XNA Community Game Platform +// Copyright (C) Microsoft Corporation. All rights reserved. +//----------------------------------------------------------------------------- +#endregion + +#region Using Statements +using System; + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Input.Touch; +using Microsoft.Xna.Framework.Storage; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Media; + +#endregion + +namespace SuperPolarityMac +{ + /// + /// Default Project Template + /// + public class Game1 : Game + { + + #region Fields + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + Texture2D logoTexture; + #endregion + + #region Initialization + + public Game1() + { + + graphics = new GraphicsDeviceManager(this); + + Content.RootDirectory = "Content"; + + graphics.IsFullScreen = false; + } + + /// + /// Overridden from the base Game.Initialize. Once the GraphicsDevice is setup, + /// we'll use the viewport to initialize some values. + /// + protected override void Initialize() + { + base.Initialize(); + } + + + /// + /// Load your graphics content. + /// + protected override void LoadContent() + { + // Create a new SpriteBatch, which can be use to draw textures. + spriteBatch = new SpriteBatch(graphics.GraphicsDevice); + + // TODO: use this.Content to load your game content here eg. + logoTexture = Content.Load("logo"); + } + + #endregion + + #region Update and Draw + + /// + /// 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) + { + // 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) + { + // Clear the backbuffer + graphics.GraphicsDevice.Clear(Color.CornflowerBlue); + + spriteBatch.Begin(); + + // draw the logo + spriteBatch.Draw(logoTexture, new Vector2 (130, 200), Color.White); + + spriteBatch.End(); + + //TODO: Add your drawing code here + base.Draw(gameTime); + } + + #endregion + } +} diff --git a/SuperPolarityMac/Info.plist b/SuperPolarityMac/Info.plist new file mode 100644 index 0000000..07a58c3 --- /dev/null +++ b/SuperPolarityMac/Info.plist @@ -0,0 +1,17 @@ + + + + + CFBundleIdentifier + com.yourcompany.MonoGame.Samples.Draw2D.MacOS + CFBundleName + MonoGame.Samples.Draw2D.MacOS + CFBundleVersion + 1 + LSMinimumSystemVersion + 10.6 + NSPrincipalClass + NSApplication + + + diff --git a/SuperPolarityMac/Main.cs b/SuperPolarityMac/Main.cs new file mode 100644 index 0000000..f21bf0b --- /dev/null +++ b/SuperPolarityMac/Main.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using MonoMac.AppKit; +using MonoMac.Foundation; + +namespace SuperPolarityMac +{ + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main (string[] args) + { + NSApplication.Init (); + + using (var p = new NSAutoreleasePool ()) { + NSApplication.SharedApplication.Delegate = new AppDelegate (); + NSApplication.Main (args); + } + + + } + } + + class AppDelegate : NSApplicationDelegate + { + Game1 game; + + public override void FinishedLaunching (MonoMac.Foundation.NSObject notification) + { + game = new Game1 (); + game.Run (); + } + + public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender) + { + return true; + } + } +} + + diff --git a/SuperPolarityMac/Program.cs b/SuperPolarityMac/Program.cs index 6c3f614..e6ab5cf 100644 --- a/SuperPolarityMac/Program.cs +++ b/SuperPolarityMac/Program.cs @@ -1,26 +1,44 @@ -#region Using Statements using System; using System.Collections.Generic; using System.Linq; -#endregion +using MonoMac.AppKit; +using MonoMac.Foundation; 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 + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main (string[] args) + { + NSApplication.Init (); + + using (var p = new NSAutoreleasePool ()) { + NSApplication.SharedApplication.Delegate = new AppDelegate (); + NSApplication.Main (args); + } + + + } + } + + class AppDelegate : NSApplicationDelegate + { + SuperPolarity superPolarity; + + public override void FinishedLaunching (MonoMac.Foundation.NSObject notification) + { + superPolarity = new SuperPolarity(); + superPolarity.Run (); + } + + public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender) + { + return true; + } + } } + + diff --git a/SuperPolarityMac/Project.cs b/SuperPolarityMac/Project.cs new file mode 100644 index 0000000..e69de29 diff --git a/SuperPolarityMac/Properties/AssemblyInfo.cs b/SuperPolarityMac/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d61ed27 --- /dev/null +++ b/SuperPolarityMac/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("SuperPolarityMac")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("benbeltran")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.0")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/SuperPolarityMac/SuperPolarityMac.csproj b/SuperPolarityMac/SuperPolarityMac.csproj index 4eac2c0..ded94e3 100644 --- a/SuperPolarityMac/SuperPolarityMac.csproj +++ b/SuperPolarityMac/SuperPolarityMac.csproj @@ -5,7 +5,7 @@ AnyCPU 10.0.0 2.0 - {008F4BF1-A2AB-4EC4-977D-451AE4B1B0FE} + {EE77A85A-089B-4055-90D0-6E08DF409410} {948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe SuperPolarityMac @@ -18,7 +18,6 @@ false bin\Debug DEBUG; - prompt 4 false false @@ -32,7 +31,6 @@ full true bin\Release - prompt 4 false Full @@ -47,7 +45,6 @@ full true bin\AppStore - prompt 4 false Full @@ -65,18 +62,215 @@ - - + + ..\..\MonoGame-develop\MonoGame.Framework\bin\MacOS\Debug\MonoMac.dll + + + ..\..\MonoGame-develop\MonoGame.Framework\bin\MacOS\Debug\Lidgren.Network.dll + + + ..\..\MonoGame-develop\MonoGame.Framework\bin\MacOS\Debug\MonoGame.Framework.dll + + + ..\..\MonoGame-develop\MonoGame.Framework\bin\MacOS\Debug\Tao.Sdl.dll + + + - - - + + ActorFactory.cs + + + ActorManager.cs + + + BasicGenerator.cs + + + GameScreen.cs + + + InputController.cs + + + LetterChooseWidget.cs + + + MenuItem.cs + + + MenuWidget.cs + + + NameChooserWidget.cs + + + Particle.cs + + + ParticleEffectFactory.cs + + + ParticleEngine.cs + + + Player.cs + + + Renderer.cs + + + ScoreScreen.cs + + + Screen.cs + + + ScreenManager.cs + + + SuperPolarity.cs + + + TitleScreen.cs + + + Widget.cs + + + Actors\Actor.cs + + + Actors\Bullet.cs + + + Actors\MainShip.cs + + + Actors\Ship.cs + + + Actors\StandardShip.cs + + + Properties\AssemblyInfo.cs + + - - + + Icon.ico + + + neutral-supercruiser.xnb + + + scores.txt + + + + + + + + + + Content\Graphics\circle.xnb + + + Content\Graphics\diamond.xnb + + + Content\Graphics\main-ship.xnb + + + Content\Graphics\negative-cruiser.xnb + + + Content\Graphics\negative-destroyer.xnb + + + Content\Graphics\negative-scout.xnb + + + Content\Graphics\negative-ship.xnb + + + Content\Graphics\negative-supercruiser.xnb + + + Content\Graphics\neutral-cruiser.xnb + + + Content\Graphics\neutral-destroyer.xnb + + + Content\Graphics\neutral-scout.xnb + + + Content\Graphics\neutral-ship.xnb + + + Content\Graphics\neutral-supercruiser.xnb + + + Content\Graphics\pause-screen.xnb + + + Content\Graphics\polaritydemotitle.xnb + + + Content\Graphics\positive-cruiser.xnb + + + Content\Graphics\positive-destroyer.xnb + + + Content\Graphics\positive-scout.xnb + + + Content\Graphics\positive-ship.xnb + + + Content\Graphics\positive-supercruiser.xnb + + + Content\Graphics\square.xnb + + + Content\Graphics\star.xnb + + + Content\Fonts\SegoeUIMono14.xnb + + + Content\Fonts\bigfont.xnb + + + Content\Fonts\smallfont.xnb + + + + Content\Sound\bomb.m4a + + + Content\Sound\bullet.m4a + + + Content\Sound\gameover.m4a + + + Content\Sound\hit.m4a + + + Content\Sound\life.m4a + + + Content\Sound\polaritychange.m4a + + + Content\Sound\polaritytheme.m4a + - - \ No newline at end of file diff --git a/SuperPolarityMac/SuperPolarityMac.sln b/SuperPolarityMac/SuperPolarityMac.sln new file mode 100644 index 0000000..fd96166 --- /dev/null +++ b/SuperPolarityMac/SuperPolarityMac.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperPolarityMac", "SuperPolarityMac.csproj", "{EE77A85A-089B-4055-90D0-6E08DF409410}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + AppStore|Any CPU = AppStore|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EE77A85A-089B-4055-90D0-6E08DF409410}.AppStore|Any CPU.ActiveCfg = AppStore|Any CPU + {EE77A85A-089B-4055-90D0-6E08DF409410}.AppStore|Any CPU.Build.0 = AppStore|Any CPU + {EE77A85A-089B-4055-90D0-6E08DF409410}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE77A85A-089B-4055-90D0-6E08DF409410}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE77A85A-089B-4055-90D0-6E08DF409410}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE77A85A-089B-4055-90D0-6E08DF409410}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = SuperPolarityMac.csproj + EndGlobalSection +EndGlobal diff --git a/SuperPolarityMac/SuperPolarityMac.userprefs b/SuperPolarityMac/SuperPolarityMac.userprefs new file mode 100644 index 0000000..4e3269b --- /dev/null +++ b/SuperPolarityMac/SuperPolarityMac.userprefs @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file -- cgit