Skip to content

Commit

Permalink
blorb stored as float again
Browse files Browse the repository at this point in the history
  • Loading branch information
benthemonkey committed Feb 21, 2015
1 parent 2835daa commit f72c179
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Assets/Base/Center.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Center : MonoBehaviour {
private const float placementOffset = 0.725f;

private float healthInternal;
private int resourcesInternal;
private float resourcesInternal;

public float speed;

Expand All @@ -28,17 +28,17 @@ public float health
}
}

public int blorbAmount
public float blorbAmount
{
//made property so updates text dynamically
get {return resourcesInternal;}
set {
int diff = value - resourcesInternal;
float diff = value - resourcesInternal;
resourcesInternal = value;
resourcePoolText.text = ((int)resourcesInternal).ToString();
GUIManager.UpdateTowerGUI(blorbAmount);

if (Mathf.Abs(diff) > 0) {
if (Mathf.Abs(diff) > 0f) {
// Add blorb indicator
GameObject g = (GameObject)Instantiate(blorbIndicator, resourcePoolText.transform.position, Quaternion.identity);
g.transform.parent = resourcePoolText.transform;
Expand Down Expand Up @@ -76,7 +76,7 @@ void GameStart () {

health = 100f;

blorbAmount = 100;
blorbAmount = 100f;
//resourcePoolText.text = resourcePool.ToString ();
collectingFromResource = false;

Expand Down Expand Up @@ -296,7 +296,7 @@ public void takeDamage(float damage)
}
}

public void receiveBlorb(int blorb)
public void receiveBlorb(float blorb)
{
blorbAmount += blorb;
//resourcePoolText.text = resourcePool.ToString ();
Expand Down
2 changes: 1 addition & 1 deletion Assets/Base/ResourceCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void ToggleResourceAttachment(){

void CollectFromResource(){
if (currentResource != null){
int extraBlorb = currentResource.collectBlorb();
float extraBlorb = currentResource.collectBlorb();
Debug.Log ("extraBlorb = " + extraBlorb.ToString() + "\n");
center.blorbAmount += extraBlorb;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Enemy/Enemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Enemy : MonoBehaviour {
public Transform healthbar;

public float hitDamage = 10.0f;
private const int killValue = 10;
private const float killValue = 10f;

private float health = 100.0f;

Expand Down
6 changes: 3 additions & 3 deletions Assets/GUI/BlorbIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ public class BlorbIndicator : MonoBehaviour {

private TextMesh textMesh;

public void setDiff (int d) {
public void setDiff (float d) {
textMesh = this.GetComponent<TextMesh>();
pos = transform.position;

if (d > 0) {
textMesh.text = "+" + d.ToString();
textMesh.text = "+" + ((int)d).ToString();
color = new Color(0f, 1f, 0f, 1f);
} else {
textMesh.text = d.ToString();
textMesh.text = ((int)d).ToString();
color = new Color(1f, 0f, 0f, 1f);
}

Expand Down

0 comments on commit f72c179

Please sign in to comment.