Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ You can also check an already deployed WebAssembly version here: [https://tsodin
|keys|description|
|---|---|
|<kbd>A</kbd>/<kbd>D</kbd> or <kbd>←</kbd>/<kbd>→</kbd>|move bar left/right|
|<kbd>A</kbd>/<kbd>F</kbd> or <kbd>H</kbd>/<kbd>L</kbd>|move bar left/right|
|<kbd>ESC</kbd>|toggle pause|
|<kbd>SPACE</kbd>|release the "ball"|
|<kbd>W</kbd>|score right-to-left|
|<kbd>P</kbd>|switch translation|

### Debug Build

Expand Down
9 changes: 6 additions & 3 deletions src/game.jai
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ update :: (dt: float) {
key_press :: (key: u32) {
if key == {
case #char "Q"; #if DEBUG if state == .PLAY for *targets target_hit(it);
case #char "L"; rtl = !rtl;
case #char "W"; rtl = !rtl;
case #char "P"; lang = cast(I18N_Lang) ((lang + 1) % I18N_LANG_COUNT);
case 130; #through;
case #char "H"; #through;
case #char "A"; {
left = true;
if state == .START {
Expand All @@ -40,6 +41,8 @@ key_press :: (key: u32) {
}
}
case 131; #through;
case #char "F"; #through;
case #char "L"; #through;
case #char "D"; {
right = true;
if state == .START {
Expand All @@ -59,8 +62,8 @@ key_press :: (key: u32) {

key_release :: (key: u32) {
if key == {
case 130; #through; case #char "A"; left = false;
case 131; #through; case #char "D"; right = false;
case 130; #through; case #char "A"; #through; case #char "H"; left = false;
case 131; #through; case #char "D"; #through; case #char "L"; #through; case #char "F"; right = false;
}
}

Expand Down