Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. stage {
  2. backdrop White("gallery:General/White")
  3. let puzzle = 0;
  4. let sum = 0;
  5. let point = 0;
  6. let open = true;
  7.  
  8. when started{
  9. this.showVariable(ref this.puzzle);
  10. this.showVariable(ref this.sum);
  11. this.showVariable(ref this.point);
  12. this.puzzle = Math.randomBetween(1, 100);
  13. while(true){
  14. if(this.sum == this.puzzle){
  15. this.puzzle = this.Math.randomBetween(1,100);
  16. this.sum = 0;
  17. this.point++;
  18. }
  19. if(this.sum > this.puzzle){
  20. this.puzzle = this.Math.randomBetween(1,100);
  21. this.sum = 0;
  22. }
  23. }
  24. }
  25.  
  26. actor Kincsesláda {
  27. costume Nyitva("gallery:Objects/Coffer Open")
  28. costume Zárva("gallery:Objects/Coffer Closed")
  29. }
  30.  
  31. actor Szám {
  32. costume Nulla("gallery:Text/Zero")
  33. costume Egy("gallery:Text/One")
  34. costume Kettő("gallery:Text/Two")
  35. costume Három("gallery:Text/Three")
  36. costume Négy("gallery:Text/Four")
  37. costume Öt("gallery:Text/Five")
  38. costume Hat("gallery:Text/Six")
  39. costume Hét("gallery:Text/Seven")
  40. costume Nyolc("gallery:Text/Eight")
  41. costume Kilenc("gallery:Text/Nine")
  42.  
  43. function start(){
  44. this.hide();
  45. this.setPosition(Math.randomBetween(-200, 200), 150);
  46. this.setCostume(Math.randomBetween(1,9));
  47. this.show();
  48. }
  49. when stage.started{
  50. this.start();
  51. this.physics.collisionShape = "polygon";
  52. while(true){
  53. this. y -= 5;
  54. if(this.touching(Kincsesláda)){
  55. if(open){
  56. sum += this.costumeId;
  57. }
  58. this.start();
  59. }
  60. this.wait(0.05);
  61. if(this.y < -150){
  62. this.start();
  63. }
  64. }
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement