Skip to content

Commit

Permalink
commit inicial
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyrios committed Oct 3, 2024
1 parent 5f77156 commit c862ffe
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 30 deletions.
Binary file added assets/fondo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/policecar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions example.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//Cómo hacer para moverse más rápido?
object juegoDeAutos {
method iniciar() {
game.width(10)
game.height(7)
game.cellSize(50)
game.title("Juego")
game.boardGround("fondo.jpg")

game.addVisualCharacter(auto)
}
}

object auto {
var nafta = 100
var position = game.center()

method image() = "policecar.png"

method position() = position

method perderNafta() {
nafta -= 1
}

method startGame() {
game.onTick(1000, "movimiento", { self.perderNafta() })
}

method cambiarPosicion(nuevaPosicion) {
position = nuevaPosicion
}
}

//TODO : Implementar la clase obstaculo
//Cómo hacer para moverse más rápido?
//Movimientos con polimorfismo
16 changes: 4 additions & 12 deletions main.wpgm
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import wollok.game.*
import example.*

import pepita.*

program PepitaGame {
game.title("Pepita")
game.height(10)
game.width(10)
game.cellSize(100)

game.addVisual(pepita)

keyboard.w().onPressDo({ pepita.fly(1) })

game.start()
program juego {
juegoDeAutos.iniciar()
game.start()
}
16 changes: 0 additions & 16 deletions pepita.wlk

This file was deleted.

4 changes: 2 additions & 2 deletions pruebas.wtest
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pepita.*
/*import pepita.*

describe "group of tests for pepita" {

test "pepita has initial energy" {
assert.equals(100, pepita.energy())
}

}
}*/

0 comments on commit c862ffe

Please sign in to comment.