Skip to content

Commit

Permalink
Merge pull request #10 from minigdx/custom-sound
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
dwursteisen committed Mar 19, 2024
2 parents b02235a + f90476c commit cf2762f
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Want to build a game like those? Read the documentation above ⬆️ and start t
[![Connect Me](./tiny-doc/src/docs/asciidoc/sample/connect_me.gif)](https://dwursteisen.itch.io/connect-me)
[![Meiro De Maigo 2](./tiny-doc/src/docs/asciidoc/sample/meiro_de_maigo2.gif)](https://dwursteisen.itch.io/meiro-de)
[![Freezming](./tiny-doc/src/docs/asciidoc/sample/freezming.gif)](https://dwursteisen.itch.io/freezming)
[![Gravity Balls](./tiny-doc/src/docs/asciidoc/sample/gravity-balls.gif)](https://dwursteisen.itch.io/gravity-balls)

## Community

Expand Down
Binary file modified tiny-doc/src/docs/asciidoc/sample/freezming.gif
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 modified tiny-doc/src/docs/asciidoc/sample/meiro_de_maigo2.gif
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 removed tiny-doc/src/docs/asciidoc/sample/tiny-cli-sfx0.png
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.
Binary file removed tiny-doc/src/docs/asciidoc/sample/tiny-cli-sfx1.png
Binary file not shown.
4 changes: 2 additions & 2 deletions tiny-doc/src/docs/asciidoc/tiny-cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ The tiny-cli sfx command is used to start a SFX edtor to generate sound to use i

https://dwursteisen.itch.io/tiny-sfx-editor[This SFX editor can be tried online] on itch.io.

image:sample/tiny-cli-sfx1.png[]
image:sample/tiny-cli-sfx1.gif[]

image:sample/tiny-cli-sfx0.png[]
image:sample/tiny-cli-sfx0.gif[]


==== Usage
Expand Down
1 change: 1 addition & 0 deletions tiny-doc/src/docs/asciidoc/tiny-showcase.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ image:sample/connect_me.gif[link=https://dwursteisen.itch.io/connect-me]
image:sample/only_three_seconds.gif[link=https://dwursteisen.itch.io/one-light-for-three-seconds]
image:sample/meiro_de_maigo2.gif[link=https://dwursteisen.itch.io/meiro-de]
image:sample/freezming.gif[link=https://dwursteisen.itch.io/freezming]
image:sample/gravity-balls.gif[link=https://dwursteisen.itch.io/gravity-balls]


TIP: Want your game to appear here? Create a post about it in https://github.com/minigdx/tiny/discussions/categories/show-and-tell[the Show and tell board] and share all information about it.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class CtrlLib(
"- 1: right click or two fingers\n" +
"- 2: middle click or three fingers\n\n" +
"If you need to check that the touch/mouse button is still active, see `ctrl.touching` instead.",
CTRL_TOUCHED_EXAMPLE,
example = CTRL_TOUCHED_EXAMPLE,
)
inner class touched : OneArgFunction() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class GfxLib(private val resourceAccess: GameResourceAccess) : TwoArgFunction()
}
}

@TinyFunction("Move the game camera.")
@TinyFunction("Move the game camera.", example = GFX_CAMERA_EXAMPLE)
inner class camera : TwoArgFunction() {

@TinyCall("Reset the game camera to it's default position (0,0).")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,36 @@ function _draw()
local pos = ctrl.touch()
shape.circlef(pos.x, pos.y, 4, math.rnd())
end"""

//language=Lua
const val GFX_CAMERA_EXAMPLE = """
local x = 0
local y = 0
function _update()
if ctrl.pressing(keys.left) then
x = x - 0.5
elseif ctrl.pressing(keys.right) then
x = x + 0.5
end
if ctrl.pressing(keys.up) then
y = y - 0.5
elseif ctrl.pressing(keys.down) then
y = y + 0.5
end
gfx.camera(math.floor(x), math.floor(y))
end
function _draw()
gfx.cls(2)
for x = 0 - 64, 256 + 64, 16 do
for y = 0 - 64, 256 + 64, 16 do
shape.line(x - 2, y, x + 2, y, 9)
shape.line(x, y - 2, x, y + 2, 9)
end
end
print("camera: ("..x..", "..y..")", 6, 6)
shape.rect(0, 0, 256, 256, 1)
end"""

0 comments on commit cf2762f

Please sign in to comment.