GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Train Train
Jasper Geurtz edited this page
Now that we are successfully gathering minerals, we need to spend them somehow. Let's train some workers when we have the minerals for them! Lets go trough all our buildings in the // Train units while we can for (Unit trainer : self.getUnits()) { UnitType unitType = trainer.getType(); if (unitType.isBuilding() && !unitType.buildsWhat().isEmpty()) { UnitType toTrain = unitType.buildsWhat().get(0); if (game.canMake(toTrain, trainer)) { trainer.train(toTrain); } } }
A cool thing is that these new workers will automatically start gathering because of the gathering code we wrote in The Finally training a unit is a simple as trainer.train(toTrain); Another more specific example would be commandCenter.train(UnitType.Terran_SCV); Our larva.morph(UnitType.Zerg_Drone); After this short example on how to train units, let's dive into how to build some Buildings! Clone this wiki locally |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |