|
|
| Elements of War™ _cSharp
By Curtis Turner < IceIYIaN> http://www.ElementsofWar.net/Copyright © 2002-2012. All rights reserved.
Buy ElementsofWar Other Elements of War _cSharpEoW_cSharp is a 2D video game based on C#, using XNA Game Studio 4.0 and is designed for WindowZ XP/Vista/7/8++ Genre:Action Players: 1 Player 2 Players (Same Screen, ***NOT available on LAN or Internet)
System Requirements: Operating System: Windows XP / Windows Vista / Windows 7 *INTERNET CONNECTION REQUIRED Input: Keyboard and/or X-BoX 360 xControllers Processor: 1.0++ GHz RAM: 1gb++ Hard Drive Space: 1gb++ Video Card: Direct X capable Audio Card: Direct X capable
Rated: Adults 18++ (Violence/Blood)
Game Engine: Custom Built C# Visual Studio 2010 XNA Game Studio 4.0
Version: ElementsofWar_cSharp_v1
| |
|
// /* *** *** *** *** *** *** */ // // /* *** *** *** Elements of War *** *** *** */ // // /* *** *** *** *** *** *** */ //
/// <summary> /// Elements of War™ _cSharp /// By Curtis Turner <IceIYIaN> /// http://www.ElementsofWar.net/ /// Copyright © 2002-2012. /// All rights reserved. /// </summary> 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; /* #region #if Windows_Phone // using Microsoft.Xna.Framework.Input.Touch; #elseif #endregion */ using Microsoft.Xna.Framework.Media; namespace ElementsofWar { public class Game1 : Microsoft.Xna.Framework.Game { // Classes // Class_UnknowN class_UnknowN; // Class_Player class_Player; // Class_HUD class_HUD; // SignedInGamer gamer = Gamer.SignedInGamers[0]; // string gamerTag = gamer.GamerTag; // GamerProfile profile = Gamer.GetProfile(); // int gamerScore = GamerProfile.GamerScore; // Stream gamerPictureStream = profile.GamerPicture; // TimeSpan gameElapsed; // TimeSpan startScreenTime; // Graphics Engine // Video GraphicsDeviceManager graphics; SpriteBatch spriteBatch; /* // Viewport Viewport currentViewport; Viewport previousViewport; Viewport viewport; Viewport Viewport1; Viewport Viewport2; Viewport Viewport3; Viewport Viewport4; Viewport Viewport5; Viewport Spectator; Viewport Player_Viewport; Viewport Player2_Viewport; Viewport Player3_Viewport; Viewport Player4_Viewport; Viewport Player5_Viewport; */ Rectangle Viewport_Rect; Vector2 Viewport_Position = Vector2.Zero; Vector2 Viewport_Width = Vector2.Zero; Vector2 Viewport_Height = Vector2.Zero; // Viewport 1 Rectangle Viewport1_Rect; Vector2 Viewport1_Position = Vector2.Zero; Vector2 Viewport1_Width = Vector2.Zero; Vector2 Viewport1_Height = Vector2.Zero; // Viewport 2 Rectangle Viewport2_Rect; Vector2 Viewport2_Position = Vector2.Zero; Vector2 Viewport2_Width = Vector2.Zero; Vector2 Viewport2_Height = Vector2.Zero; // Viewport 3 Rectangle Viewport3_Rect; Vector2 Viewport3_Position = Vector2.Zero; Vector2 Viewport3_Width = Vector2.Zero; Vector2 Viewport3_Height = Vector2.Zero; // Viewport 4 Rectangle Viewport4_Rect; Vector2 Viewport4_Position = Vector2.Zero; Vector2 Viewport4_Width = Vector2.Zero; Vector2 Viewport4_Height = Vector2.Zero; // Background Texture2D Background; // Texture2D Foreground; // Texture2D Background_Texture; Rectangle Background_Rect; Vector2 Background_Position = Vector2.Zero; Vector2 Background_Width = Vector2.Zero; Vector2 Background_Height = Vector2.Zero; int Background_Position_X; int Background_Position_Y; Vector2 Background_Rotation = Vector2.Zero; int Background_Rotation_0; int Background_Rotation_360; int Background_Rotation_INT; float Background_Rotation_FLOAT; Vector2 Background_Origin = Vector2.Zero; // Background2 Texture2D Background2; // Texture2D Foreground2; // Texture2D Background2_Texture; Rectangle Background2_Rect; Vector2 Background2_Position = Vector2.Zero; Vector2 Background2_Width = Vector2.Zero; Vector2 Background2_Height = Vector2.Zero; int Background2_Position_X; int Background2_Position_Y; Vector2 Background2_Rotation = Vector2.Zero; int Background2_Rotation_0; int Background2_Rotation_360; int Background2_Rotation_INT; float Background2_Rotation_FLOAT; Vector2 Background2_Origin = Vector2.Zero; // Background3 Texture2D Background3; // Texture2D Foreground3; // Texture2D Background3_Texture; Rectangle Background3_Rect; Vector2 Background3_Position = Vector2.Zero; Vector2 Background3_Width = Vector2.Zero; Vector2 Background3_Height = Vector2.Zero; int Background3_Position_X; int Background3_Position_Y; Vector2 Background3_Rotation = Vector2.Zero; int Background3_Rotation_0; int Background3_Rotation_360; int Background3_Rotation_INT; float Background3_Rotation_FLOAT; Vector2 Background3_Origin = Vector2.Zero; // Background4 Texture2D Background4; // Texture2D Foreground4; // Texture2D Background4_Texture; Rectangle Background4_Rect; Vector2 Background4_Position = Vector2.Zero; Vector2 Background4_Width = Vector2.Zero; Vector2 Background4_Height = Vector2.Zero; int Background4_Position_X; int Background4_Position_Y; Vector2 Background4_Rotation = Vector2.Zero; int Background4_Rotation_0; int Background4_Rotation_360; int Background4_Rotation_INT; float Background4_Rotation_FLOAT; Vector2 Background4_Origin = Vector2.Zero; // Console Texture2D Console; Rectangle Console_Rect; Vector2 Console_Position = Vector2.Zero; Vector2 Console_Width = Vector2.Zero; Vector2 Console_Height = Vector2.Zero; // TouchCollection touchState; // AccelerometerState accelerometerState; // Keyboard KeyboardState currentKeyboardState; KeyboardState previousKeyboardState; KeyboardState keyboardState; // GamePad // GamePadType gamePadType; // GamePadType gamePadType2; // GamePadType gamePadType3; // GamePadType gamePadType4; GamePadState currentGamePadState; // GamePadState currentGamePadState2; // GamePadState currentGamePadState3; // GamePadState currentGamePadState4; GamePadState previousGamePadState; // GamePadState previousGamePadState2; // GamePadState previousGamePadState3; // GamePadState previousGamePadState4; GamePadState gamePadState; // GamePadState gamePadState2; // GamePadState gamePadState3; // GamePadState gamePadState4; // GamePadState gamePadState = GamePad.GetState(PlayerIndex.One); // GamePadState gamePadState2 = GamePad.GetState(PlayerIndex.Two); // GamePadState gamePadState3 = GamePad.GetState(PlayerIndex.Three); // GamePadState gamePadState4 = GamePad.GetState(PlayerIndex.Four); // Mouse MouseState currentMouseState; MouseState previousMouseState; MouseState mouseState; Texture2D Mouse_Texture; Rectangle Mouse_Rect; Vector2 Mouse_Position = Vector2.Zero; Vector2 Mouse_Width = Vector2.Zero; Vector2 Mouse_Height = Vector2.Zero; int Mouse_Position_X; int Mouse_Position_Y; bool Mouse_Button_Left_Clicked; bool Mouse_Button_Right_Clicked; Texture2D Mouse2_Texture; Rectangle Mouse2_Rect; Vector2 Mouse2_Position = Vector2.Zero; Vector2 Mouse2_Width = Vector2.Zero; Vector2 Mouse2_Height = Vector2.Zero; int Mouse2_Position_X; int Mouse2_Position_Y; bool Mouse2_Button_Left_Clicked; bool Mouse2_Button_Right_Clicked; Texture2D Mouse3_Texture; Rectangle Mouse3_Rect; Vector2 Mouse3_Position = Vector2.Zero; Vector2 Mouse3_Width = Vector2.Zero; Vector2 Mouse3_Height = Vector2.Zero; int Mouse3_Position_X; int Mouse3_Position_Y; bool Mouse3_Button_Left_Clicked; bool Mouse3_Button_Right_Clicked; Texture2D Mouse4_Texture; Rectangle Mouse4_Rect; Vector2 Mouse4_Position = Vector2.Zero; Vector2 Mouse4_Width = Vector2.Zero; Vector2 Mouse4_Height = Vector2.Zero; int Mouse4_Position_X; int Mouse4_Position_Y; bool Mouse4_Button_Left_Clicked; bool Mouse4_Button_Right_Clicked; // Animations // Animation Anim_Player_Idle; // Animation Anim_Player_Run; // Animation Anim_Player_Jump; // Animation Anim_Player_Die; // Specating and Teams, AI int Spectator_Limit; int Team_1_Limit; int Team_2_Limit; int Team_1_Limit_AI; int Team_2_Limit_AI; int Team_1_Amount; int Team_2_Amount; int Team_1_Amount_AI; int Team_2_Amount_AI; int Team_1_Level; int Team_2_Level; int Team1_Level_AI; int Team2_Level_AI; // Player Texture2D Player_Texture; Rectangle Player_Rect; Vector2 Player_Position = Vector2.Zero; Vector2 Player_Width = Vector2.Zero; Vector2 Player_Height = Vector2.Zero; int Player_Position_X; int Player_Position_Y; Vector2 Player_Rotation = Vector2.Zero; int Player_Rotation_0; int Player_Rotation_360; int Player_Rotation_INT; float Player_Rotation_FLOAT; Vector2 Player_Origin = Vector2.Zero; // Player 2 Texture2D Player2_Texture; Rectangle Player2_Rect; Vector2 Player2_Position = Vector2.Zero; Vector2 Player2_Width = Vector2.Zero; Vector2 Player2_Height = Vector2.Zero; int Player2_Position_X; int Player2_Position_Y; Vector2 Player2_Rotation = Vector2.Zero; int Player2_Rotation_0; int Player2_Rotation_360; int Player2_Rotation_INT; float Player2_Rotation_FLOAT; Vector2 Player2_Origin = Vector2.Zero; // Player 3 Texture2D Player3_Texture; Rectangle Player3_Rect; Vector2 Player3_Position = Vector2.Zero; Vector2 Player3_Width = Vector2.Zero; Vector2 Player3_Height = Vector2.Zero; int Player3_Position_X; int Player3_Position_Y; // Player4 Texture2D Player4_Texture; Rectangle Player4_Rect; Vector2 Player4_Position = Vector2.Zero; Vector2 Player4_Width = Vector2.Zero; Vector2 Player4_Height = Vector2.Zero; int Player4_Position_X; int Player4_Position_Y; /* bool Player_Anim_Attack; bool Player_Anim_Attack2; bool Player_Anim_Block; bool Player_Anim_Forward; bool Player_Anim_Back; bool Player_Anim_Left; bool Player_Anim_Right; bool Player_Anim_Jump; bool Player_Anim_Duck; // Weapon bool Fireball_Enabled; Texture2D Fireball_Texture; Rectangle Fireball_Rect; Vector2 Fireball_Position = Vector2.Zero; int Fireball_Position_X; int Fireball_Position_Y; Vector2 Fireball_Width = Vector2.Zero; Vector2 Fireball_Height = Vector2.Zero; Vector2 Fireball_Rotation = Vector2.Zero; int Fireball_Rotation_0; int Fireball_Rotation_360; int Fireball_Rotation_INT; float Fireball_Rotation_FLOAT; Vector2 Fireball_Origin = Vector2.Zero; */ bool Player_Spectating; bool Player_Human; bool Player_Sex; // 0 Female // 1 Male bool Player_Male; bool Player_Female; bool Player_Team; bool Player_Alive; int Player_Health; int Player_Mana; int Player_Stamina; int Player_Breath; int Player_Armor_Head; int Player_Armor_Body; int Player_Level; int Player_Kills; int Player_Deaths; int Player_Score; int Player_Weapon_Current; int Player_Weapon_Last; int Player_Weapon_Next; // Castle Texture2D Castle_Texture; Rectangle Castle_Rect; Vector2 Castle_Position = Vector2.Zero; Vector2 Castle_Width = Vector2.Zero; Vector2 Castle_Height = Vector2.Zero; int Castle_Position_X; int Castle_Position_Y; Vector2 Castle_Rotation = Vector2.Zero; int Castle_Rotation_0; int Castle_Rotation_360; int Castle_Rotation_INT; float Castle_Rotation_FLOAT; Vector2 Castle_Origin = Vector2.Zero; // Castle2 Texture2D Castle2_Texture; Rectangle Castle2_Rect; Vector2 Castle2_Position = Vector2.Zero; Vector2 Castle2_Width = Vector2.Zero; Vector2 Castle2_Height = Vector2.Zero; int Castle2_Position_X; int Castle2_Position_Y; Vector2 Castle2_Rotation = Vector2.Zero; int Castle2_Rotation_0; int Castle2_Rotation_360; int Castle2_Rotation_INT; float Castle2_Rotation_FLOAT; Vector2 Castle2_Origin = Vector2.Zero; // Physics int sv_Phy_Speed_Min; int sv_Phy_Speed_Max; int sv_Phy_Speed_Default; int sv_Phy_Speed_Back; int sv_Phy_Speed_Forkward; int sv_Phy_Speed_Strafe; int sv_Phy_Speed_ForwardStrafe; int sv_Phy_Speed_BackStrafe; int sv_Phy_Walking_Enabled; int sv_Phy_Running_Enabled; int sv_Phy_Gravity; int sv_Phy_Friction; int sv_Phy_Friction_Water; bool sv_Phy_Jumping_Enabled; bool sv_Phy_Ducking_Enabled; bool sv_Phy_DuckJump_Enabled; int sv_Phy_Duck_Speed; int sv_Phy_Jump_Height; int sv_Phy_MultiJumps; bool sv_Phy_Dodging; bool sv_Phy_Backflip_Enabled; bool sv_Phy_Roll_Strafed_Enabled; int sv_Phy_AirAccelRate; bool sv_Phy_Air_Strafe; // Quake's strafe jump (Movement and mouse speed) bool sv_Phy_Air_Curve; // PainKiller's curve jump (Mouse speed) bool sv_Phy_Air_Movement; // UnrealTournament's move jump (Movement speed) // Camera int Camera_X; int Camera_Y; int Camera_Z; bool Camera_ThirdPerson; int Camera_Distance_Min; int Camera_Distance_Max; int Camera_Distance; int Camera_Pitch_Min; int Camera_Pitch_Max; int Camera_Pitch; int Camera_Yaw_Min; int Camera_Yaw_Max; int Camera_Yaw; int Camera_Side_Min; int Camera_Side_Max; int Camera_Side; int Camera_Sky_Min; int Camera_Sky_Max; int Camera_Sky; int Player_Camera_X; int Player_Camera_Y; int Player_Camera_Z; int Player2_Camera_X; int Player2_Camera_Y; int Player2_Camera_Z; int Player3_Camera_X; int Player3_Camera_Y; int Player3_Camera_Z; int Player4_Camera_X; int Player4_Camera_Y; int Player4_Camera_Z; bool sv_Camera_ThirdPerson; int sv_Camera_Distance_Min; int sv_Camera_Distance_Max; int sv_Camera_Distance; int sv_Camera_Pitch_Min; int sv_Camera_Pitch_Max; int sv_Camera_Pitch; int sv_Camera_Yaw_Min; int sv_Camera_Yaw_Max; int sv_Camera_Yaw; int sv_Camera_Side_Min; int sv_Camera_Side_Max; int sv_Camera_Side; int sv_Camera_Sky_Min; int sv_Camera_Sky_Max; int sv_Camera_Sky; // Make default hotkeys here? // Models // Model Model_Player_Male; // = NuLL; // Model Model_Player_Female; // = NuLL; // Sounds SoundEffect Sound_NuLL; // SoundEffect Sound_Mouse_Left_Clicked; // SoundEffect Sound_Mouse_Right_Clicked; // SoundEffect Sound_Console; // SoundEffect Sound_MainMenu; // SoundEffect Sound_Win; // SoundEffect Sound_Lose; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; #if WINDOWS // IsFixedTimeStep = false; // IsMouseVisible = true; #endif #if XBOX #endif #if WINDOWS_PHONE graphics.IsFullScreen = true; // Frames Per Second is 30 for WindowZ Phone TargetElapsedTime = TimeSpan.FromTicks(333333); // Extend battery life under lock. // InactiveSleepTime = TimeSpan.FromSeconds(1); #endif } protected override void Initialize() { Window.Title = "Elements of War"; // Windows Phone // Portrait and Landscape // graphics.PreferredBackBufferWidth = 480; // OR 320; // graphics.PreferredBackBufferHeight = 800; // OR 480; // graphics.PreferredBackBufferWidth = 320; // graphics.PreferredBackBufferHeight = 480; // graphics.PreferredBackBufferWidth = 640; // graphics.PreferredBackBufferHeight = 480; graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; // graphics.PreferredBackBufferWidth = 1024; // graphics.PreferredBackBufferHeight = 768; graphics.IsFullScreen = true; graphics.ApplyChanges(); // Initialize classes // Class_UnknowN class_UnknowN; // Class_Player class_Player; // Class_HUD class_HUD; // Add code above base.Initialize(); } protected override void LoadContent() { // Initialize classes // class_UnknowN = new Class_UnknowN(); // Class_Player class_Player; // Class_HUD class_HUD; Viewport_Rect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); Viewport1_Position = new Vector2(0, 0); Viewport2_Position = new Vector2(0, 0); Viewport3_Position = new Vector2(0, 0); Viewport4_Position = new Vector2(0, 0); Viewport1_Rect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); Viewport2_Rect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); Viewport3_Rect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); Viewport4_Rect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); Mouse_Rect = new Rectangle(0, 0, 16, 16); Mouse.SetPosition(0, 0); // // // Mouse.SetPosition(Mouse_X, Mouse_Y); Mouse2_Rect = new Rectangle(0, 0, 16, 16); Mouse2_Position = new Vector2(0, 0); Mouse2_Position.X = 0; Mouse2_Position.Y = 0; Mouse3_Rect = new Rectangle(0, 0, 16, 16); Mouse3_Position = new Vector2(0, 0); Mouse3_Position.X = 0; Mouse3_Position.Y = 0; Mouse4_Rect = new Rectangle(0, 0, 16, 16); Mouse4_Position = new Vector2(0, 0); Mouse4_Position.X = 0; Mouse4_Position.Y = 0; /// spriteBatch spriteBatch = new SpriteBatch(GraphicsDevice); Background = Content.Load<Texture2D>("Materials/xConsole/Background/Background"); Background2 = Content.Load<Texture2D>("Materials/xConsole/Background/Background2"); Background3 = Content.Load<Texture2D>("Materials/xConsole/Background/Background3"); Background4 = Content.Load<Texture2D>("Materials/xConsole/Background/Background4"); // Foreground = Content.Load<Texture2D>("Materials/xConsole/Background/Foreground"); Console = Content.Load<Texture2D>("Materials/xConsole/Console/Console"); Mouse_Texture = Content.Load<Texture2D>("Materials/xConsole/Mouse/Mouse"); Mouse2_Texture = Content.Load<Texture2D>("Materials/xConsole/Mouse/Mouse2"); Mouse3_Texture = Content.Load<Texture2D>("Materials/xConsole/Mouse/Mouse3"); Mouse4_Texture = Content.Load<Texture2D>("Materials/xConsole/Mouse/Mouse4"); Player_Texture = Content.Load<Texture2D>("Materials/xGame/Player/Player"); Player2_Texture = Content.Load<Texture2D>("Materials/xGame/Player/Player2"); Player3_Texture = Content.Load<Texture2D>("Materials/xGame/Player/Player3"); Player4_Texture = Content.Load<Texture2D>("Materials/xGame/Player/Player4"); Castle_Texture = Content.Load<Texture2D>("Materials/xGame/2Dsky/Buildings/Castle"); Castle2_Texture = Content.Load<Texture2D>("Materials/xGame/2Dsky/Buildings/Castle2"); // Castle3_Texture = Content.Load<Texture2D>("Materials/xGame/2Dsky/Buildings/Castle3"); // Castle4_Texture = Content.Load<Texture2D>("Materials/xGame/2Dsky/Buildings/Castle4"); // Anim_Player_Idle = new Animation(Content.Load<Texture2D>("Sprites/Player/Idle"), 0.1f, true); // Anim_Player_Run = new Animation(Content.Load<Texture2D>("Sprites/Player/Run"), 0.1f, true); // Anim_Player_Jump = new Animation(Content.Load<Texture2D>("Sprites/Player/Jump"), 0.1f, false); // Anim_Player_Die = new Animation(Content.Load<Texture2D>("Sprites/Player/Die"), 0.1f, false); //////// spriteSheetforward = Content.Load<Texture2D>(Player_Running_Foward); //////// spriteSheetbackward = Content.Load<Texture2D>(Player_Running_Back); Player_Spectating = false; Player_Human = true; Player_Sex = false; // 0 Female // 1 Male Player_Male = false; Player_Female = false; Player_Team = false; Player_Alive = true; Player_Health = 50; Player_Mana = 25; Player_Stamina = 100; Player_Breath = 100; Player_Armor_Head = 100; Player_Armor_Body = 100; Player_Level = 1; Player_Kills = 0; Player_Deaths = 0; Player_Score = 0; Player_Weapon_Current = 1; Player_Weapon_Last = 2; Player_Weapon_Next = 2; Player_Rect = new Rectangle(0, 0, 0, 0); Player_Position = new Vector2(0, 0); Player_Position.X = (graphics.GraphicsDevice.Viewport.Width / 2) - 32; Player_Position.Y = graphics.GraphicsDevice.Viewport.Height - 64; Player_Position_X = (graphics.GraphicsDevice.Viewport.Width / 2) - 32; Player_Position_Y = graphics.GraphicsDevice.Viewport.Height - 64; Player_Width = new Vector2(0, 0); Player_Width.X = 64; Player_Width.Y = 64; Player_Height = new Vector2(0, 0); Player_Height.X = 64; Player_Height.Y = 64; Player_Rotation = new Vector2(0, 0); Player_Rotation.X = 64; Player_Rotation.Y = 64; Player_Rotation_0 = 0; Player_Rotation_360 = 360; Player_Rotation_INT = 0; Player_Rotation_FLOAT = 1.0f; Player_Origin = new Vector2(0, 0); Player_Origin.X = 0; Player_Origin.Y = 0; Player2_Rect = new Rectangle(0, 0, 0, 0); Player2_Position = new Vector2(0, 0); Player2_Position.X = (graphics.GraphicsDevice.Viewport.Width / 2) - 32; Player2_Position.Y = graphics.GraphicsDevice.Viewport.Height - 64; Player2_Position_X = (graphics.GraphicsDevice.Viewport.Width / 2) - 32; Player2_Position_Y = graphics.GraphicsDevice.Viewport.Height - 64; Player2_Width = new Vector2(0, 0); Player2_Width.X = 64; Player2_Width.Y = 64; Player2_Height = new Vector2(0, 0); Player2_Height.X = 64; Player2_Height.Y = 64; Player2_Rotation = new Vector2(0, 0); Player2_Rotation.X = 64; Player2_Rotation.Y = 64; Player2_Rotation_0 = 0; Player2_Rotation_360 = 360; Player2_Rotation_INT = 0; Player2_Rotation_FLOAT = 1.0f; Player2_Origin = new Vector2(0, 0); Player2_Origin.X = 0; Player2_Origin.Y = 0; // Fireball_Enabled = false; // Fireball_Position_X = Player_Position_X + 0; // Fireball_Position_Y = Player_Position_Y + 0; // Models // Model_Player = Content.Load<Model>("Models/xGame/Player/Player"); // Model_Player_Male = Content.Load<Model>("Models/xGame/Player/Male"); // Model_Player_Female = Content.Load<Model>("Models/xGame/Player/Female"); // Sounds Sound_NuLL = Content.Load<SoundEffect>("Sound/NuLL"); // Sound_Console = Content.Load<SoundEffect>("Sound/NuLL"); // Sound_MainMenu = Content.Load<SoundEffect>("Sound/NuLL"); // Sound_Win = Content.Load<SoundEffect>("Sound/NuLL"); // Sound_Lose = Content.Load<SoundEffect>("Sound/NuLL"); } protected override void UnloadContent() { } protected override void Update(GameTime gameTime) // KeyboardState keyboardState, // GamePadState gamePadState, // TouchCollection touchState, // AccelerometerState accelState, // DisplayOrientation orientation) { // float time = (float)gameTime.TotalGameTime.TotalSeconds; // float ElapsedTimeFloat = (float)gameTime.ElapsedGameTime.TotalSeconds; // Player Player_Input_Device(); Player2_Input_Device(); Player3_Input_Device(); Player4_Input_Device(); // Player_Collision(); // Add code above base.Update(gameTime); } protected void Player_Input_Device() { previousMouseState = currentMouseState; currentMouseState = Mouse.GetState(); MouseState mouseState = Mouse.GetState(); // // // Mouse.GetState(); previousKeyboardState = currentKeyboardState; currentKeyboardState = Keyboard.GetState(); KeyboardState keyboardState = Keyboard.GetState(); previousGamePadState = currentGamePadState; // previousGamePadState2 = currentGamePadState2; // previousGamePadState3 = currentGamePadState3; // previousGamePadState4 = currentGamePadState4; currentGamePadState = GamePad.GetState(PlayerIndex.One); // currentGamePadState2 = GamePad.GetState(PlayerIndex.Two); // currentGamePadState3 = GamePad.GetState(PlayerIndex.Three); // currentGamePadState4 = GamePad.GetState(PlayerIndex.Four); GamePadState gamePadState = GamePad.GetState(PlayerIndex.One); // GamePadState gamePadState2 = GamePad.GetState(PlayerIndex.Two); // GamePadState gamePadState3 = GamePad.GetState(PlayerIndex.Three); // GamePadState gamePadState4 = GamePad.GetState(PlayerIndex.Four); if ( keyboardState.IsKeyDown(Keys.Escape) || GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || GamePad.GetState(PlayerIndex.Two).Buttons.Back == ButtonState.Pressed || GamePad.GetState(PlayerIndex.Three).Buttons.Back == ButtonState.Pressed || GamePad.GetState(PlayerIndex.Four).Buttons.Back == ButtonState.Pressed // || // mouseState.LeftButton == ButtonState.Pressed ) { this.Exit(); } /* Mouse_Position.X = mouseState.X; Mouse_Position.Y = mouseState.Y; Mouse2_Position.X = 0; Mouse2_Position.Y = 0; Mouse3_Position.X = 0; Mouse3_Position.Y = 0; Mouse4_Position.X = 0; Mouse4_Position.Y = 0; */ if (mouseState.LeftButton == ButtonState.Pressed) { Player_Rotation_FLOAT += 0.022f; Mouse_Button_Left_Clicked = true; //Sound_Fireball.Play(); } else if (mouseState.LeftButton == ButtonState.Released) { } if (mouseState.RightButton == ButtonState.Pressed) { Mouse_Button_Right_Clicked = true; } else if (mouseState.RightButton == ButtonState.Released) { } if (currentKeyboardState.IsKeyDown(Keys.LeftAlt)) { Sound_NuLL.Play(); } if (currentKeyboardState.IsKeyDown(Keys.F1)) { graphics.PreferredBackBufferWidth = 1024; graphics.PreferredBackBufferHeight = 768; graphics.IsFullScreen = true; graphics.ApplyChanges(); // System.Console.WriteLine("We're in debug mode"); // Sound_Fireball.Play(); } // if (currentKeyboardState.IsKeyUp(Keys.F1)) // { // } /* if (currentKeyboardState.IsKeyDown(Keys.A)) { Player_Position.Y += 4; if (Player_Position.Y <= 0) { Player_Position.Y = 0; } if (Player_Position.Y >= graphics.GraphicsDevice.Viewport.Height - 64) { Player_Position.Y = graphics.GraphicsDevice.Viewport.Height - 64; } Player_Position_Y += 4; } if (currentKeyboardState.IsKeyDown(Keys.S)) { Player_Position.Y -= 4; if (Player_Position.Y <= 0) { Player_Position.Y = 0; } if (Player_Position.Y >= graphics.GraphicsDevice.Viewport.Height - 64) { Player_Position.Y = graphics.GraphicsDevice.Viewport.Width - 64; } Player_Position_Y -= 4; } */
if (currentKeyboardState.IsKeyDown(Keys.D)) { Player_Position.X -= 4; if (Player_Position.X <= 0) { Player_Position.X = 0; } if (Player_Position.X >= graphics.GraphicsDevice.Viewport.Width - 64) { Player_Position.X = graphics.GraphicsDevice.Viewport.Width - 64; } Player_Position_X -= 4; } if (currentKeyboardState.IsKeyDown(Keys.F)) { Player_Position.X += 4; if (Player_Position.X <= 0) { Player_Position.X = 0; } if (Player_Position.X >= graphics.GraphicsDevice.Viewport.Width - 64) { Player_Position.X = graphics.GraphicsDevice.Viewport.Width - 64; } Player_Position_X += 4; } /* if (currentKeyboardState.IsKeyDown(Keys.Down) || currentGamePadState.DPad.Down == ButtonState.Pressed) { Player_Position.Y += 4; if (Player_Position.Y <= 0) { Player_Position.Y = 0; } if (Player_Position.Y >= graphics.GraphicsDevice.Viewport.Height - 64) { Player_Position.Y = graphics.GraphicsDevice.Viewport.Height - 64; } Player_Position_Y += 4; } if (currentKeyboardState.IsKeyDown(Keys.Up) || currentGamePadState.DPad.Up == ButtonState.Pressed) { Player_Position.Y -= 4; if (Player_Position.Y <= 0) { Player_Position.Y = 0; } if (Player_Position.Y >= graphics.GraphicsDevice.Viewport.Height - 64) { Player_Position.Y = graphics.GraphicsDevice.Viewport.Height - 64; } Player_Position_Y -= 4; } */ if (currentKeyboardState.IsKeyDown(Keys.Left) || currentGamePadState.DPad.Left == ButtonState.Pressed) { Player2_Position.X -= 4; if (Player2_Position.X <= 0) { Player2_Position.X = 0; } if (Player2_Position.X >= graphics.GraphicsDevice.Viewport.Width - 64) { Player2_Position.X = graphics.GraphicsDevice.Viewport.Width - 64; } Player2_Position_X -= 4; } if (currentKeyboardState.IsKeyDown(Keys.Right) || currentGamePadState.DPad.Right == ButtonState.Pressed) { Player2_Position.X += 4; if (Player2_Position.X <= 0) { Player2_Position.X = 0; } if (Player2_Position.X >= graphics.GraphicsDevice.Viewport.Width - 64) { Player2_Position.X = graphics.GraphicsDevice.Viewport.Width - 64; } Player2_Position_X += 4; } //////// float TS_Left_UD = GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.X; /////// float TS_Left_LR = GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.Y; /////// if (currentGamePadState.ThumbSticks.Left.X = TS_Left_UD) //////// { //////// } } protected void Player2_Input_Device() { } protected void Player3_Input_Device() { } protected void Player4_Input_Device() { } protected override void Draw(GameTime gameTime) { // Background GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(); spriteBatch.Draw(Background, Viewport_Rect, Color.White); spriteBatch.End(); spriteBatch.Begin(); spriteBatch.Draw(Background2, Viewport_Rect, Color.White); spriteBatch.End(); spriteBatch.Begin(); spriteBatch.Draw(Background3, Viewport_Rect, Color.White); spriteBatch.End(); spriteBatch.Begin(); spriteBatch.Draw(Background4, Viewport_Rect, Color.White); spriteBatch.End(); // spriteBatch.Begin(); // Draw_Scene(); // Draw_Player(); // Draw_HUD(); // Draw_Team(); // Draw_Enemy(); // spriteBatch.End();
// // Castle // spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); // spriteBatch.Draw(Castle_Texture, Castle_Position, Color.White); // spriteBatch.End(); // // Castle2 // spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); // spriteBatch.Draw(Castle2_Texture, Castle2_Position, Color.White); // spriteBatch.End(); // Player spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(Player_Texture, Player_Position, Color.White); spriteBatch.End(); // spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); // spriteBatch.Draw(Player_Texture, Player_Position, Viewport_Rect, Color.White, Player_Rotation_FLOAT, Player_Origin, 1.0f, SpriteEffects.None, 1); // spriteBatch.End(); // Player 2 spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(Player2_Texture, Player2_Position, Color.White); spriteBatch.End(); // // Player 3 // spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); // spriteBatch.Draw(Player3_Texture, Player3_Position, Color.White); // spriteBatch.End(); // // Player 4 // spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); // spriteBatch.Draw(Player4_Texture, Player4_Position, Color.White); // spriteBatch.End();
/* // Mouse spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(Mouse_Texture, Mouse_Position, Color.White); spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(Mouse2_Texture, Mouse2_Position, Color.White); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(Mouse3_Texture, Mouse3_Position, Color.White); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(Mouse4_Texture, Mouse4_Position, Color.White); spriteBatch.End(); */ // Add code above base.Draw(gameTime); } private void Draw_Scene() { } private void Draw_Player() { } private void Draw_HUD() { } private void Draw_Team() { } private void Draw_Enemy() { } } } | |
|
|