Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Auction_Boxing_2/Auction_Boxing_2.sln
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Propago\LevelObjects\LevelObjects.csproj">
<Project>{3D60C8CB-2284-426C-99DE-A696EA31E041}</Project>
<Name>LevelObjects</Name>
</ProjectReference>
<ProjectReference Include="..\Auction_Boxing_2Content\Auction_Boxing_2Content.contentproj">
<Name>Auction_Boxing_2Content</Name>
<XnaReferenceType>Content</XnaReferenceType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<Texture2D>("Boxing/AB Background");
background = content.Load<Texture2D>("white");
//background = content.Load<Texture2D>("blacklvlpng");
font = content.Load<SpriteFont>("Menu/menufont");
blank = content.Load<Texture2D>("White");

Expand All @@ -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;

Expand Down Expand Up @@ -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--)
{
Expand All @@ -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];
}

Expand All @@ -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
}
}
Expand All @@ -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))
{
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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)
Expand Down
59 changes: 45 additions & 14 deletions Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Boxing/Level.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,81 @@
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<Rectangle> platforms;

public LevelContent(Texture2D background, List<RectangularObject> ros)
{
platforms = new List<Rectangle>();
this.background = background;
ros.ForEach(ro =>
platforms .Add(ro.ToRectangle()));
}


}

class Level
{
Boxing_Manager BoxingManager;
Rectangle clientBounds;
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<LevelContent> levels = new List<LevelContent>()
{
new LevelContent(
content.Load<Texture2D>("Boxing/ABBackground"),
content.Load<List<RectangularObject>>("Auctionxml")),
new LevelContent(
content.Load<Texture2D>("new"),
content.Load<List<RectangularObject>>("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)
{
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);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public StateJump(BoxingPlayer player, bool fall)
player.currentVerticalSpeed = -400;
}
canCatch = true;

canCombo = true;
}

Expand Down
2 changes: 1 addition & 1 deletion Auction_Boxing_2/Auction_Boxing_2/Auction_Boxing_2/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Game()



this.graphics.IsFullScreen = true;
//this.graphics.IsFullScreen = true;

this.graphics.PreferredBackBufferWidth = 800;
this.graphics.PreferredBackBufferHeight = 600;
Expand Down
Loading