-
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
0 parents
commit c0d255f
Showing
11 changed files
with
2,029 additions
and
0 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 |
---|---|---|
@@ -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 |
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,6 @@ | ||
|
||
|
||
## example | ||
|
||
TODO | ||
|
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.
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,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)}) | ||
|
||
} | ||
|
||
|
||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
import wollok.game.* | ||
|
||
import example.* | ||
|
||
program PepitaGame { | ||
juegoDeManzanas.iniciar() | ||
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,8 @@ | ||
{ | ||
"name": "ejemploGame", | ||
"version": "1.0.0", | ||
"resourceFolder": "assets", | ||
"wollokVersion": "4.0.0", | ||
"author": "lucas", | ||
"license": "ISC" | ||
} |
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,9 @@ | ||
import example.pepita | ||
|
||
describe "group of tests for pepita" { | ||
|
||
test "pepita has initial energy" { | ||
assert.equals(100, pepita.energy()) | ||
} | ||
|
||
} |