Skip to content

Commit

Permalink
Agrego nuevas imagenes y cambio algunos nombres
Browse files Browse the repository at this point in the history
  • Loading branch information
IsiAliEmir committed Oct 23, 2024
1 parent c4c6dfd commit fd8cac8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
File renamed without changes
Binary file removed assets/brasil.png
Binary file not shown.
File renamed without changes
Binary file added assets/gaseosa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/golondrina.png
Binary file not shown.
Binary file modified assets/pitch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions main.wpgm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import wollok.game.*
import objects.*

program PepitaGame {
program FulbotGame {
game.title("Fulbot")
game.boardGround("pitch.jpg")
game.height(100)
Expand All @@ -10,26 +10,27 @@ program PepitaGame {

//OBJETOS

const jugador1 = new Jugador( cansancio = 0, imagen = "brasil2.png")
const jugador2 = new Jugador( cansancio = 0, imagen = "jugadorsito.png")
const golondrina = new Consumible( energia = 30, imagen = "golondrina.png")
const jugador1 = new Jugador( cansancio = 0, imagen = "brasilero.png")
const jugador2 = new Jugador( cansancio = 0, imagen = "argentino.png")
const gaseosa = new Consumible( energia = 30, imagen = "gaseosa.png")

//VISUALS

game.addVisual(jugador1)
game.addVisual(jugador2)
game.addVisual(golondrina)
game.addVisual(gaseosa)

//EVENTOS

game.whenCollideDo(golondrina, { elemento =>
game.whenCollideDo(gaseosa, { elemento =>
game.say(elemento,elemento.hablar())
elemento.recuperarEnergia(golondrina.energia())
elemento.recuperarEnergia(gaseosa.energia())
}) //AÑADIR UN REMOVE PARA EL VISUAL.

//TENEMOS QUE HACER QUE CUANDO PASE CIERTA CANTIDAD DE TICKS EL ITEM REAPAREZCA, Y QUE CON LA COLISION DESAPAREZCA.
game.onTick(10000, "movimiento", { golondrina.movete() })
game.onTick(10000, "movimiento", { gaseosa.movete() })
game.onTick(1000, "movimiento", { jugador1.recuperarEnergia(10) })
game.onTick(1000, "movimiento", { jugador2.recuperarEnergia(10) })

keyboard.w().onPressDo({ jugador1.moverteArriba(5) })
keyboard.a().onPressDo({ jugador1.moverteIzquierda(5) })
Expand Down
2 changes: 1 addition & 1 deletion objects.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Jugador {
}
}

method hablar() = "Rico refresco!"
method hablar() = "Rica gaseosa!"
}

class Consumible {
Expand Down

0 comments on commit fd8cac8

Please sign in to comment.