Skip to content
Snippets Groups Projects
Commit ceeb76d6 authored by Leevi Grönlund's avatar Leevi Grönlund
Browse files

More code to resource classes

parent 3e893fb8
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,26 @@ public class BerryBush : Resource
public override void refreshSprite()
{
if (resources < 100)
{
//1 marjan sprite
}
else if (resources < 200)
{
//2 marjan sprite
}
else if (resources < 300)
{
//3 marjan sprite
}
else if (resources < 400)
{
//4 marjan sprite
}
else
{
// 5 marjan sprite
}
}
// Start is called before the first frame update
......
......@@ -16,7 +16,7 @@ public class Forest : Resource
}
else
{
growthspeed = 1;
growthspeed = 1f;
}
}
......
......@@ -2,20 +2,11 @@
using System.Collections.Generic;
using UnityEngine;
// Luokka, joka vaatii collectoreilta 100 puuta ennen kuin Quarry voidaan luoda samaan pisteeseen kartalla
public class Outcrop : Resource
{
public override void checkExistence()
{
if (resources < 1)
{
Destroy(gameObject);
}
}
public override void refreshSprite()
{
}
public override void checkExistence() { }
public override void refreshSprite() { }
// Start is called before the first frame update
void Start()
......
......@@ -13,9 +13,7 @@ public abstract class Resource : MonoBehaviour
public int getAmount()
{
//r.setAmount(ref.getAmount() - extraction);
return resources;
}
public int extractResource(int amount)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment