Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
christianale12 committed Oct 2, 2024
2 parents 0f769b3 + 59a34a7 commit 81b99d4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dinoGame.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,32 @@ object reloj {

object cactus {
var property position = self.posicionInicial()
var property vel = 1
method image() = "cactus.png"
method posicionInicial() = game.at(game.width()-1,suelo.position().y())

method iniciar(){
position = self.posicionInicial()
game.onTick(velocidad,"moverCactus",{self.mover(vel)})
game.onTick(velocidad,"moverCactus",{self.mover()})
}

method mover(velocidad){
position = position.left(velocidad)
method mover(){
//position = position.left(1)
// if para saber posicion y si pasa al dino game.set a la derecha de nuevo
if(self.position()== game.at(0,1)){
position = game.at(game.width()-1,suelo.position().y())
}else position = position.left(1)
}

method chocar(){
juego.terminar()
}

method detener(){
self.vel(0)
game.removeTickEvent("moverCactus")
}
}

object suelo{

method position() = game.origin().up(1)
method image() = "suelo.png"
}
Expand All @@ -106,7 +108,9 @@ object dino {
method image() = "dino.png"

method saltar(){
self.subir()
if(self.position() == game.at(1,1)){
self.subir()
}

}

Expand All @@ -116,8 +120,9 @@ object dino {


method subir(){

position = position.up(1)
game.schedule(1000, {self.bajar()})
game.schedule(600, {self.bajar()})
}

method bajar(){
Expand All @@ -134,4 +139,5 @@ object dino {
return vivo
}


}
11 changes: 11 additions & 0 deletions log/wollok.log
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,7 @@
{"level":"info","message":"⌛ Building environment","timeElapsed":104,"timestamp":"2024-10-01T22:30:16.318Z"}
{"level":"info","message":"⌛ Validating dinoGame.wlk","timeElapsed":118,"timestamp":"2024-10-01T22:30:16.437Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":13964,"timestamp":"2024-10-01T22:30:56.617Z"}
<<<<<<< HEAD
>>>>>>> 3db30007eb019775aa6ab7606649ad33c201fa1b
{"level":"info","message":"⌛ Building environment","timeElapsed":1436,"timestamp":"2024-10-02T19:47:47.277Z"}
{"level":"error","message":"✘ Failed to rebuild document Missing workspace folder!","stack":"Error: Missing workspace folder!\n at DL (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:2288:2250)\n at b3.invoke (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:3:157188)\n at o.fire (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:3:157958)\n at c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:37:57488\n at Br (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:8:1561)\n at Pt (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:7:6224)\n at Gi (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:7:6378)\n at Immediate._onImmediate (c:\\Users\\Pamela-PC\\.vscode\\extensions\\uqbar.wollok-lsp-ide-0.3.5\\out\\server\\src\\server.js:7:6142)\n at process.processImmediate (node:internal/timers:476:21)","timestamp":"2024-10-02T19:47:47.394Z"}
Expand Down Expand Up @@ -1992,3 +1993,13 @@
{"level":"info","message":"⌛ Validating mainExample.wpgm","timeElapsed":273,"timestamp":"2024-10-02T19:57:38.252Z"}
{"level":"info","message":"⌛ Validating dinoGame.wlk","timeElapsed":485,"timestamp":"2024-10-02T19:57:38.794Z"}
{"level":"info","message":"⌛ Validating dino.wtest","timeElapsed":346,"timestamp":"2024-10-02T19:57:39.152Z"}
=======
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":14185,"timestamp":"2024-10-01T23:39:46.676Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":7431,"timestamp":"2024-10-01T23:39:56.537Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":16696,"timestamp":"2024-10-01T23:40:54.288Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":13948,"timestamp":"2024-10-01T23:42:34.971Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":29806,"timestamp":"2024-10-01T23:43:43.401Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":24000,"timestamp":"2024-10-01T23:47:28.266Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":31927,"timestamp":"2024-10-01T23:49:39.369Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed mainExample.DinoGame on /home/infolab/Descargas/dino2-drimteam","timeElapsed":31119,"timestamp":"2024-10-01T23:54:51.519Z"}
>>>>>>> 59a34a71442f2c38c936e6051db8e8ffa095e3b7

0 comments on commit 81b99d4

Please sign in to comment.