Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. extern void object::inwazja1()
  2. {
  3. int time=60;
  4. message("10 minut do aktywowania trybu przetrwania");
  5. wait(600);
  6. message("Tryb przetrwania aktywowany");
  7. while(true)
  8. {
  9. SpawnAnt(); // Spawnuj mrowke
  10. wait(time); // czekaj time
  11. time=time-0.1; // Odejmij 0.1 s do time
  12. if(time < 12) time=12; // Sprawdzaj czy time wynosi 12 sek. Jezeli ponizej to ustaw time na 12 sek.
  13. }
  14. }
  15. void object::SpawnAnt()
  16. {
  17. // Pick a side of the map to spawn near
  18.  
  19. int side = rand() * 4; // 0=left, 1=top, 2=right, 3=bottom
  20.  
  21. // Pick a location
  22.  
  23. int d1 = rand() * 550 - 275; // -275..275
  24. int d2 = rand() * 50 + 125; // 125..175
  25.  
  26. // Turn that into a position
  27.  
  28. point pos;
  29. if (side == 0)
  30. { pos.y = d1; pos.x = -400 + d2; }
  31. else if (side == 1)
  32. { pos.x = d1; pos.y = 400 - d2; }
  33. else if (side == 2)
  34. { pos.y = d1; pos.x = 400 - d2; }
  35. else
  36. { pos.x = d1; pos.y = -400 + d2; }
  37. pos.z = topo(pos);
  38.  
  39. // Produce an ant here
  40.  
  41. produce (pos, 0, AlienAnt, "antattsw1.txt");
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement