Skip to content

Commit

Permalink
Merge pull request #9 from minigdx/custom-sound
Browse files Browse the repository at this point in the history
Rework SFX editor
  • Loading branch information
dwursteisen committed Mar 18, 2024
2 parents 00dc27c + 25a5fff commit b02235a
Show file tree
Hide file tree
Showing 92 changed files with 10,015 additions and 1,001 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
.idea/**
.idea/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
.idea

### Eclipse ###
.apt_generated
Expand Down
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/artifacts/test_luak_js_1_0_SNAPSHOT.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/artifacts/test_luak_jvm_1_0_SNAPSHOT.xml

This file was deleted.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_cli_js_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_cli_jvm_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_doc_annotations_js_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_doc_annotations_jvm_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_doc_generator_js_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_doc_generator_jvm_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/artifacts/tiny_doc_js_DEV_SNAPSHOT.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/artifacts/tiny_doc_jvm_DEV_SNAPSHOT.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/artifacts/tiny_engine_js_1_0_SNAPSHOT.xml

This file was deleted.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_engine_js_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/artifacts/tiny_engine_jvm_1_0_SNAPSHOT.xml

This file was deleted.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_engine_jvm_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_web_editor_js_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/artifacts/tiny_web_editor_jvm_DEV_SNAPSHOT.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

11 changes: 1 addition & 10 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tiny-cli/sfx.aseprite
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import com.github.ajalt.clikt.core.Abort
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.parameters.arguments.argument
import com.github.ajalt.clikt.parameters.arguments.default
import com.github.ajalt.clikt.parameters.options.flag
import com.github.ajalt.clikt.parameters.options.option
import com.github.ajalt.clikt.parameters.types.file
import com.github.minigdx.tiny.cli.config.GameParameters
import com.github.minigdx.tiny.engine.GameEngine
Expand All @@ -19,10 +21,13 @@ import java.io.File

class RunCommand : CliktCommand(name = "run", help = "Run your game.") {

val gameDirectory by argument(help = "The directory containing all game information")
val gameDirectory by argument(help = "The directory containing all game information.")
.file(mustExist = true, canBeDir = true, canBeFile = false)
.default(File("."))

val test by option(help = "Run tests before running the game.")
.flag()

fun isOracleOrOpenJDK(): Boolean {
val vendor = System.getProperty("java.vendor")?.lowercase()
return vendor?.contains("oracle") == true || vendor?.contains("eclipse") == true || vendor?.contains("openjdk") == true
Expand Down Expand Up @@ -50,6 +55,7 @@ class RunCommand : CliktCommand(name = "run", help = "Run your game.") {
val logger = StdOutLogger("tiny-cli")
val vfs = CommonVirtualFileSystem()
val gameOption = gameParameters.toGameOptions()
.copy(runTests = test)
val gameEngine = GameEngine(
gameOptions = gameOption,
platform = GlfwPlatform(gameOption, logger, vfs, gameDirectory, LwjglGLRender(logger, gameOption)),
Expand All @@ -65,7 +71,7 @@ class RunCommand : CliktCommand(name = "run", help = "Run your game.") {

val data = File("data")
if (data.exists() && data.isDirectory) {
WorkspaceLib.DEFAULT = data.listFiles().map { JvmLocalFile(it.name, data) }
WorkspaceLib.DEFAULT = data.listFiles()?.map { JvmLocalFile(it.name, data) } ?: emptyList()
}
gameEngine.main()
} catch (ex: Exception) {
Expand Down
41 changes: 1 addition & 40 deletions tiny-cli/src/jvmMain/resources/sfx/_tiny.json
Original file line number Diff line number Diff line change
@@ -1,40 +1 @@
{
"version": "V1",
"name": "Tiny SFX Sequencer",
"resolution": {
"width": 512,
"height": 288
},
"sprites": {
"width": 16,
"height": 16
},
"zoom": 2,
"colors": [
"#000000",
"#1D2B53",
"#7E2553",
"#008751",
"#AB5236",
"#5F574F",
"#C2C3C7",
"#FFF1E8",
"#FF004D",
"#FFA300",
"#FFEC27",
"#00E436",
"#29ADFF",
"#83769C",
"#FF77A8",
"#FFCCAA"
],
"scripts": [
"game.lua",
"mouse.lua",
"widgets.lua"
],
"spritesheets": [
"sfx.png"
],
"hideMouseCursor": true
}
{"version":"V1","name":"Tiny SFX Sequencer","resolution":{"width":192,"height":128},"sprites":{"width":8,"height":8},"zoom":4,"colors":["#000000","#1D2B53","#7E2553","#008751","#AB5236","#5F574F","#C2C3C7","#FFF1E8","#FF004D","#FFA300","#FFEC27","#00E436","#29ADFF","#83769C","#FF77A8","#FFCCAA"],"scripts":["test-game.lua","game.lua","mouse.lua","widgets.lua"],"spritesheets":["sfx.png"],"levels":["editor/simplified/Level_0","editor/simplified/Score","editor/simplified/Fx","editor/simplified/Music"],"hideMouseCursor":true}
Loading

0 comments on commit b02235a

Please sign in to comment.