diff --git a/Auction_Boxing_2/Auction_Boxing_2.sln b/Auction_Boxing_2/Auction_Boxing_2.sln
index 21bd742..a6c2e94 100644
--- a/Auction_Boxing_2/Auction_Boxing_2.sln
+++ b/Auction_Boxing_2/Auction_Boxing_2.sln
@@ -1,9 +1,11 @@
Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010 Express for Windows Phone
+# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Auction_Boxing_2", "Auction_Boxing_2\Auction_Boxing_2\Auction_Boxing_2.csproj", "{F5224588-1741-45D4-BF31-E68DEA8E5333}"
EndProject
-Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "Auction_Boxing_2Content", "Auction_Boxing_2\Auction_Boxing_2Content\Auction_Boxing_2Content.contentproj", "{E6F16A82-6423-423F-936E-58FA8EF64E23}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Auction_Boxing_2Content", "Auction_Boxing_2\Auction_Boxing_2Content\Auction_Boxing_2Content.contentproj", "{E6F16A82-6423-423F-936E-58FA8EF64E23}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LevelObjects", "..\..\Propago\LevelObjects\LevelObjects.csproj", "{3D60C8CB-2284-426C-99DE-A696EA31E041}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -17,6 +19,10 @@ Global
{F5224588-1741-45D4-BF31-E68DEA8E5333}.Release|x86.Build.0 = Release|x86
{E6F16A82-6423-423F-936E-58FA8EF64E23}.Debug|x86.ActiveCfg = Debug|x86
{E6F16A82-6423-423F-936E-58FA8EF64E23}.Release|x86.ActiveCfg = Release|x86
+ {3D60C8CB-2284-426C-99DE-A696EA31E041}.Debug|x86.ActiveCfg = Debug|x86
+ {3D60C8CB-2284-426C-99DE-A696EA31E041}.Debug|x86.Build.0 = Debug|x86
+ {3D60C8CB-2284-426C-99DE-A696EA31E041}.Release|x86.ActiveCfg = Release|x86
+ {3D60C8CB-2284-426C-99DE-A696EA31E041}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj
index fed4837..1879d2c 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj
@@ -167,6 +167,10 @@
+
+ {3D60C8CB-2284-426C-99DE-A696EA31E041}
+ LevelObjects
+
Auction_Boxing_2Content
Content
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj.Debug.cachefile b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj.Debug.cachefile
index fd665fd..2d9e54a 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj.Debug.cachefile
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2.csproj.Debug.cachefile
@@ -34,10 +34,6 @@ Content\Boxing\Player_Punch.xnb
Content\Boxing\Player_Punch_Hit.xnb
Content\Boxing\Player_Running_Side.xnb
Content\Boxing\Player_Walking_Side.xnb
-Content\BoxingItems\BowlerHat_Instance.xnb
-Content\Boxing\Bitmaps\Player_Cane_Bitmap.xnb
-Content\Boxing\Bitmaps\Player_Cane_Pull_Bitmap.xnb
-Content\Boxing\Bitmaps\Player_Punch_Bitmap.xnb
Content\Boxing\LevelBackground.xnb
Content\BoxingItems\Player_BowlerHat.xnb
Content\BoxingItems\Player_BowlerHat_Catch.xnb
@@ -50,6 +46,41 @@ Content\BoxingItems\Player_Revolver.xnb
Content\BoxingItems\Player_Revolver_Hit.xnb
Content\Boxing\Player_Duck.xnb
Content\BoxingItems\Player_Revolver_Reload.xnb
-Content\Boxing\AB Background.xnb
+Content\BoxingItems\BowlerHat_Instance.xnb
+Content\Boxing\Bitmaps\Player_Cane_Bitmap.xnb
+Content\Boxing\Bitmaps\Player_Cane_Pull_Bitmap.xnb
+Content\Boxing\Bitmaps\Player_Punch_Bitmap.xnb
Content\BoxingItems\Player_Cape.xnb
Content\BoxingItems\Player_Cape_Stuck.xnb
+Content\blacklvlpng.xnb
+Content\Sounds\Block.xnb
+Content\Sounds\BowlerHat_Hit.xnb
+Content\Sounds\BowlerHat_Throw.xnb
+Content\Sounds\Bullet_Hit.xnb
+Content\Sounds\Cane_Hit.xnb
+Content\Sounds\Cape.xnb
+Content\Sounds\Jump.xnb
+Content\Sounds\MenuA.xnb
+Content\Sounds\MenuB.xnb
+Content\Sounds\MenuC.xnb
+Content\Sounds\MenuD.xnb
+Content\Sounds\MenuE.xnb
+Content\Sounds\Money_Pickup.xnb
+Content\Sounds\Revolver_Fire.xnb
+Content\Sounds\FootStep.xnb
+Content\Sounds\CaneWindUp.xnb
+Content\Sounds\CapeTug.xnb
+Content\Sounds\Gun_Click.xnb
+Content\Sounds\KnockedDown.xnb
+Content\Sounds\CapeDraw.xnb
+Content\blacklvl.xnb
+Content\test.xnb
+Content\testxml.xnb
+Content\other.xnb
+Content\otherxml.xnb
+Content\new.xnb
+Content\newxml.xnb
+Content\Auctionxml.xnb
+Content\day.xnb
+Content\dayxml.xnb
+Content\Boxing\ABBackground.xnb
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Boxing_Manager.cs b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Boxing_Manager.cs
index 8aac05b..23589d3 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Boxing_Manager.cs
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Boxing_Manager.cs
@@ -170,7 +170,8 @@ public Boxing_Manager(ContentManager content, Rectangle ClientBounds, Input_Hand
this.bounds = new Rectangle(0, 0, ClientBounds.Width, ClientBounds.Height);
this.inputs = inputs;
- background = content.Load("Boxing/AB Background");
+ background = content.Load("white");
+ //background = content.Load("blacklvlpng");
font = content.Load("Menu/menufont");
blank = content.Load("White");
@@ -192,11 +193,14 @@ public Boxing_Manager(ContentManager content, Rectangle ClientBounds, Input_Hand
state = boxingstate.idle;
- level = new Level(this, ClientBounds, blank, background);
+ level = new Level(this,content, ClientBounds, blank);
for (int i = 0; i < 4; i++)
- playerStartPositions[i] = new Vector2(bounds.X + bounds.Width / 5 * (i + 1), level.platforms[level.platforms.Length - 1].Y);
-
+ {
+ var d = level.platforms.ToDictionary(p => p.Y);
+ Rectangle r = d[d.Keys.Max()];
+ playerStartPositions[i] = new Vector2(bounds.X + bounds.Width / 5 * (i + 1), r.Y);
+ }
//level.platforms[level.platforms.Length - 1].Y = (int)playerStartPositions[0].Y;
@@ -735,6 +739,7 @@ public bool Update(GameTime gameTime)
public Rectangle GetLowerPlatform(Vector2 pos)
{
+
//float l = platformlevel;
for (int i = level.platforms.Length - 1; i > 0; i--)
{
@@ -744,12 +749,13 @@ public Rectangle GetLowerPlatform(Vector2 pos)
if (right > level.platforms[i].X && left < level.platforms[i].X + level.platforms[i].Width && level.platforms[i].Y > pos.Y)
{
- // l = level.platforms[i].Y;
+ // l = level.platforms[i].Y;
//Debug.WriteLine("Found new platform!");
return level.platforms[i];//
}
}
+
return level.platforms[level.platforms.Length - 1];
}
@@ -767,7 +773,7 @@ public void HandleCollisions(ItemInstance item)
if (players[i] != item.player) // collision with unfriendly player
{
// Check for a collision!
- if(players[i].IntersectPixels(item))
+ if (players[i].IntersectPixels(item))
players[i].state.isHitByItem(item, new StateHit(players[i]));// TODO : check for collision with player
}
}
@@ -776,7 +782,7 @@ public void HandleCollisions(ItemInstance item)
public void HandleCollisions(int player, GameTime gameTime)
{
-
+
// level collision
if (players[player].currentVerticalSpeed > 0)// && players[player].state is StateFall))
{
@@ -823,6 +829,7 @@ public void HandleCollisions(int player, GameTime gameTime)
}
}
+
// For attacking player-on-player collision (Uses per pixel)
for(int i = 0; i < 4; i++)
{
@@ -897,24 +904,7 @@ public void HandleCollisions(int player, GameTime gameTime)
}
}
- /*
- foreach (ItemInstance instance in itemInstances)
- {
- if (!instance.isEffect)
- {
- foreach (BoxingPlayer player in Players)
- {
- if (player.Hurtbox.Intersects(instance.hitbox) && player.playerindex != instance.playerId)
- {
- if (Math.Abs(player.Position.Y - instance.position.Y) <= 20 && !(player.InternalState is StateHit))
- / player.Hit(instance.item);
- Debug.WriteLine(player.Position.Y - instance.position.Y);
- //if(item is BowlerHatInstance && Math.Abs(player.Position.Y - item.position.Y
- }
- }
- }
- }
- * */
+
}
public Color[] GetBitmapData(string key, int index, int framew, int frameh)
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Level.cs b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Level.cs
index 1ba0bc6..e43a5b4 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Level.cs
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Level.cs
@@ -5,9 +5,25 @@
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
using System.Diagnostics;
-
+using LevelObjects;
namespace Auction_Boxing_2
{
+ class LevelContent
+ {
+ public Texture2D background;
+ public List platforms;
+
+ public LevelContent(Texture2D background, List ros)
+ {
+ platforms = new List();
+ this.background = background;
+ ros.ForEach(ro =>
+ platforms .Add(ro.ToRectangle()));
+ }
+
+
+ }
+
class Level
{
Boxing_Manager BoxingManager;
@@ -15,29 +31,44 @@ class Level
Texture2D tPlatform;
public Texture2D Background;
Rectangle LevelSize;
+ LevelContent clc;
-
public Rectangle[] platforms = new Rectangle[5];
- public Level(Boxing_Manager bm, Rectangle clientBounds, Texture2D tPlatform, Texture2D background)
+ public Level(Boxing_Manager bm, ContentManager content, Rectangle clientBounds, Texture2D tPlatform)
{
BoxingManager = bm;
this.clientBounds = clientBounds;
this.tPlatform = tPlatform;
- this.Background = background;
- LevelSize = new Rectangle(0, 0, clientBounds.Width, clientBounds.Height);//300 * 1, 255 * 1);
+ List levels = new List()
+ {
+ new LevelContent(
+ content.Load("Boxing/ABBackground"),
+ content.Load>("Auctionxml")),
+ new LevelContent(
+ content.Load("new"),
+ content.Load>("newxml")),
+
+ };
+ Random r = new Random();
+ clc = levels[r.Next(2)];
+
+ platforms = clc.platforms.ToArray();
+ Background = clc.background;
+
+ LevelSize = clientBounds;
- platforms[0] = new Rectangle(18 * clientBounds.Width / 25, 8 * clientBounds.Height / 30, 7 * clientBounds.Width / 25, 10);
+ //platforms[0] = new Rectangle(18 * clientBounds.Width / 25, 8 * clientBounds.Height / 30, 7 * clientBounds.Width / 25, 10);
- platforms[1] = new Rectangle(0, 16 * clientBounds.Height / 36, 10 * clientBounds.Width/ 12, 10);
+ //platforms[1] = new Rectangle(0, 16 * clientBounds.Height / 36, 10 * clientBounds.Width / 12, 10);
- platforms[2] = new Rectangle(3 * clientBounds.Width / 27, 10 * clientBounds.Height / 16, 3* clientBounds.Width / 18, 10);
+ //platforms[2] = new Rectangle(3 * clientBounds.Width / 27, 10 * clientBounds.Height / 16, 3 * clientBounds.Width / 18, 10);
- platforms[3] = new Rectangle(clientBounds.Width / 80, 9 * clientBounds.Height / 12, 3 * clientBounds.Width / 15, 10);
+ //platforms[3] = new Rectangle(clientBounds.Width / 80, 9 * clientBounds.Height / 12, 3 * clientBounds.Width / 15, 10);
- // ground
- platforms[4] = new Rectangle(0, 6 * clientBounds.Height / 7, clientBounds.Width, 10);
+ //// ground
+ //platforms[4] = new Rectangle(0, 6 * clientBounds.Height / 7, clientBounds.Width, 10);
}
public void Draw(SpriteBatch spriteBatch)
@@ -45,10 +76,10 @@ public void Draw(SpriteBatch spriteBatch)
spriteBatch.Draw(Background, LevelSize, Color.White);
// Draw the level
- /*for (int i = 0; i < platforms.Length; i++)
+ for (int i = 0; i < platforms.Length; i++)
{
- spriteBatch.Draw(tPlatform, platforms[i], Color.Brown);
- }*/
+ //spriteBatch.Draw(tPlatform, platforms[i], Color.Brown);
+ }
}
}
}
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/PlayerStates/StateJump.cs b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/PlayerStates/StateJump.cs
index cf68851..2d62cc5 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/PlayerStates/StateJump.cs
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/PlayerStates/StateJump.cs
@@ -31,7 +31,7 @@ public StateJump(BoxingPlayer player, bool fall)
player.currentVerticalSpeed = -400;
}
canCatch = true;
-
+
canCombo = true;
}
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Game.cs b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Game.cs
index 198ef62..16707ff 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Game.cs
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Game.cs
@@ -28,7 +28,7 @@ public Game()
- this.graphics.IsFullScreen = true;
+ //this.graphics.IsFullScreen = true;
this.graphics.PreferredBackBufferWidth = 800;
this.graphics.PreferredBackBufferHeight = 600;
diff --git a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2Content/Auction_Boxing_2Content.contentproj b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2Content/Auction_Boxing_2Content.contentproj
index 376be3f..4d738df 100644
--- a/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2Content/Auction_Boxing_2Content.contentproj
+++ b/Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2Content/Auction_Boxing_2Content.contentproj
@@ -46,6 +46,16 @@
+
+ test
+ TextureImporter
+ TextureProcessor
+
+
+ testxml
+ XmlImporter
+ PassThroughProcessor
+
White
TextureImporter
@@ -366,8 +376,8 @@
-
- AB Background
+
+ ABBackground
TextureImporter
TextureProcessor
False
@@ -497,6 +507,75 @@
SoundEffectProcessor
+
+
+ {3D60C8CB-2284-426C-99DE-A696EA31E041}
+ LevelObjects
+
+
+
+
+ blacklvlpng
+ TextureImporter
+ TextureProcessor
+
+
+
+
+ blacklvl
+ XmlImporter
+ PassThroughProcessor
+
+
+
+
+ other
+ TextureImporter
+ TextureProcessor
+
+
+
+
+ otherxml
+ XmlImporter
+ PassThroughProcessor
+
+
+
+
+ newxml
+ XmlImporter
+ PassThroughProcessor
+
+
+
+
+ new
+ TextureImporter
+ TextureProcessor
+
+
+
+
+ Auctionxml
+ XmlImporter
+ PassThroughProcessor
+
+
+
+
+ dayxml
+ XmlImporter
+ PassThroughProcessor
+
+
+
+
+ day
+ TextureImporter
+ TextureProcessor
+
+