-
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.
Co-authored-by: Facundo Diez Forradellas <[email protected]> Co-authored-by: Lucas Nahuel Devecchi Di Bella <[email protected]>
- Loading branch information
1 parent
b01a8c6
commit 92b307c
Showing
2 changed files
with
73 additions
and
24 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 |
---|---|---|
|
@@ -28,8 +28,6 @@ object juegoStickyBlock { | |
|
||
//Inicio el menu | ||
menu.iniciar() | ||
|
||
//nivelActual.iniciar() | ||
} | ||
|
||
method reset(){ | ||
|
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,50 +1,101 @@ | ||
import wollok.game.* | ||
import stickyBlocks.* | ||
import levels.* | ||
import menuYTeclado.* | ||
|
||
describe "StickyBlocks" { | ||
describe "Tests StickyBlock (individual)" { | ||
|
||
method initialize(){ | ||
game.clear() | ||
} | ||
|
||
test "se mueve" { | ||
} | ||
test "El StickyBlock se mueve correctamente." { | ||
|
||
test "colisiona con pared" { | ||
} | ||
const personajePrincipal = new PersonajeInicial(position = game.at(0,0)) | ||
personajePrincipal.iniciar() | ||
|
||
test "Se revierten los pasos al presionar el botón" { | ||
personajePrincipal.moveTo(arriba) | ||
assert.equals(game.at(0,1), personajePrincipal.position()) | ||
} | ||
|
||
test "No puede atravesar paredes" { | ||
} | ||
test "El StickyBlock no se mueve al colisionar con una pared." { | ||
|
||
const personajePrincipal = new PersonajeInicial(position = game.at(0,0)) | ||
personajePrincipal.iniciar() | ||
|
||
test "Se pega a otros StickyBlocks" { | ||
const pared = new Pared(position = game.at(0,1)) | ||
pared.iniciar() | ||
|
||
cuerpo.moverCuerpo(arriba) | ||
assert.equals(game.at(0,0), personajePrincipal.position()) | ||
} | ||
} | ||
|
||
describe "Nivel" { | ||
describe "Tests del cuerpo." { | ||
|
||
method initialize(){ | ||
game.clear() | ||
} | ||
|
||
test "Se reinicia el nivel al presionar el botón" { | ||
} | ||
test "Compi se une al cuerpo." { | ||
|
||
test "Se pasa al próximo nivel al llegar a la meta" { | ||
} | ||
//Seteo el curpo con un compi y un personaje principal | ||
const compi = new StickyCompi(position = game.at(0,2)) | ||
compi.iniciar() | ||
|
||
} | ||
const personajePrincipal = new PersonajeInicial(position = game.at(0,0)) | ||
personajePrincipal.iniciar() | ||
|
||
describe "Game" { | ||
//Muevo el cuerpo, tomo al compi y bajo | ||
cuerpo.moverCuerpo(arriba) | ||
cuerpo.moverCuerpo(abajo) | ||
|
||
method initialize(){ | ||
game.clear() | ||
assert.equals(game.at(0,0), personajePrincipal.position()) | ||
assert.equals(game.at(0,1), compi.position()) | ||
} | ||
test "Se inicia correctamente" { | ||
|
||
test "El cuerpo se mueve correctamente." { | ||
|
||
//Seteo el cuerpo con un compi y un personaje principal | ||
const compi = new StickyCompi(position = game.at(0,1)) | ||
compi.iniciar() | ||
compi.setAsCuerpo() | ||
|
||
const personajePrincipal = new PersonajeInicial(position = game.at(0,0)) | ||
personajePrincipal.iniciar() | ||
|
||
//Muevo el cuerpo | ||
cuerpo.moverCuerpo(arriba) | ||
|
||
assert.equals(game.at(0,1), personajePrincipal.position()) | ||
assert.equals(game.at(0,2), compi.position()) | ||
} | ||
|
||
test "Se pasa al próximo nivel al llegar a la meta" { | ||
test "El cuerpo no se mueve si algun compi colisiona con una pared." { | ||
|
||
//Seteo el cuerpo con un compi y un personaje principal | ||
const compi = new StickyCompi(position = game.at(1,0)) | ||
compi.iniciar() | ||
compi.setAsCuerpo() | ||
|
||
const personajePrincipal = new PersonajeInicial(position = game.at(0,0)) | ||
personajePrincipal.iniciar() | ||
|
||
//Seteo una pared que colisionara con el cuerpo | ||
new Pared(position = game.at(0,1)).iniciar() | ||
|
||
cuerpo.moverCuerpo(arriba) | ||
assert.equals(game.at(0,0), personajePrincipal.position()) | ||
assert.equals(game.at(1,0), compi.position()) | ||
} | ||
|
||
} | ||
test "Se revierten el movimiento del cuerpo al ejecutar unDo." { | ||
const personajePrincipal = new PersonajeInicial(position = game.at(0,0)) | ||
personajePrincipal.iniciar() | ||
|
||
cuerpo.moverCuerpo(arriba) | ||
|
||
juegoStickyBlock.unDo() | ||
|
||
assert.equals(game.at(0,0), personajePrincipal.position()) | ||
} | ||
} |