Advertisement
NeoGriever

Untitled

Jun 29th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. var rotationDirection = 1;
  2. var rotationSpeed = 0;
  3. var rotationMultiplier = 1;
  4.  
  5. onLaunch () {
  6. rotationDirection = (Rand(0, 1))?1:-1; // entweder/oder
  7. rotationSpeed = 0; // beim launch keine rotation
  8. rotationMultiplier = 1; // standard
  9. }
  10. onBounce () {
  11. rotationDirection = (Rand(0, 1))?1:-1; // entweder/oder
  12. rotationSpeed = Rand(6, 15);
  13. rotationMultiplier += 0.2;
  14. }
  15. onFrame () {
  16. rotation = rotationDirection * (rotationSpeed * rotationMultiplier);
  17. }
  18.  
  19. Beispiel:
  20.  
  21. rotation kann zwischen -15 bis -6 und 6 bis 15 sein ... da negativ/positiv separat definiert ist :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement