qqwref

Toast League - Bouncy platform test

May 8th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. function bouncyPlatform(x, y, z, w, h, d, color) {
  2. platform3D(x, y, z, w, h, d, color);
  3. if (player.pos[0] >= x && player.pos[0] <= x+w && player.pos[1] >= y && player.pos[1] <= y+h && player.vel[2] > 0 && player.pos[2] + player.vel[2] > (z-1)) {
  4. player.vel[2] = -player.vel[2] - 0.05;
  5. }
  6. }
  7.  
  8. platform3D(-50, -50, 0, 100, 100, 3, color(0, 255, 0, 1));
  9. platform3D(0, 40, -8, 10, 10, 1, color(0, 255, 0, 1));
  10. platform3D(0, 40, -16, 10, 10, 1, color(0, 255, 0, 1));
  11. platform3D(0, 40, -24, 10, 10, 1, color(0, 255, 0, 1));
  12. platform3D(0, 40, -32, 10, 10, 1, color(0, 255, 0, 1));
  13. platform3D(0, 180, -32, 10, 10, 1, color(0, 255, 0, 1));
  14. bouncyPlatform(-50, 50, 0, 100, 100, 3, color(0, 0, 255, 1));
  15.  
  16.  
  17. [["checkpoint", 0, 0, 0, false],
  18. ["checkpoint", 5, 185, -32, false]]
Advertisement
Add Comment
Please, Sign In to add comment