Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lefo777 committed Oct 1, 2024
2 parents 93f1602 + 544f17e commit 19a9143
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
10 changes: 5 additions & 5 deletions dinoGame.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ object juego{
game.addVisual(dino)
game.addVisual(reloj)

keyboard.s().onPressDo{reloj.detener()}
keyboard.space().onPressDo{ self.jugar()}
game.onCollideDo(dino,{ obstaculo => obstaculo.chocar()})

}

method iniciar(){
Expand All @@ -31,17 +30,16 @@ object juego{
dino.saltar()
else {
game.removeVisual(gameOver)
//self.iniciar()
reloj.detener()
self.iniciar()
}

}

method terminar(){
game.addVisual(gameOver)
reloj.tiempo(0)
cactus.detener()
reloj.detener()
dino.morir()
}

}
Expand Down Expand Up @@ -92,6 +90,7 @@ object cactus {
}
method detener(){

game.removeTickEvent("moverCactus")
}
}

Expand Down Expand Up @@ -127,6 +126,7 @@ object dino {
}
method morir(){
game.say(self,"¡Auch!")
juego.terminar()
vivo = false
}
method iniciar() {
Expand Down
20 changes: 20 additions & 0 deletions log/wollok1.log
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,23 @@
{"level":"info","message":"⌛ Validating dinoGame.wlk","timeElapsed":176,"timestamp":"2024-10-01T22:32:40.117Z"}
{"level":"info","message":"⌛ Validating dinoGame.wlk","timeElapsed":178,"timestamp":"2024-10-01T22:32:40.295Z"}
{"level":"info","message":"⌛ Validating dinoGame.wlk","timeElapsed":175,"timestamp":"2024-10-01T22:32:40.472Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":23774,"timestamp":"2024-10-01T23:03:32.846Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":115835,"timestamp":"2024-10-01T23:05:59.530Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":49125,"timestamp":"2024-10-01T23:06:49.743Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":5997,"timestamp":"2024-10-01T23:06:56.771Z"}
{"error":["wollok.lang.EvaluationError wrapping TypeScript TypeError: dinoGame.gameOver"," at dinoGame.juego.terminar() [dinoGame.wlk:40]\r"," at dinoGame.dino.iniciar() [dinoGame.wlk:129]\r"," at dinoGame.juego.iniciar() [dinoGame.wlk:23]\r"," at mainExample.DinoGame [mainExample.wpgm:4]"],"level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","ok":false,"timeElapsed":499,"timestamp":"2024-10-01T23:07:19.550Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":24142,"timestamp":"2024-10-01T23:07:43.192Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":52427,"timestamp":"2024-10-01T23:10:07.971Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":50619,"timestamp":"2024-10-01T23:11:00.880Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":99245,"timestamp":"2024-10-01T23:12:41.466Z"}
{"error":["Error: Failed to parse dinoGame.wlk: ","-- PARSING FAILED --------------------------------------------------"," 44 | reloj.detener()"," 45 | dino.morir()","> 46 | }"," | ^"," 47 | "," 48 | }","Expected one of the following: ","'@', 'class', 'const', 'describe', 'mixin', 'object', 'only', 'package', 'program', 'test', 'var', '{', EOF, comment, not \"}\r","\", whitespace"," at C:\\Users\\gazzty\\AppData\\Roaming\\npm\\node_modules\\wollok-ts-cli\\node_modules\\wollok-ts\\dist\\index.js:54:19"," at Array.map (<anonymous>)"," at buildEnvironment (C:\\Users\\gazzty\\AppData\\Roaming\\npm\\node_modules\\wollok-ts-cli\\node_modules\\wollok-ts\\dist\\index.js:49:40)"," at buildEnvironmentForProject (C:\\Users\\gazzty\\AppData\\Roaming\\npm\\node_modules\\wollok-ts-cli\\build\\src\\utils.js:72:49)"," at async buildEnvironmentForProgram (C:\\Users\\gazzty\\AppData\\Roaming\\npm\\node_modules\\wollok-ts-cli\\build\\src\\commands\\run.js:240:23)"," at async Command.default_1 (C:\\Users\\gazzty\\AppData\\Roaming\\npm\\node_modules\\wollok-ts-cli\\build\\src\\commands\\run.js:65:29)"," at async Command.parseAsync (C:\\Users\\gazzty\\AppData\\Roaming\\npm\\node_modules\\wollok-ts-cli\\node_modules\\commander\\lib\\command.js:936:5"],"level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","ok":false,"timeElapsed":144,"timestamp":"2024-10-01T23:12:43.070Z"}
{"exitCode":0,"level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":150,"timestamp":"2024-10-01T23:12:43.074Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":47921,"timestamp":"2024-10-01T23:15:14.430Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":18591,"timestamp":"2024-10-01T23:15:43.638Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":51417,"timestamp":"2024-10-01T23:19:56.764Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":19707,"timestamp":"2024-10-01T23:20:27.806Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":18495,"timestamp":"2024-10-01T23:22:00.604Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":14274,"timestamp":"2024-10-01T23:23:24.818Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":31097,"timestamp":"2024-10-01T23:25:58.341Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":63668,"timestamp":"2024-10-01T23:27:03.795Z"}
{"exitCode":"SIGINT","level":"info","message":"👾 Game executed mainExample.DinoGame on D:\\UNSAM\\Algoritmos\\unsam-algoritmos-1-2024s2-dino2-dinoGame","timeElapsed":13368,"timestamp":"2024-10-01T23:27:18.482Z"}
4 changes: 2 additions & 2 deletions mainExample.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import wollok.game.*
import dinoGame.*

program DinoGame {
juego.configurar()
juego.iniciar()
juego.configurar()
game.showAttributes(dino) //Debug
keyboard.c().onPressDo({game.say(dino, reloj.tiempo().toString())})
game.start()
game.start()
}

0 comments on commit 19a9143

Please sign in to comment.