Skip to content

Commit

Permalink
Co-authored-by: Juan Manuel Rodrigo UTN <[email protected]>
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastián Santiago Ayala Osorio <[email protected]> Avanzamos
  • Loading branch information
UrielBove committed Oct 3, 2024
1 parent a061a52 commit 05596a7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
Binary file added assets/alien.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 22 additions & 3 deletions example.wlk
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
import wollok.game.*

object personajedefensor {
object militar {
var property image = "militarPrueba.png"
var property position = game.origin()

}

object enemigo{
class Enemigo{
var property image = "alien.png" //imagen de base
var position = game.at(2,2)

method position() = position
method moverseRandom(){

}

method moverseSolo() {
position = game.at(0.randomUpTo(4),0.randomUpTo(4) )
}
method subir() {
position = position.up(1)
}
}

const enemigo1 = new Enemigo()

class Proyectil {
var property image = "" //agregar imagen
var property position = game.origin()
var property position = game.origin()// la bala proviene del personaje
}
14 changes: 13 additions & 1 deletion main.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ program defenderBase {
game.height(9)
game.width(16)
game.boardGround("imagenDeFondo.jpg") //Imagen del fondo
game.addVisualCharacter(personajedefensor)
game.cellSize(50)
game.title("Juego")

/* self.generarEnemigos()

method generarEnemigos(){
game.onTick(1000,"aparece enemigo",{new Enemigo().aparecer()})
}
*/

game.onTick(8000, "movimiento", { enemigo1.moverseSolo() })
game.addVisualCharacter(militar)
game.addVisualCharacter(enemigo1)
game.start()
}

0 comments on commit 05596a7

Please sign in to comment.