Skip to content

Commit

Permalink
cambios varios
Browse files Browse the repository at this point in the history
  • Loading branch information
FeliQI committed Nov 27, 2024
1 parent 2d737fd commit 8d515a8
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 38 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TECLAS:
- W : procesar ingredientes
- E : preguntar pedido
- R : cambiar modo de correr a caminar/ caminar a correr
- T : indica cuanto dinero falta para ganar


## Otros
Expand Down
21 changes: 21 additions & 0 deletions adminDeVictoria.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import mapaObjetos.*
import wollok.game.*
import objetosRecepcion.*


object adminWinCon {
const cajaFondos = caja

method ganar() {
game.addVisual(youWin)
game.schedule(3000, {game.stop()})
}

method perder() {
if(caja.plata() <= caja.objetivo()) {
game.addVisual(youLose)
game.schedule(3000, {game.stop()})
}

}
}
Binary file added assets/derrota.png
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/victoria.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions chefs.wlk
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import personaBase.*
import posiciones.*
import objetosRecepcion.*

import wollok.game.*

class Chef inherits Persona {
var property bandeja = bandejaVacia
const fondos = caja

method tengoBandejaVacia() {
return bandeja.esVacio()
Expand Down Expand Up @@ -45,5 +47,9 @@ class Chef inherits Persona {
method preguntarPedido() {
ubicacion.clienteActual().anunciarPedido()
}

method decirCuantoFalta() {
game.say(self, "Todavia falta recolectar " + fondos.cuantoFalta() + "$")
}

}
8 changes: 2 additions & 6 deletions mapa.wlk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import adminDeVictoria.*
import factoryIngredientes.*
import objetosRecepcion.*
import posiciones.*
Expand Down Expand Up @@ -28,6 +29,7 @@ object teclas{
keyboard.left().onPressDo({remy.mover(izquierda)})
keyboard.r().onPressDo({remy.cambiarModo()}) //correr/caminar
keyboard.e().onPressDo({remy.preguntarPedido()})
keyboard.t().onPressDo({remy.decirCuantoFalta()})
}

//LAS INTERACCIONES SI ANDAN SOLO QUE UNICO DETALLITO QUE SE PODRÍA CAMBIAR DESPUÉS SI PUEDO ES QUE EL MUEBLE SE TRABAJE CON UN AREA MÁS QUE CON UNA POSICION ESPECIICA PORQUE TENES QUE DARLE CLICK EN UN LUGAR MEDIO ESPECIFICO A LOS OBJETOS PARA INTERACTUAR
Expand Down Expand Up @@ -87,12 +89,6 @@ object imagenes {
game.addVisual(sep10)
game.addVisual(deco1)
game.addVisual(deco2)
/*game.addVisual(cartel1)
game.addVisual(cartel2)
game.addVisual(texto1)
game.addVisual(texto2)
game.addVisual(texto3)
game.addVisual(texto4)*/
}

}
Expand Down
32 changes: 6 additions & 26 deletions mapaObjetos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -65,33 +65,13 @@ const sep10 = new MuebleSeparador(position = game.at(6,25))
const deco1 = new MesaDeco(position = game.at(22,12))
const deco2 = new MesaDeco(position = game.at(49,12))

/*Interfaz
const cartel1 = new Cartel(position = game.at(0,0))
const cartel2 = new Cartel(position = game.at(0,6))
const texto1 = new Text(position = game.at(7,2), textoAMostrar = caja.plata().toString() + "$")
const texto2 = new Text(position = game.at(7,8), textoAMostrar = caja.objetivo().toString() + "$")
const texto3 = new Text(position = game.at(3,11), textoAMostrar = "Objetivo:")
const texto4 = new Text(position = game.at(6,5), textoAMostrar = "Total Acumulado:")
class Cartel {
const property position = null
const property image = "cartel.png"

object youWin {
const property image = "victoria.png"
const property position = game.at(52,40)
}

class Text {
const objetoFuente = caja
const property position = null
var textoAMostrar = null //caja.plata().toString() + "$"
method text() {
return textoAMostrar
}
method textColor(){
return "FF000FFF"
}
object youLose {
const property image = "derrota.png"
const property position = game.at(53,41)
}
//class TextObjetivo inherits Text() {}*/
17 changes: 11 additions & 6 deletions objetosRecepcion.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import mueblesBase.*
import mapaObjetos.*
import wollok.game.*
import personaBase.*
import adminDeVictoria.*

object caja {
const property image = "caja.png"
const property position = game.at(76, 25)
var property objetivo = 5000
var property objetivo = 3100

var plata = 0

Expand All @@ -16,21 +17,25 @@ object caja {

method recibir(_plata){
plata += _plata
self.decirPlata()
self.considerarVictoria()
}

method considerarVictoria() {
if(plata >= objetivo) {
adminWinCon.ganar()
}
}

method gastar(_plata){
plata -= _plata
self.decirPlata()
}

method decirPlata(){
game.say(self, plata)
method cuantoFalta() {
return (objetivo - plata).max(0).toString()
}

method recibirTip(tip){
self.recibir(tip)
self.decirPlata()
}

}
Expand Down
2 changes: 2 additions & 0 deletions wollocook.wpgm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import adminDeVictoria.*
import mapaObjetos.*
import mapa.*
import adminClientes.*
Expand Down Expand Up @@ -30,6 +31,7 @@ program wollocook {
imagenes.mueblesRes()

game.schedule(1000, {adminCliente.crearCliente()})
game.schedule(500000, {adminWinCon.perder()})

game.start()
}

0 comments on commit 8d515a8

Please sign in to comment.