Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/ted27/Human_vs_Zombies
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen Bell committed Mar 3, 2011
2 parents e0218f0 + 466abe0 commit 6f1ce8a
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 20 deletions.
Binary file added Human_vs_Zombies/DINk.ttf
Binary file not shown.
Expand Up @@ -84,6 +84,7 @@ protected override void LoadContent()
TextureStatic.Load("Wall", @"Art\Wall"); TextureStatic.Load("Wall", @"Art\Wall");
TextureStatic.Load("Shadow", @"Art\Shadow"); TextureStatic.Load("Shadow", @"Art\Shadow");
TextureStatic.Load("Ammo", @"Art\Ammo"); TextureStatic.Load("Ammo", @"Art\Ammo");
TextureStatic.Load("MenuBackground", @"Art\MenuBackground");


audio = new AudioManager(this); audio = new AudioManager(this);


Expand Down
4 changes: 2 additions & 2 deletions Human_vs_Zombies/Human_vs_Zombies/GameElements/Settings.cs
Expand Up @@ -55,8 +55,8 @@ public static class Settings
public static float itemWarningTime { get { return 5; } } public static float itemWarningTime { get { return 5; } }


public static float itemBlinkRate { get { return .5f; } } public static float itemBlinkRate { get { return .5f; } }

public static int itemMax { get { return 20; } } public static int itemMax { get { return 20; } }


public static int itemAmmo { get { return 10; } } public static int itemAmmo { get { return 10; } }
} }
Expand Down
19 changes: 13 additions & 6 deletions Human_vs_Zombies/Human_vs_Zombies/HvZClasses/HvZWorld.cs
Expand Up @@ -200,10 +200,7 @@ public void Update(float dTime)
{ {
this.SpawnZombie(); this.SpawnZombie();
} }
if (this.numItems < Settings.itemMax) this.SpawnItem();
{
this.SpawnItem();
}
zombieCountdown = Settings.zombieTimer; zombieCountdown = Settings.zombieTimer;
} }


Expand Down Expand Up @@ -266,14 +263,24 @@ public void Draw()


Drawer.DrawString( Drawer.DrawString(
"Ammo: " + this.m_Player.GetAmmo(), "Ammo: " + this.m_Player.GetAmmo(),
new Vector2(20, Settings.worldHeight-2*(Drawer.font.MeasureString("Ammo").Y)),
Color.Red,
0f,
new Vector2(0, 0), new Vector2(0, 0),
2f,
SpriteEffects.None,
1f);

String scoreString = "Score: " + this.m_Player.GetAmmo(); // OWEN: REPLACE THIS WITH GET SCORE!!!!
Drawer.DrawString(
scoreString,
new Vector2(Settings.worldWidth-2*(Drawer.font.MeasureString(scoreString).X)-20, Settings.worldHeight - 2*(Drawer.font.MeasureString("Ammo").Y)),
Color.Red, Color.Red,
0f, 0f,
new Vector2(0, 0), new Vector2(0, 0),
4f, 2f,
SpriteEffects.None, SpriteEffects.None,
1f); 1f);

foreach (Entity e in m_Entities.Values) foreach (Entity e in m_Entities.Values)
{ {


Expand Down
4 changes: 2 additions & 2 deletions Human_vs_Zombies/Human_vs_Zombies/Screens/GameOverScreen.cs
Expand Up @@ -79,7 +79,7 @@ public override void Draw()
TextureStatic.Get("background"), TextureStatic.Get("background"),
Drawer.FullScreenRectangle, Drawer.FullScreenRectangle,
null, null,
Color.White, Color.Black,
0f, 0f,
Vector2.Zero, Vector2.Zero,
SpriteEffects.None, SpriteEffects.None,
Expand All @@ -91,7 +91,7 @@ public override void Draw()
Color.Red, Color.Red,
0f, 0f,
this.textDrawOrigin, this.textDrawOrigin,
4f, 2f,
SpriteEffects.None, SpriteEffects.None,
1f); 1f);


Expand Down
16 changes: 8 additions & 8 deletions Human_vs_Zombies/Human_vs_Zombies/Screens/StartScreen.cs
Expand Up @@ -46,16 +46,16 @@ public StartScreen()
{ {
// Note: Do not use GameClock, it will be paused! // Note: Do not use GameClock, it will be paused!
this.initialTime = DateTime.Now.Ticks; this.initialTime = DateTime.Now.Ticks;
this.menu = new StartMenu( this.menu = new StartMenu(
new Vector2(1000, 330), new Vector2(Settings.worldWidth / 2, 1000 * Drawer.GetRatio()),
new MenuAction[] new MenuAction[]
{ {
new MenuAction(ActionType.GoBack, new StartGameDelegate()), new MenuAction(ActionType.GoBack, new StartGameDelegate()),
}, },
75f); 75f);


this.textDrawPosition = new Vector2(Settings.worldWidth / 2, 200); this.textDrawPosition = new Vector2(Settings.worldWidth / 2, 700*Drawer.GetRatio());
this.textDrawOrigin = Drawer.font.MeasureString("HUMAN VS ZOMBIES") / 2f; this.textDrawOrigin = Drawer.font.MeasureString("Human Vs. Zombies") / 2f;
} }


/// <summary> /// <summary>
Expand All @@ -74,10 +74,10 @@ public override void Update(float dTime)
/// </summary> /// </summary>
public override void Draw() public override void Draw()
{ {

int offset = (int)(initialTime - DateTime.Now.Ticks)/5000000;
Drawer.Draw( Drawer.Draw(
TextureStatic.Get("background"), TextureStatic.Get("MenuBackground"),
Drawer.FullScreenRectangle, new Rectangle(Math.Min(offset,300), 0, TextureStatic.Get("MenuBackground").Width, TextureStatic.Get("MenuBackground").Height),
null, null,
Color.White, Color.White,
0f, 0f,
Expand All @@ -86,7 +86,7 @@ public override void Draw()
0f); 0f);


Drawer.DrawString( Drawer.DrawString(
"HUMAN VS ZOMBIES", "HUMAN VS. ZOMBIES",
this.textDrawPosition, this.textDrawPosition,
Color.Red, Color.Red,
0f, 0f,
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Human_vs_Zombies/Human_vs_ZombiesContent/Fonts/HvZ.spritefont
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics"> <XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription"> <Asset Type="Graphics:FontDescription">
<FontName>Kootenay</FontName> <FontName>Dink</FontName>
<Size>14</Size> <Size>24</Size>
<Spacing>0</Spacing> <Spacing>0</Spacing>
<UseKerning>true</UseKerning> <UseKerning>true</UseKerning>
<Style>Regular</Style> <Style>Regular</Style>
Expand Down
Expand Up @@ -120,6 +120,13 @@
<Processor>SongProcessor</Processor> <Processor>SongProcessor</Processor>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Include="Art\MenuBackground.jpg">
<Name>MenuBackground</Name>
<Importer>TextureImporter</Importer>
<Processor>TextureProcessor</Processor>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit 6f1ce8a

Please sign in to comment.