From: brady Date: Tue, 16 Mar 2010 07:16:54 +0000 (+0000) Subject: Background for lobby, currently has background with spotlight that moves around. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=53c3423a7dc02531e793531bf7aee257786ee208;p=chaz%2Fcarfire Background for lobby, currently has background with spotlight that moves around. Looks pretty Sweet. git-svn-id: https://bd85.net/svn/cs3505_group@5 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- diff --git a/Project06/lobbyTest/lobbyTest.sln b/Project06/lobbyTest/lobbyTest.sln new file mode 100644 index 0000000..d8e3cd3 --- /dev/null +++ b/Project06/lobbyTest/lobbyTest.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lobbyTest", "lobbyTest\lobbyTest.csproj", "{FC102C8D-336E-4721-BFC1-741FF35A3EAE}" +EndProject +Global + GlobalSection(SubversionScc) = preSolution + Svn-Managed = True + Manager = AnkhSVN - Subversion Support for Visual Studio + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FC102C8D-336E-4721-BFC1-741FF35A3EAE}.Debug|x86.ActiveCfg = Debug|x86 + {FC102C8D-336E-4721-BFC1-741FF35A3EAE}.Debug|x86.Build.0 = Debug|x86 + {FC102C8D-336E-4721-BFC1-741FF35A3EAE}.Release|x86.ActiveCfg = Release|x86 + {FC102C8D-336E-4721-BFC1-741FF35A3EAE}.Release|x86.Build.0 = Release|x86 + {6C642D2E-CBE1-4954-8CB4-8948822A0EA3}.Debug|x86.ActiveCfg = Debug|x86 + {6C642D2E-CBE1-4954-8CB4-8948822A0EA3}.Release|x86.ActiveCfg = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Project06/lobbyTest/lobbyTest/Content/Content.contentproj b/Project06/lobbyTest/lobbyTest/Content/Content.contentproj new file mode 100644 index 0000000..cd1be85 --- /dev/null +++ b/Project06/lobbyTest/lobbyTest/Content/Content.contentproj @@ -0,0 +1,66 @@ + + + 6c642d2e-cbe1-4954-8cb4-8948822a0ea3 + {96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + x86 + Library + Properties + v3.5 + v3.0 + x86 + bin\$(Platform)\$(Configuration) + + + Windows + + + Windows + + + + False + + + False + + + False + + + False + + + False + + + + + background + TextureImporter + TextureProcessor + + + + + cs + TextureImporter + TextureProcessor + + + + + spotlight + TextureImporter + TextureProcessor + + + + + \ No newline at end of file diff --git a/Project06/lobbyTest/lobbyTest/Content/background.png b/Project06/lobbyTest/lobbyTest/Content/background.png new file mode 100644 index 0000000..4f6616a Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/background.png differ diff --git a/Project06/lobbyTest/lobbyTest/Content/cs.png b/Project06/lobbyTest/lobbyTest/Content/cs.png new file mode 100644 index 0000000..f7d6ebd Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/cs.png differ diff --git a/Project06/lobbyTest/lobbyTest/Content/spotlight.png b/Project06/lobbyTest/lobbyTest/Content/spotlight.png new file mode 100644 index 0000000..d8c3381 Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Content/spotlight.png differ diff --git a/Project06/lobbyTest/lobbyTest/Game.ico b/Project06/lobbyTest/lobbyTest/Game.ico new file mode 100644 index 0000000..8cff41e Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/Game.ico differ diff --git a/Project06/lobbyTest/lobbyTest/Game1.cs b/Project06/lobbyTest/lobbyTest/Game1.cs new file mode 100644 index 0000000..fbb8e73 --- /dev/null +++ b/Project06/lobbyTest/lobbyTest/Game1.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.GamerServices; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Media; +using Microsoft.Xna.Framework.Net; +using Microsoft.Xna.Framework.Storage; + +namespace lobbyTest +{ + /// + /// This is the main type for your game + /// + public class Game1 : Microsoft.Xna.Framework.Game + { + GraphicsDeviceManager graphics; + SpriteBatch spriteBatch; + + Texture2D background; + Texture2D spotLight; + Texture2D cs; + + Vector2 backgroundPos; + Vector2 spotLightPos; + Vector2 spotLightCenter; + Vector2 csPos; + + Vector2 zero; + Vector2 spotLightVelocity; + + int MaxX; + int MinX; + int MaxY; + int MinY; + + public Game1() + { + 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() + { + // TODO: Add your initialization logic here + graphics.PreferredBackBufferWidth = 800; + graphics.PreferredBackBufferWidth = 600; + 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); + background = Content.Load("background"); + spotLight = Content.Load("spotlight"); + cs = Content.Load("cs"); + backgroundPos = new Vector2(0f, 0f); + spotLightPos = new Vector2(100f, graphics.GraphicsDevice.Viewport.Height - 98); + spotLightCenter = new Vector2(800f, 800f); + spotLightVelocity = new Vector2(-100, 33); + csPos = new Vector2(10f, graphics.GraphicsDevice.Viewport.Height - 98); + + zero = new Vector2(0, 0); + + MaxX = graphics.GraphicsDevice.Viewport.Width; + MinX = 0; + MaxY = graphics.GraphicsDevice.Viewport.Height; + MinY = 100; + // TODO: use this.Content to load your game content here + } + + /// + /// 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) + { + // Allows the game to exit + if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) + this.Exit(); + + // TODO: Add your update logic here + UpdateSpotLight(gameTime); + 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(SpriteBlendMode.AlphaBlend); + // TODO: Add your drawing code here + spriteBatch.Draw(background, backgroundPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0); + spriteBatch.Draw(cs, csPos, null, Color.White, 0, zero, 0.5f, SpriteEffects.None, 0); + spriteBatch.Draw(spotLight, spotLightPos, null, Color.White, 0, spotLightCenter, 1f, SpriteEffects.None, 0); + + spriteBatch.End(); + base.Draw(gameTime); + } + + private void UpdateSpotLight(GameTime gameTime) + { + spotLightPos = new Vector2(spotLightPos.X + spotLightVelocity.X * (float)gameTime.ElapsedGameTime.TotalSeconds, + spotLightPos.Y + spotLightVelocity.Y * (float)gameTime.ElapsedGameTime.TotalSeconds); + + if (spotLightPos.X > MaxX || spotLightPos.X < MinX) //right or left wall + { + spotLightVelocity = new Vector2(spotLightVelocity.X * -1, spotLightVelocity.Y); + } + else if (spotLightPos.Y > MaxY || spotLightPos.Y < MinY) //top or bottom wall + { + spotLightVelocity = new Vector2(spotLightVelocity.X, spotLightVelocity.Y * -1); + } + } + } +} diff --git a/Project06/lobbyTest/lobbyTest/GameThumbnail.png b/Project06/lobbyTest/lobbyTest/GameThumbnail.png new file mode 100644 index 0000000..462311a Binary files /dev/null and b/Project06/lobbyTest/lobbyTest/GameThumbnail.png differ diff --git a/Project06/lobbyTest/lobbyTest/Program.cs b/Project06/lobbyTest/lobbyTest/Program.cs new file mode 100644 index 0000000..cf884a2 --- /dev/null +++ b/Project06/lobbyTest/lobbyTest/Program.cs @@ -0,0 +1,19 @@ +using System; + +namespace lobbyTest +{ + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main(string[] args) + { + using (Game1 game = new Game1()) + { + game.Run(); + } + } + } +} + diff --git a/Project06/lobbyTest/lobbyTest/Properties/AssemblyInfo.cs b/Project06/lobbyTest/lobbyTest/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a8519c9 --- /dev/null +++ b/Project06/lobbyTest/lobbyTest/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +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("lobbyTest")] +[assembly: AssemblyProduct("lobbyTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("Microsoft")] + +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[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("b6ff3810-dd3d-4368-a6bd-24f4097a4b86")] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] diff --git a/Project06/lobbyTest/lobbyTest/lobbyTest.csproj b/Project06/lobbyTest/lobbyTest/lobbyTest.csproj new file mode 100644 index 0000000..e438fc8 --- /dev/null +++ b/Project06/lobbyTest/lobbyTest/lobbyTest.csproj @@ -0,0 +1,136 @@ + + + {FC102C8D-336E-4721-BFC1-741FF35A3EAE} + {6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Debug + x86 + WinExe + Properties + lobbyTest + lobbyTest + v3.5 + v3.0 + Windows + e98d7ac4-1058-458b-8a23-3f5336d62b36 + Game.ico + GameThumbnail.png + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\x86\Debug + DEBUG;TRACE;WINDOWS + prompt + 4 + true + false + x86 + false + + + pdbonly + true + bin\x86\Release + TRACE;WINDOWS + prompt + 4 + true + false + x86 + true + + + + False + True + + + False + True + + + False + + + False + + + False + + + 3.5 + False + + + 3.5 + False + + + + + + + + + + + + + + 6c642d2e-cbe1-4954-8cb4-8948822a0ea3 + False + + + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + true + + + False + Windows Installer 3.1 + true + + + False + Microsoft XNA Framework Redistributable 3.0 + true + + + + + + \ No newline at end of file