Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. void onLevelLoad() {
  2. jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON] + 2]; //the rain "bubble"
  3. for (uint i = 0; i < anim.frameCount; ++i) {
  4. jjANIMFRAME@ frame = jjAnimFrames[anim + i];
  5. jjPIXELMAP rain(2,32);
  6. for (uint y = 0; y < rain.height; ++y) {
  7. if (y <= 24) {
  8. rain[0,y] = 75;
  9. }
  10. else {
  11. rain[0,y] = 74;
  12. }
  13. }
  14. rain.save(frame);
  15. frame.hotSpotX = -frame.width/2;
  16. frame.hotSpotY = -frame.height;
  17. }
  18. }
  19.  
  20. void onMain() {
  21. for (int i = 0; i < 1024; i++) { //loop through the global array jjParticles[1024]
  22. jjPARTICLE@ particle = jjParticles[i];
  23. if (particle.type == PARTICLE::RAIN) {
  24. particle.xSpeed = 0; //make rain fall straight down
  25. particle.ySpeed = jjLocalPlayers[0].ySpeed < 0? 10 : int(10 + jjLocalPlayers[0].ySpeed); //the rain speed accounts for differences in the player speed, and so won't appear to fall more slowly when the player is falling
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement