Skip to content

Commit

Permalink
Load one sprite in the sandbox by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwursteisen committed Jan 5, 2024
1 parent bb015ff commit 5941773
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tiny-doc/src/docs/asciidoc/sandbox.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Whether you're a seasoned game developer or just starting out, our sandbox page
Need help? xref:index.adoc[Check out the documentation]!

++++
<tiny-editor style="display: none;">
<tiny-editor style="display: none;" sprite="resources/tiny-dungeon.png">
function _init()
end
Expand All @@ -36,3 +36,4 @@ end
- https://minigdx.github.io/tiny/sandbox.html?game=CiAgCmZ1bmN0aW9uIF9kcmF3KCkKICAgIGdmeC5jbHMoKQoKICAgIHByaW50KCJSZWN0YW5nbGUgbGltaXQiLCA2NCwgNjQgLSA1KQogICAgLS0gZHJhdyB0aGUgYm9yZGVyIGxpbWl0LgogICAgZ2Z4LmRpdGhlcigweEE1QTUpCiAgICBzaGFwZS5yZWN0KDY0LCA2NCwgMjU2IC0gMTI4LCAyNTYgLSAxMjgsIDIpCiAgICBnZnguZGl0aGVyKCkKCiAgICAtLSBkcmF3IHRoZSBtb3VzZSBwb3NpdGlvbi4KICAgIGxvY2FsIHBvcyA9IGN0cmwudG91Y2goKQogICAgc2hhcGUubGluZShwb3MueCAtIDIsIHBvcy55LCBwb3MueCArIDIsIHBvcy55LCAzKQogICAgc2hhcGUubGluZShwb3MueCwgcG9zLnkgLSAyLCBwb3MueCwgcG9zLnkgKyAyLCAzKQoKICAgIC0tIGRyYXcgdGhlIHJlY3RhbmdsZSB0aGF0IGlzIHN0YXlpbmcgd2l0aGluIHRoZSBib3JkZXIgbGltaXQuCiAgICBsb2NhbCB4ID0gbWF0aC5jbGFtcCg2NCwgcG9zLnggLSA0LCAyNTYgLSA2NCAtIDkpCiAgICBsb2NhbCB5ID0gbWF0aC5jbGFtcCg2NCwgcG9zLnkgLSA0LCAyNTYgLSA2NCAtIDkpCiAgICBzaGFwZS5yZWN0KHgsIHksIDksIDksIDgpCmVuZAo=[Tracking the player mouse]
- https://minigdx.github.io/tiny/sandbox.html?game=ZnVuY3Rpb24gX2luaXQoKQogICAgbGV0dGVycyA9IHsiaCIsICJlIiwgImwiLCAibCIsICJvIiwgIiAiLCAidCIsICJpIiwgIm4iLCAieSIsICIhIn0KICAgIHN0YXJ0eCA9ICgyNTYgLSAoI2xldHRlcnMgKiA1KSkgKiAwLjUKZW5kCgpmdW5jdGlvbiBfZHJhdygpCiAgICBnZnguY2xzKCkKICAgIGZvciBpLCBsIGluIGlwYWlycyhsZXR0ZXJzKSBkbwogICAgICAgIHByaW50KAogICAgICAgICAgICBsLCAtLSBsZXR0ZXIgdG8gcHJpbnQKICAgICAgICAgICAgc3RhcnR4ICsgaSAqIDUsIC0tIHggcG9zaXRpb24gcmVnYXJkaW5nIHRoZSBsZXR0ZXIgaW5kZXguCiAgICAgICAgICAgIDEyOCArIG1hdGguY29zKHRpbnkudCAqIDMgKyBpKSAqIDgsIC0tIHkgcG9zaXRpb24gcmVnYXJkaW5nIHRoZSB0aW1lIGVsYXBzZWQgYW5kIHRoZSBsZXR0ZXIgaW5kZXggCiAgICAgICAgICAgIG1hdGguY2VpbCh0aW55LmZyYW1lICogMC4yIC0gaSkgLS0gY29sb3Igb2YgdGhlIGxldHRlciByZWdhcmRpbmcgdGhlIGluZGV4CiAgICAgICAgKQogICAgZW5kCmVuZA==[Waving letters]
- https://minigdx.github.io/tiny/sandbox.html?game=LS0gRnVuY3Rpb24gdG8gY2hlY2sgY29sbGlzaW9uIGJldHdlZW4gdHdvIHJlY3RhbmdsZXMKZnVuY3Rpb24gY2hlY2tDb2xsaXNpb24ocmVjdDEsIHJlY3QyKQogICAgcmV0dXJuIHJlY3QxLnggPCByZWN0Mi54ICsgcmVjdDIud2lkdGggYW5kIHJlY3QxLnggKyByZWN0MS53aWR0aCA+IHJlY3QyLnggYW5kIHJlY3QxLnkgPCByZWN0Mi55ICsgcmVjdDIuaGVpZ2h0IGFuZAogICAgICAgICAgICAgICByZWN0MS55ICsgcmVjdDEuaGVpZ2h0ID4gcmVjdDIueQplbmQKCi0tIEZ1bmN0aW9uIHRvIHJlc29sdmUgY29sbGlzaW9uIGFuZCBzbGlkZQpmdW5jdGlvbiBjb2xsaWRlQW5kU2xpZGUob2JqZWN0LCBvYnN0YWNsZSkKICAgIGlmIGNoZWNrQ29sbGlzaW9uKG9iamVjdCwgb2JzdGFjbGUpIHRoZW4KICAgICAgICBsb2NhbCBvdmVybGFwWCA9IG1hdGgubWluKG9iamVjdC54ICsgb2JqZWN0LndpZHRoLCBvYnN0YWNsZS54ICsgb2JzdGFjbGUud2lkdGgpIC0gbWF0aC5tYXgob2JqZWN0LngsIG9ic3RhY2xlLngpCiAgICAgICAgbG9jYWwgb3ZlcmxhcFkgPSBtYXRoLm1pbihvYmplY3QueSArIG9iamVjdC5oZWlnaHQsIG9ic3RhY2xlLnkgKyBvYnN0YWNsZS5oZWlnaHQpIC0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXRoLm1heChvYmplY3QueSwgb2JzdGFjbGUueSkKCiAgICAgICAgaWYgb3ZlcmxhcFggPCBvdmVybGFwWSB0aGVuCiAgICAgICAgICAgIGlmIG9iamVjdC54IDwgb2JzdGFjbGUueCB0aGVuCiAgICAgICAgICAgICAgICBvYmplY3QueCA9IG9iamVjdC54IC0gb3ZlcmxhcFgKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgb2JqZWN0LnggPSBvYmplY3QueCArIG92ZXJsYXBYCiAgICAgICAgICAgIGVuZAogICAgICAgIGVsc2UKICAgICAgICAgICAgaWYgb2JqZWN0LnkgPCBvYnN0YWNsZS55IHRoZW4KICAgICAgICAgICAgICAgIG9iamVjdC55ID0gb2JqZWN0LnkgLSBvdmVybGFwWQogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICBvYmplY3QueSA9IG9iamVjdC55ICsgb3ZlcmxhcFkKICAgICAgICAgICAgZW5kCiAgICAgICAgZW5kCiAgICBlbmQKZW5kCgpmdW5jdGlvbiBfaW5pdCgpCiAgICAtLSBFeGFtcGxlIHVzYWdlOgogICAgcGxheWVyID0gewogICAgICAgIHggPSA1MCwKICAgICAgICB5ID0gNTAsCiAgICAgICAgd2lkdGggPSAyMCwKICAgICAgICBoZWlnaHQgPSAyMAogICAgfQogICAgb2JzID0ge30KCiAgICB0YWJsZS5pbnNlcnQob2JzLCB7CiAgICAgICAgeCA9IDYwLAogICAgICAgIHkgPSA0MCwKICAgICAgICB3aWR0aCA9IDMwLAogICAgICAgIGhlaWdodCA9IDMwCiAgICB9KQoKCiAgICB0YWJsZS5pbnNlcnQob2JzLCB7CiAgICAgICAgeCA9IDgwLAogICAgICAgIHkgPSA2MCwKICAgICAgICB3aWR0aCA9IDMwLAogICAgICAgIGhlaWdodCA9IDMwCiAgICB9KQplbmQKCmZ1bmN0aW9uIF91cGRhdGUoKQogICAgLS0gVXBkYXRlIHBsYXllciBwb3NpdGlvbiBhbmQgaGFuZGxlIGNvbGxpc2lvbnMKICAgIGlmIGN0cmwucHJlc3Npbmcoa2V5cy5sZWZ0KSB0aGVuCiAgICAgICAgcGxheWVyLnggPSBwbGF5ZXIueCAtIDEgLS0gTW92ZSBwbGF5ZXIgaG9yaXpvbnRhbGx5CiAgICBlbHNlaWYgY3RybC5wcmVzc2luZyhrZXlzLnJpZ2h0KSB0aGVuCiAgICAgICAgcGxheWVyLnggPSBwbGF5ZXIueCArIDEgLS0gTW92ZSBwbGF5ZXIgaG9yaXpvbnRhbGx5CiAgICBlbmQKCiAgICBpZiBjdHJsLnByZXNzaW5nKGtleXMudXApIHRoZW4KICAgICAgICBwbGF5ZXIueSA9IHBsYXllci55IC0gMSAtLSBNb3ZlIHBsYXllciBob3Jpem9udGFsbHkKICAgIGVsc2VpZiBjdHJsLnByZXNzaW5nKGtleXMuZG93bikgdGhlbgogICAgICAgIHBsYXllci55ID0gcGxheWVyLnkgKyAxIC0tIE1vdmUgcGxheWVyIGhvcml6b250YWxseQogICAgZW5kCgogICAgZm9yIG8gaW4gYWxsKG9icykgZG8KICAgICAgICBjb2xsaWRlQW5kU2xpZGUocGxheWVyLCBvKQogICAgZW5kCmVuZAoKZnVuY3Rpb24gX2RyYXcoKQogICAgZ2Z4LmNscygpCiAgICBzaGFwZS5yZWN0ZihwbGF5ZXIsIDkpCgogICAgZm9yIG8gaW4gYWxsKG9icykgZG8KICAgICAgICBzaGFwZS5yZWN0KG8sIDgpCiAgICBlbmQKZW5kCgotLSBOb3csIHBsYXllcidzIHBvc2l0aW9uIGlzIGFkanVzdGVkIHRvIHNsaWRlIGFsb25nIHRoZSBvYnN0YWNsZSBpZiBhIGNvbGxpc2lvbiBvY2N1cnJlZAo=[AABB Collision]
- https://minigdx.github.io/tiny/sandbox.html?game=LS0gVXBkYXRlIHRoZSBjb2RlIHRvIHVwZGF0ZSB0aGUgZ2FtZSEKbG9jYWwgUGxheWVyID0gewogICB4ID0gMTI4IC0gMTYsCiAgIHkgPSAxMjggLSAxNiwKfQpmdW5jdGlvbiBfaW5pdCgpCiAgcGxheWVyID0gbmV3KFBsYXllcikKZW5kCgpmdW5jdGlvbiBfdXBkYXRlKCkKICBpZiBjdHJsLnByZXNzaW5nKGtleXMubGVmdCkgdGhlbgogICAgIHBsYXllci54ID0gbWF0aC5tYXgoMCwgcGxheWVyLnggLSAxKQogIGVsc2VpZiBjdHJsLnByZXNzaW5nKGtleXMucmlnaHQpIHRoZW4KICAgICAgcGxheWVyLnggPSBtYXRoLm1pbigyNDAsIHBsYXllci54ICsgMSkKICBlbmQKCmlmIGN0cmwucHJlc3Npbmcoa2V5cy51cCkgdGhlbgogICAgIHBsYXllci55ID0gbWF0aC5tYXgoMCwgcGxheWVyLnkgLSAxKQogIGVsc2VpZiBjdHJsLnByZXNzaW5nKGtleXMuZG93bikgdGhlbgogICAgICBwbGF5ZXIueSA9IG1hdGgubWluKDI0MCwgcGxheWVyLnkgKyAxKQogIGVuZAplbmQKCmZ1bmN0aW9uIF9kcmF3KCkKICAgZ2Z4LmNscygpCgogICBzaGFwZS5ncmFkaWVudCgwLCAwLCAyNTYsIDI1NiwgMywgNCkKCiAgIHNwci5kcmF3KDk2LCBwbGF5ZXIueCwgcGxheWVyLnkpCiAgIAplbmQK[Control sprite move]

0 comments on commit 5941773

Please sign in to comment.