Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern void object::inwazja1()
- {
- int time=60;
- message("10 minut do aktywowania trybu przetrwania");
- wait(600);
- message("Tryb przetrwania aktywowany");
- while(true)
- {
- SpawnAnt(); // Spawnuj mrowke
- wait(time); // czekaj time
- time=time-0.1; // Odejmij 0.1 s do time
- if(time < 12) time=12; // Sprawdzaj czy time wynosi 12 sek. Jezeli ponizej to ustaw time na 12 sek.
- }
- }
- void object::SpawnAnt()
- {
- // Pick a side of the map to spawn near
- int side = rand() * 4; // 0=left, 1=top, 2=right, 3=bottom
- // Pick a location
- int d1 = rand() * 550 - 275; // -275..275
- int d2 = rand() * 50 + 125; // 125..175
- // Turn that into a position
- point pos;
- if (side == 0)
- { pos.y = d1; pos.x = -400 + d2; }
- else if (side == 1)
- { pos.x = d1; pos.y = 400 - d2; }
- else if (side == 2)
- { pos.y = d1; pos.x = 400 - d2; }
- else
- { pos.x = d1; pos.y = -400 + d2; }
- pos.z = topo(pos);
- // Produce an ant here
- produce (pos, 0, AlienAnt, "antattsw1.txt");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement