Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bludman/Zombie_Quest
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellasry committed Dec 17, 2010
2 parents 8d346dd + 0201d31 commit 4518e9e
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 7 deletions.
Binary file added assets/png/cop2_frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/png/cop3_frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/png/cop_frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion obj/ZombieQuestConfig.old
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'12/15/2010'</value>
<value>'12/17/2010'</value>
</define>
<source-path append="true">
<path-element>C:\Users\Ceemit\Desktop\Zombie_Quest\src</path-element>
Expand Down
2 changes: 1 addition & 1 deletion obj/ZombieQuestConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'12/15/2010'</value>
<value>'12/17/2010'</value>
</define>
<source-path append="true">
<path-element>C:\Users\Ceemit\Desktop\Zombie_Quest\src</path-element>
Expand Down
3 changes: 2 additions & 1 deletion src/com/zombiequest/EndState.as
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ package com.zombiequest
else
inst += " brains.\n"

inst += "Your total survival time was " + StartLevelState.generateClock();
inst += "Your total survival time was " + StartLevelState.generateClock() + "\n";
inst += "Your score is " + StartLevelState.calculateScore();
var instText:FlxText = new FlxText(200, 200, 200, inst);
instText.color = 0xff000000;
add(instText);
Expand Down
18 changes: 14 additions & 4 deletions src/com/zombiequest/HUDMaker.as
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ package com.zombiequest

private var clock:FlxText;

private var score:FlxText;

private var statusText:FlxText;
private var statusBox:FlxSprite;
private var timer:FlxText;
Expand Down Expand Up @@ -52,18 +54,18 @@ package com.zombiequest
healthBar.scale.x = HEALTHBARSIZE; //Fill up the health bar all the way
StartLevelState.overGroup.add(healthBar);

bigBrain = new FlxSprite(514,4);
bigBrain = new FlxSprite(514,2);
bigBrain.loadGraphic(BigBrain, false, false, 38, 31);
bigBrain.scrollFactor.x = bigBrain.scrollFactor.y = 0;
bigBrain.origin.x = bigBrain.origin.y = 0;
StartLevelState.overGroup.add(bigBrain);

bigBrainCount = new FlxText(552, 12, 64);
bigBrainCount = new FlxText(552, 10, 64);
bigBrainCount.scrollFactor.x = bigBrainCount.scrollFactor.y = 0;
bigBrainCount.size = 10;
StartLevelState.overGroup.add(bigBrainCount);

smallBrain = new FlxSprite(582,8);
smallBrain = new FlxSprite(582,6);
smallBrain.loadGraphic(SmallBrain, false, false, 27, 22);
smallBrain.scrollFactor.x = smallBrain.scrollFactor.y = 0;
smallBrain.origin.x = smallBrain.origin.y = 0;
Expand All @@ -74,11 +76,18 @@ package com.zombiequest
smallBrainCount.size = 10;
StartLevelState.overGroup.add(smallBrainCount);

clock = new FlxText(320, 4, 40);
clock = new FlxText(250, 2, 100);
clock.color = 0x00ffffff;
clock.scrollFactor.x = clock.scrollFactor.y = 0;
clock.size = 14;
StartLevelState.overGroup.add(clock);

score = new FlxText(380, 2, 200)
score.color = 0x00ffffff;
score.scrollFactor.x = score.scrollFactor.y = 0;
score.size = 14;
StartLevelState.overGroup.add(score);

statusBox = new FlxSprite(0, 460);
statusBox.scrollFactor.x = statusBox.scrollFactor.y = 0;
StartLevelState.overGroup.add(statusBox);
Expand Down Expand Up @@ -118,6 +127,7 @@ package com.zombiequest
bigBrainCount.text = "x " + StartLevelState.playerBrainCount;
smallBrainCount.text = "x " + StartLevelState.minionBrainCount;
clock.text = StartLevelState.generateClock();
score.text = "Score: " + StartLevelState.calculateScore();
}
}
}
29 changes: 29 additions & 0 deletions src/com/zombiequest/MenuState.as
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@ package com.zombiequest
public class MenuState extends FlxState
{
private var _startButton:FlxButton;

[Embed(source = "../../../assets/png/cop_frame.png")]
private var REnemy:Class;
private var enemy1:FlxSprite;

[Embed(source = "../../../assets/png/cop2_frame.png")]
private var FEnemy:Class;
private var enemy2:FlxSprite;

[Embed(source = "../../../assets/png/cop3_frame.png")]
private var CEnemy:Class;
private var enemy3:FlxSprite;

override public function create():void
{
bgColor = 0xFFD3D3D3;
createButtons();
createInstructions();
createEnemyKey();
FlxG.mouse.show();
super.create();
}
Expand Down Expand Up @@ -45,6 +59,21 @@ package com.zombiequest

}

private function createEnemyKey():void
{
enemy1 = new FlxSprite(190, 250);
enemy1.loadGraphic(REnemy);
add(enemy1);

enemy2 = new FlxSprite(190, 280);
enemy2.loadGraphic(FEnemy);
add(enemy2);

enemy3 = new FlxSprite(190, 310);
enemy3.loadGraphic(CEnemy);
add(enemy3);
}

private function loadStartLevel():void
{
FlxG.state = new StartLevelState();
Expand Down
7 changes: 7 additions & 0 deletions src/com/zombiequest/StartLevelState.as
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ package com.zombiequest
return displayClock;
}

public static function calculateScore():String
{
var score:Number = (200 * playerBrainCount) + (minionBrainCount * 100) + (Math.floor(playClock) * 10);

return score.toString();
}

/* This must be done to render the HUD above all else */
override public function render():void
{
Expand Down

0 comments on commit 4518e9e

Please sign in to comment.