Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop White("gallery:General/White")
- let puzzle = 0;
- let sum = 0;
- let point = 0;
- let open = true;
- when started{
- this.showVariable(ref this.puzzle);
- this.showVariable(ref this.sum);
- this.showVariable(ref this.point);
- this.puzzle = Math.randomBetween(1, 100);
- while(true){
- if(this.sum == this.puzzle){
- this.puzzle = this.Math.randomBetween(1,100);
- this.sum = 0;
- this.point++;
- }
- if(this.sum > this.puzzle){
- this.puzzle = this.Math.randomBetween(1,100);
- this.sum = 0;
- }
- }
- }
- actor Kincsesláda {
- costume Nyitva("gallery:Objects/Coffer Open")
- costume Zárva("gallery:Objects/Coffer Closed")
- }
- actor Szám {
- costume Nulla("gallery:Text/Zero")
- costume Egy("gallery:Text/One")
- costume Kettő("gallery:Text/Two")
- costume Három("gallery:Text/Three")
- costume Négy("gallery:Text/Four")
- costume Öt("gallery:Text/Five")
- costume Hat("gallery:Text/Six")
- costume Hét("gallery:Text/Seven")
- costume Nyolc("gallery:Text/Eight")
- costume Kilenc("gallery:Text/Nine")
- function start(){
- this.hide();
- this.setPosition(Math.randomBetween(-200, 200), 150);
- this.setCostume(Math.randomBetween(1,9));
- this.show();
- }
- when stage.started{
- this.start();
- this.physics.collisionShape = "polygon";
- while(true){
- this. y -= 5;
- if(this.touching(Kincsesláda)){
- if(open){
- sum += this.costumeId;
- }
- this.start();
- }
- this.wait(0.05);
- if(this.y < -150){
- this.start();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement