Implement market
This commit is contained in:
@@ -217,6 +217,29 @@ void drawGameUI(Game *game, f32 dt) {
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (building.type == BUILDING_MARKET) {
|
||||
// 50:10
|
||||
if (uiGameTrade("Buy 50 (-10 gold)##food", foodRec, tex, playerRes->gold >= 10)) {
|
||||
playerRes->food += 50;
|
||||
playerRes->gold -= 10;
|
||||
}
|
||||
// 100:10
|
||||
if (uiGameTrade("Sell 100 (+10 gold)##food", foodRec, tex, playerRes->food >= 100)) {
|
||||
playerRes->food -= 100;
|
||||
playerRes->gold += 10;
|
||||
}
|
||||
// 50:25
|
||||
if (uiGameTrade("Buy 50 (-25 gold)##wood", woodRec, tex, playerRes->gold >= 25)) {
|
||||
playerRes->wood += 50;
|
||||
playerRes->gold -= 25;
|
||||
}
|
||||
// 100:25
|
||||
if (uiGameTrade("Sell 100 (+25 gold)##wood", woodRec, tex, playerRes->wood >= 100)) {
|
||||
playerRes->wood -= 100;
|
||||
playerRes->gold += 25;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user