-
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.
- Loading branch information
1 parent
666a4b4
commit dc5bdb9
Showing
22 changed files
with
111 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,16 +1,30 @@ | ||
import wollok.game.* | ||
import mapa.* | ||
import personajes.* | ||
|
||
import pepita.* | ||
|
||
program PepitaGame { | ||
game.title("Pepita") | ||
game.height(10) | ||
game.width(10) | ||
game.cellSize(100) | ||
|
||
game.addVisual(pepita) | ||
program FireboyAndWatergirl { | ||
game.title("Fireboy and Watergirl") | ||
game.height(16) | ||
game.width(15) | ||
game.cellSize(80) | ||
game.boardGround("bg.png") | ||
game.addVisual(fireboy) | ||
game.addVisual(watergirl) | ||
mapa.inciar() | ||
|
||
keyboard.w().onPressDo({ pepita.fly(1) }) | ||
keyboard.left().onPressDo({fireboy.movIzquierda()}) | ||
keyboard.right().onPressDo({fireboy.movDerecha()}) | ||
keyboard.up().onPressDo({fireboy.movSaltar()}) | ||
|
||
keyboard.w().onPressDo({watergirl.movSaltar()}) | ||
keyboard.a().onPressDo({watergirl.movIzquierda()}) | ||
keyboard.d().onPressDo({watergirl.movDerecha()}) | ||
|
||
game.whenCollideDo(fireboy, {elemento => | ||
elemento.tratarColision(fireboy) | ||
}) | ||
|
||
game.start() | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
object mapa | ||
{ | ||
method crearBloques(y, xi, xf, tipo) | ||
{ | ||
(xi..xf).forEach({ x => | ||
const nuevoBloque = new Bloque() | ||
nuevoBloque.position(game.at(x, y)) | ||
nuevoBloque.image(tipo) | ||
game.addVisual(nuevoBloque) | ||
}) | ||
} | ||
|
||
method inciar() | ||
{ | ||
self.crearBloques(1, 0, 2, "bloque.png") | ||
self.crearBloques(1, 13, 15, "bloque.png") | ||
self.crearBloques(2, 6, 10, "bloque.png") | ||
self.crearBloques(3, 0, 4, "bloque.png") | ||
self.crearBloques(6, 2, 15, "bloque.png") | ||
self.crearBloques(9, 0, 12, "bloque.png") | ||
self.crearBloques(12, 0, 2, "bloque.png") | ||
self.crearBloques(13, 4, 15, "bloque.png") | ||
|
||
self.crearBloques(0, 5, 6, "bloqueFuego.png") | ||
self.crearBloques(0, 9, 10, "bloqueAgua.png") | ||
self.crearBloques(2, 8, 8, "bloqueConAcido6.png") | ||
self.crearBloques(6, 4, 4, "bloqueBoton.png") | ||
|
||
} | ||
} | ||
|
||
class Bloque | ||
{ | ||
var property position = game.at(0,0) | ||
var property image = "" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
object fireboy | ||
{ | ||
var property position = game.at(0,0) | ||
var cantSaltos = 0 | ||
method image() = "fireboy3.png" | ||
method movIzquierda() | ||
{ | ||
position = position.left(1) | ||
} | ||
method movDerecha() | ||
{ | ||
position = position.right(1) | ||
} | ||
method movSaltar() | ||
{ | ||
if(cantSaltos < 2) | ||
{ | ||
position = position.up(1) | ||
cantSaltos += 1 | ||
game.schedule(800, { | ||
position = position.down(1) | ||
if(cantSaltos==2) cantSaltos = 0 | ||
}) | ||
} | ||
} | ||
} | ||
|
||
object watergirl | ||
{ | ||
var property position = game.at(0,2) | ||
var cantSaltos = 0 | ||
method image() = "watergirl.png" | ||
method movIzquierda() | ||
{ | ||
position = position.left(1) | ||
} | ||
method movDerecha() | ||
{ | ||
position = position.right(1) | ||
} | ||
method movSaltar() | ||
{ | ||
if(cantSaltos < 2) | ||
{ | ||
position = position.up(1) | ||
cantSaltos += 1 | ||
game.schedule(800, { | ||
position = position.down(1) | ||
if(cantSaltos==2) cantSaltos = 0 | ||
}) | ||
} | ||
} | ||
} |