MCPcopy Create free account
hub / github.com/SimHacker/micropolis / generateTrain

Method generateTrain

MicropolisCore/src/MicropolisEngine/src/sprite.cpp:1831–1836  ·  view source on GitHub ↗

* Try to start a new train sprite at the given map tile. * @param x X coordinate in map coordinate. * @param y Y coordinate in map coordinate. */

Source from the content-addressed store, hash-verified

1829 * @param y Y coordinate in map coordinate.
1830 */
1831void Micropolis::generateTrain(int x, int y)
1832{
1833 if (totalPop > 20 && getSprite(SPRITE_TRAIN) == NULL && getRandom(25) == 0) {
1834 makeSprite(SPRITE_TRAIN, (x <<4) + TRA_GROOVE_X, (y <<4) + TRA_GROOVE_Y);
1835 }
1836}
1837
1838
1839/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected