Skip to content

Commit

Permalink
Juego simplificado: saco los colliders y los arbustos
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed May 25, 2024
1 parent 0b93adf commit 02ff078
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ Wollok Game automáticamente va a hacer que Héctor le diga eso al usuario.

## Demo

![demo](./videos/demo.gif)
![demo](./videos/demoFarmville.gif)
30 changes: 0 additions & 30 deletions arbustos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,7 @@ class Arbusto {

method dibujar() {
game.addVisual(self)
game.whenCollideDo(self, { granjero => self.empuja(granjero) })
}

method image() = "fence02.png"
method empuja(granjero)
}

class ArbustoArriba inherits Arbusto {

override method empuja(granjero) {
granjero.position(granjero.position().down(1))
}
}

class ArbustoAbajo inherits Arbusto {

override method empuja(granjero) {
granjero.position(granjero.position().up(1))
}
}

class ArbustoIzquierda inherits Arbusto {

override method empuja(granjero) {
granjero.position(granjero.position().right(1))
}
}

class ArbustoDerecha inherits Arbusto {

override method empuja(granjero) {
granjero.position(granjero.position().left(1))
}
}
10 changes: 10 additions & 0 deletions log/wollok.log
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@
{"level":"info","message":"onRequest - STRONG_FILES_CHANGED:/home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame/video","timestamp":"2024-05-25T21:53:19.059Z"}
{"level":"info","message":"onRequest - WORKSPACE_URI:file:///home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame","timestamp":"2024-05-25T21:53:19.340Z"}
{"level":"info","message":"Removing diagnostics from /home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame/video","timestamp":"2024-05-25T21:53:19.482Z"}
{"level":"info","message":"⌛ Building environment","timeElapsed":295,"timestamp":"2024-05-25T21:55:49.709Z"}
{"level":"info","message":"onRequest - WORKSPACE_URI:file:///home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame","timestamp":"2024-05-25T21:55:49.719Z"}
{"level":"info","message":"⌛ Building environment","timeElapsed":133,"timestamp":"2024-05-25T21:55:49.854Z"}
{"level":"info","message":"⌛ Building environment","timeElapsed":101,"timestamp":"2024-05-25T21:55:49.957Z"}
{"level":"info","message":"⌛ Building environment","timeElapsed":116,"timestamp":"2024-05-25T21:55:50.074Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed pgmGame.farmville on /home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame","timeElapsed":648220,"timestamp":"2024-05-25T22:02:15.391Z"}
{"level":"info","message":"onRequest - completionItem/resolve","timestamp":"2024-05-25T22:04:40.019Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed pgmGame.farmville on /home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame","timeElapsed":118864,"timestamp":"2024-05-25T22:09:02.088Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed pgmGame.farmville on /home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame","timeElapsed":249959,"timestamp":"2024-05-25T22:13:12.255Z"}
{"exitCode":"SIGHUP","level":"info","message":"👾 Game executed pgmGame.farmville on /home/dodain/workspace/wollok-dev/wollok-workspace/migracion-proyectos/farmvilleGame","timeElapsed":155046,"timestamp":"2024-05-25T22:15:47.504Z"}
8 changes: 4 additions & 4 deletions nivel.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ method configurate(){
const ancho = game.width() - 1
const largo = game.height() - 1

(1 .. ancho-1).forEach { n => new ArbustoAbajo(position = new Position(x = n, y = 0)).dibujar() } // bordeAbajo
(1 .. ancho-1).forEach { n => new ArbustoArriba(position = new Position(x =n, y = largo)).dibujar() } // bordeArriba
(0 .. largo).forEach { n => new ArbustoIzquierda(position = new Position(x =0, y = n)).dibujar() } // bordeIzq
(0 .. largo).forEach { n => new ArbustoDerecha(position = new Position(x =ancho, y = n)).dibujar() } // bordeDer
(1 .. ancho-1).forEach { n => new Arbusto(position = new Position(x = n, y = 0)).dibujar() } // bordeAbajo
(1 .. ancho-1).forEach { n => new Arbusto(position = new Position(x =n, y = largo)).dibujar() } // bordeArriba
(0 .. largo).forEach { n => new Arbusto(position = new Position(x =0, y = n)).dibujar() } // bordeIzq
(0 .. largo).forEach { n => new Arbusto(position = new Position(x =ancho, y = n)).dibujar() } // bordeDer

// TECLADO
keyboard.m().onPressDo { granjero.plantaMaiz() }
Expand Down
Binary file removed videos/demo.gif
Binary file not shown.
Binary file added videos/demoFarmville.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 02ff078

Please sign in to comment.