Skip to content

Commit

Permalink
en clase
Browse files Browse the repository at this point in the history
  • Loading branch information
lspigariol committed Sep 6, 2024
0 parents commit c0d255f
Show file tree
Hide file tree
Showing 11 changed files with 2,029 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: build

on: [push, pull_request]
jobs:
wollok-ts:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: |
wget -O wollok-ts-cli https://github.com/uqbar-project/wollok-ts-cli/releases/latest/download/wollok-ts-cli-linux-x64
chmod a+x ./wollok-ts-cli
./wollok-ts-cli test --skipValidations -p ./
shell: bash
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


## example

TODO

Binary file added assets/mario.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/moneda.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/robot.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/vegeta.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions example.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
object juegoDeManzanas{

method iniciar(){
game.height(9)
game.width(9)
game.addVisual(manzana)
game.addVisual(robot)

game.addVisualCharacter(mario)

keyboard.enter().onPressDo({mario.irAlBorde()})
game.onCollideDo(mario, {algo=>algo.agarrar()})
game.onTick(1000, "moverse", {robot.moverseSolo()})
}


}



object robot {
var position = game.at(2,2)
method position() = position
method image() = "robot.png"
method agarrar() {
game.removeVisual(robot)
}
method moverseSolo() {
position = game.at(0.randomUpTo(8),0.randomUpTo(8) )
}
}

object manzana {
method position() = game.center()
method image() = "moneda.jpg"

method agarrar() {
mario.irAlBorde()

}
}

object mario{

var dondeEsta = game.origin()

method position() = dondeEsta

method image() = if (dondeEsta.x() == 8) "vegeta.jpg" else "mario.png"

method position(nueva) {
dondeEsta = nueva
}

method irAlBorde() {
dondeEsta = game.at(8,dondeEsta.y())
game.schedule(300, {dondeEsta = dondeEsta.up(1)})

}


}
1,922 changes: 1,922 additions & 0 deletions log/wollok.log

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions mainExample.wpgm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import wollok.game.*

import example.*

program PepitaGame {
juegoDeManzanas.iniciar()
game.start()
}
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "ejemploGame",
"version": "1.0.0",
"resourceFolder": "assets",
"wollokVersion": "4.0.0",
"author": "lucas",
"license": "ISC"
}
9 changes: 9 additions & 0 deletions testExample.wtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import example.pepita

describe "group of tests for pepita" {

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

}

0 comments on commit c0d255f

Please sign in to comment.