-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
creamos el juego homero para que se mueva de izq a derecha y agarre l…
…a rosquilla y la banana y le aplicamos un fondo. Co-authored-by: MatttiB <[email protected]>
- Loading branch information
1 parent
d307f31
commit 5dadcb9
Showing
10 changed files
with
103 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
# (reemplazar nombre de juego acá) | ||
# El Sueño del Levantapalas: La Carrera por el Morfi | ||
|
||
UTN - Facultad Regional Buenos Aires - Materia Paradigmas de Programación | ||
|
||
## Equipo de desarrollo: | ||
|
||
- completar... | ||
- completar... | ||
- Bermejo Fernández, Matías. | ||
- Corro Molas, Agustin. | ||
- Britos, Aylen. | ||
- Dimotta, Cecilia. | ||
- Giangrandi, Agostino. | ||
|
||
|
||
## Capturas | ||
|
||
![pepita](assets/golondrina.png) | ||
![homeroGame](image.png) | ||
|
||
## Reglas de Juego / Instrucciones | ||
|
||
(completar...) | ||
|
||
## Controles: | ||
|
||
- `W` para... | ||
- `A` para moverse a la izquierda. | ||
- `D` para moverse a la derecha. | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import wollok.game.* | ||
|
||
object puntosHomero { | ||
const hom = homero | ||
const position = new MutablePosition(x=7, y=9) | ||
|
||
method position() = position | ||
|
||
method text () = "Puntos: " + hom.puntos() + " Velocidad: " + hom.velocidad() | ||
|
||
} | ||
|
||
object homero{ | ||
var puntos = 0 | ||
var velocidad = 1 | ||
const position = new MutablePosition(x=7, y=0) | ||
|
||
method image() = "homero.png" | ||
method position() = position | ||
|
||
method moverseIzquierda(){ | ||
position.goLeft(velocidad) | ||
} | ||
|
||
method moverseDerecha(){ | ||
position.goRight(velocidad) | ||
} | ||
|
||
method alterarPuntos(nuevosPuntos){ | ||
puntos += nuevosPuntos | ||
puntos = puntos.max(0) | ||
} | ||
|
||
method alterarVelocidad(nuevaVelocidad){ | ||
velocidad += nuevaVelocidad | ||
velocidad = velocidad.max(1) | ||
} | ||
|
||
method puntos() = puntos | ||
|
||
method velocidad() = velocidad | ||
} | ||
|
||
class Rosquilla { | ||
const position = new MutablePosition(x=0, y=0) | ||
const puntos = 10 | ||
const velocidad = 1 | ||
|
||
method position() = position | ||
method image() = "rosquilla.png" | ||
method puntos () = puntos | ||
method velocidad () = velocidad | ||
} | ||
|
||
class Banana { | ||
const position = new MutablePosition(x=game.width()-2, y=0) | ||
const puntos = -5 | ||
const velocidad = -1 | ||
|
||
method position() = position | ||
method image() = "banana.png" | ||
method puntos () = puntos | ||
method velocidad () = velocidad | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
import wollok.game.* | ||
|
||
import pepita.* | ||
import homero.* | ||
|
||
program PepitaGame { | ||
game.title("Pepita") | ||
|
||
program homeroGame{ | ||
game.title("Homero") | ||
game.height(10) | ||
game.width(10) | ||
game.width(15) | ||
game.cellSize(100) | ||
|
||
game.addVisual(pepita) | ||
const rosquilla = new Rosquilla() | ||
const banana = new Banana() | ||
|
||
game.boardGround("springfield.png") | ||
game.addVisual(puntosHomero) | ||
game.addVisual(homero) | ||
game.addVisual(rosquilla) | ||
game.addVisual(banana) | ||
|
||
game.onCollideDo(homero, {rosquilla => homero.alterarPuntos(rosquilla.puntos())}) | ||
game.onCollideDo(homero, {rosquilla => homero.alterarVelocidad(rosquilla.velocidad())}) | ||
game.onCollideDo(homero, {rosquilla => game.removeVisual(rosquilla)}) | ||
game.onCollideDo(homero, {banana => homero.alterarPuntos(banana.puntos())}) | ||
game.onCollideDo(homero, {banana => homero.alterarVelocidad(banana.velocidad())}) | ||
game.onCollideDo(homero, {banana => game.removeVisual(banana)}) | ||
|
||
|
||
keyboard.w().onPressDo({ pepita.fly(1) }) | ||
keyboard.a().onPressDo({ homero.moverseIzquierda()}) | ||
keyboard.d().onPressDo({ homero.moverseDerecha()}) | ||
|
||
game.start() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import pepita.* | ||
import homero.* | ||
import wollok.game.* | ||
|
||
describe "group of tests for pepita" { | ||
|
||
test "pepita has initial energy" { | ||
assert.equals(100, pepita.energy()) | ||
describe "homero" { | ||
test "tests para el game de homero" { | ||
|
||
} | ||
|
||
} |