Oh my
days -facedesk-
Alrighty
so I been fixing a bunch of minor bugs, most of them GUI bugs I didnt think of
during the early stages. Like what happens if I just spam a button over and
over again. Turns out you lose the game terribly, or win the game also
terribly. Trying to fix all these click spam issues.
Also busy
working on deconstruction, like what happens if I swap one building with
another? Now you get a 50% refund and the other building is built. Pretty sure
I’m missing a few bugs though which haunt me still D:
Money and
population now matters in the game. You cannot build a work-building such as a
solar array or factory if you do not have enough of the required population.
Only certain refugees from certain worlds can run certain buildings. So the
idea is to get a good mixture for what kind of facility you want to run. The
idea is to have everyone from different worlds band together and help each
other to survive this terrible assault from <INSERT ENEMY NAME HERE>. You
also now can’t build anything if you can’t afford it. This money checking
method works ok, not perfect but ok for now. You can still go in the negatives.
I’m also
starting on the win/lose conditions. The win condition is reach a certain level
of population. Meaning rescue X number of refugees. I’m not sure what this
number is at the moment. I’ll focus on balancing later as those would only need
me to tweak ints here and there. I’m also spawning things super-fast to debug
so balancing is not a smart move at the moment I think.
I’ve
added a Happiness rating to my game. If you can’t accommodate a certain amount
of refugees and they leave on a ship – you have a decrement to your happiness
rating (maybe, depending on a % of an int). I’m planning to have it so that if
your happiness reaches 0 or less, you have a chance of the refugees rebelling
on you and you losing control of the station. Meaning you lose the game.
I also
wanted to have a % chance that the rebels would destroy a building based on happiness,
had it kinda working but it’s taking to much time and I got around 1-2 hours
before I have to start making assets.
My next
steps are to add defence, food and healthcare to my game. It might have to be
in a basic way for now but they’ll be there. I also need to start and finish
the upkeep/transport costs. And the grant income for money. Since at the moment
there’s no long term money making in my game. A building gives you + cash flat
out and then never again. This doesn’t work well in gameplay so I need to
change it.
Code for how my happyness works at the moment:
//*****************************************************************************************
//Making nice old school comment dividers cause my eyes are getting blurry!
//Sets the population values per worlds race
//*****************************************************************************************
public void setPop(int x, string y){
if(y == “red” && redCap != 0 && redCap >= redPop){
redPop += x;
GameObject.Find(“RedCap_Pop”).guiText.text = redPop.ToString();
}else{
if(y == “blue” && blueCap != 0 && blueCap >= bluePop){
bluePop += x;
GameObject.Find(“BlueCap_Pop”).guiText.text = bluePop.ToString();
}else{
if(y == “green” && greenCap != 0 && greenCap >= greenPop){
greenPop += x;
GameObject.Find(“GreenCap_Pop”).guiText.text = greenPop.ToString();
}else{
if(y == “yellow” && yellowCap != 0 && yellowCap >= yellowPop){
yellowPop += x;
GameObject.Find(“YellowCap_Pop”).guiText.text = yellowPop.ToString();
}else{
tempLeaveShip.SpawnNewShip();
UnHappy25(); //Because of refugees being forced off the station you bad person you!
}
}
}
}
}
//% chance of an unhappy being added to overall happyness
public void UnHappy25(){
int rndNum;
rndNum = (Random.Range(0, 40));
if(rndNum == 1){
happyRate -= 1;
}
GameObject.Find(“hppyVal”).guiText.text = happyRate.ToString();
}
Oh I also added totals for a nice overview.
Back to it!
Hobo
No comments:
Post a Comment