Skip to content

Commit

Permalink
Merge branch 'main' of github.com:algo1unsam/dino2-offline-dino
Browse files Browse the repository at this point in the history
  • Loading branch information
Gazzty committed Oct 1, 2024
2 parents 146acb4 + 8662412 commit 5a95faf
Show file tree
Hide file tree
Showing 6 changed files with 2,322 additions and 9 deletions.
Empty file added .github/.keep
Empty file.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
## example

TODO

- pasarTiempo // Gus
- detener tiempo // Gus
- mover // Juanpi
- chocar // Juanpi
- detener cactus // Seba
- saltar // Seba
17 changes: 11 additions & 6 deletions dinoGame.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const velocidad = 250
object juego{

method configurar(){
game.width(12)
game.width(18)
game.height(8)
game.title("Dino Game")
game.boardGround("fondo.png")
Expand All @@ -18,7 +18,7 @@ object juego{
keyboard.space().onPressDo{ self.jugar()}
game.onCollideDo(dino,{ obstaculo => obstaculo.chocar()})

}
}

method iniciar(){
dino.iniciar()
Expand Down Expand Up @@ -72,16 +72,18 @@ object cactus {
var property position = self.posicionInicial()

method image() = "cactus.png"
method posicionInicial() = game.at(game.width()-1,suelo.position().y())
method posicionInicial() = game.at(11,suelo.position().y())

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

method mover(){
//COMPLETAR
}
position = position.left(1)
if (position.x() < 0)
position = game.at(11,suelo.position().y())
}

method chocar(){
//COMPLETAR
Expand All @@ -105,7 +107,10 @@ object dino {
method image() = "dino.png"

method saltar(){
//COMPLETAR
self.subir()
game.schedule(reloj.tiempo() + 100, {self.subir()})
game.schedule(reloj.tiempo() + 200, {self.bajar()})
game.schedule(reloj.tiempo() + 300, {self.bajar()})
}

method subir(){
Expand Down
2,029 changes: 2,029 additions & 0 deletions log/wollok.log

Large diffs are not rendered by default.

Loading

0 comments on commit 5a95faf

Please sign in to comment.