Skip to content

Commit

Permalink
Cambio de lugar lastMovement
Browse files Browse the repository at this point in the history
  • Loading branch information
AscarlatoUTN committed Nov 12, 2024
1 parent daf212b commit 25c5442
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions characters.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class Character {

if (direction.puedeMoverse(self, nuevaPosicion))
direction.actualizarPosicion(self, nuevaPosicion)
self.lastMovement(direction)
}

method jump() {
Expand Down Expand Up @@ -142,8 +141,8 @@ class Fireboy inherits Character {
override method eventoGravedad() = "F_Gravedad"

override method setupControls() {
keyboard.left().onPressDo({ self.move(left) })
keyboard.right().onPressDo({ self.move(right) })
keyboard.left().onPressDo({ self.move(left) self.lastMovement(left)})
keyboard.right().onPressDo({ self.move(right) self.lastMovement(right)})
keyboard.up().onPressDo({ self.jump() })
}
}
Expand All @@ -154,8 +153,8 @@ class Watergirl inherits Character {
override method image() = "P_Watergirl.png"

override method setupControls() {
keyboard.a().onPressDo({ self.move(left) })
keyboard.d().onPressDo({ self.move(right) })
keyboard.a().onPressDo({ self.move(left) self.lastMovement(left)})
keyboard.d().onPressDo({ self.move(right) self.lastMovement(right)})
keyboard.w().onPressDo({ self.jump() })
}

Expand Down
4 changes: 2 additions & 2 deletions level_1.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ object level1 inherits Level {

override method image() = "F_nivel_1.png"

override method positionF() = new MutablePosition (x = 35, y = 25)
override method positionW() = new MutablePosition (x = 35, y = 25)
override method positionF() = new MutablePosition (x = 35, y = 23)
override method positionW() = new MutablePosition (x = 35, y = 23)

override method nivelActual () = self

Expand Down
1 change: 0 additions & 1 deletion pruebas.wtest
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe "Zonas Prohibidas" {

test "Fireboy muere al pasar por charco de distinto tipo" {
level1.setupCharcos() //necesario para cargar los charcos en la lista
console.println("Charcos: " + level1.charcos().size())
const fireboy = new Fireboy(
position = new MutablePosition (x=19, y=1),
lastMovement = null)
Expand Down

0 comments on commit 25c5442

Please sign in to comment.