diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ae93e69 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,46 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +# Default settings for all files +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +insert_final_newline = true +tab_width = 2 +trim_trailing_whitespace = true + +# Tab indentation for Makefiles +[Makefile] +indent_style = tab + +# Configuration files +[*.{json,yml,yaml}] +indent_style = space +indent_size = 2 + +# Lua specific settings +[*.{lua,luau,rockspec}] +indent_style = space +indent_size = 2 +max_line_length = 120 + +# Documentation files +[*.{md,rst,txt}] +trim_trailing_whitespace = false +max_line_length = off + +[*.sh] +indent_style = space +indent_size = 2 +# --language-variant +shell_variant = auto +binary_next_line = true +# --case-indent +switch_case_indent = true +space_redirects = false +# --func-next-line +function_next_line = false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b42930e --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +*~ +/releases +/buildtools/appimage/love-prepared/ +/buildtools/appimage/*.AppImage +/buildtools/appimage/squashfs-root +*.private + +.env diff --git a/Workspace.code-workspace b/Workspace.code-workspace new file mode 100644 index 0000000..547a452 --- /dev/null +++ b/Workspace.code-workspace @@ -0,0 +1,27 @@ +{ + "folders": [ + { + "name": "Game", + "path": "./game", + }, + { + "name": "Tools", + "path": "./tools", + }, + { + "name": "Resources", + "path": "./resources", + }, + { + "name": "Builds", + "path": "./builds", + }, + { + "name": "Root", + "path": ".", + } + ], + "settings": { + "terminal.integrated.defaultProfile.windows": null + } +} diff --git a/builds/.gitignore b/builds/.gitignore new file mode 100644 index 0000000..7c9d611 --- /dev/null +++ b/builds/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!README.md diff --git a/game/.vscode/extensions.json b/game/.vscode/extensions.json new file mode 100644 index 0000000..575809c --- /dev/null +++ b/game/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "sumneko.lua", + "tomblind.local-lua-debugger-vscode", + "editorconfig.editorconfig" + ] +} diff --git a/game/.vscode/launch.json b/game/.vscode/launch.json new file mode 100644 index 0000000..807d3da --- /dev/null +++ b/game/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "type": "lua-local", + "request": "launch", + "name": "Debug", + "program": { + "command": "appimage-run" + }, + "args": [ + "../resources/love.AppImage", + ".", + "debug" + ], + }, + { + "type": "lua-local", + "request": "launch", + "name": "Release", + "program": { + "command": "appimage-run" + }, + "args": [ + "../resources/love.AppImage", + ".", + ], + }, + ] +} diff --git a/game/.vscode/settings.json b/game/.vscode/settings.json new file mode 100644 index 0000000..502aebf --- /dev/null +++ b/game/.vscode/settings.json @@ -0,0 +1,26 @@ +{ + "Lua.workspace.library": [ + "${3rd}/love2d/library", + "lib" + ], + "Lua.runtime.version": "LuaJIT", + "Lua.workspace.checkThirdParty": false, + "chat.agent.enabled": false, + "chat.editRequests": "none", + "chat.implicitContext.enabled": { + "panel": "never" + }, + "chat.modeFilesLocations": { + ".github/chatmodes": false + }, + "chat.promptFiles": false, + "chat.promptFilesLocations": { + ".github/prompts": false + }, + "Lua.diagnostics.globals": [ + "love" + ], + "Lua.diagnostics.disable": [ + "lowercase-global" + ], +} diff --git a/game/.vscode/tasks.json b/game/.vscode/tasks.json new file mode 100644 index 0000000..8ee1dbd --- /dev/null +++ b/game/.vscode/tasks.json @@ -0,0 +1,18 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build LÖVE", + "type": "process", + "command": "makelove", + "args": [ + "--config", + "../tools/build/makelove.toml" + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + ] +} diff --git a/game/conf.lua b/game/conf.lua new file mode 100644 index 0000000..8fbce4a --- /dev/null +++ b/game/conf.lua @@ -0,0 +1,61 @@ +local IS_DEBUG = os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" and arg[2] == "debug" +if IS_DEBUG then + require("lldebugger").start() + + function love.errorhandler(msg) + error(msg, 2) + end +end + +-- https://love2d.org/wiki/Config_Files +function love.conf(t) + t.identity = nil + t.appendidentity = false + t.version = "12.0" + t.console = false + t.accelerometerjoystick = false + t.externalstorage = false + t.graphics.gammacorrect = false + + t.audio.mic = false + t.audio.mixwithsystem = true + + t.window.title = "test" + t.window.icon = nil + t.window.width = 960 + t.window.height = 720 + t.window.borderless = false + t.window.resizable = false + t.window.minwidth = 10 + t.window.minheight = 9 + t.window.fullscreen = false + t.window.fullscreentype = "desktop" + t.window.vsync = 1 + t.window.msaa = 0 + t.window.depth = true + t.window.stencil = nil + t.displayindex = 1 + t.highdpi = false + t.window.usedpiscale = true + t.window.x = nil + t.window.y = nil + + t.modules.audio = true + t.modules.data = true + t.modules.event = true + t.modules.font = true + t.modules.graphics = true + t.modules.image = true + t.modules.joystick = true + t.modules.keyboard = true + t.modules.math = true + t.modules.mouse = true + t.modules.physics = true + t.modules.sound = true + t.modules.system = true + t.modules.thread = true + t.modules.timer = true + t.modules.touch = true + t.modules.video = true + t.modules.window = true +end diff --git a/game/main.lua b/game/main.lua new file mode 100644 index 0000000..9d7cd2c --- /dev/null +++ b/game/main.lua @@ -0,0 +1,3 @@ +function love.load() + print("hello") +end diff --git a/resources/.gitignore b/resources/.gitignore new file mode 100644 index 0000000..7c9d611 --- /dev/null +++ b/resources/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!README.md diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000..cac13a8 --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,3 @@ +/node_modules +package-lock.json +bun.lock diff --git a/tools/build/makelove.toml b/tools/build/makelove.toml new file mode 100644 index 0000000..a5ec493 --- /dev/null +++ b/tools/build/makelove.toml @@ -0,0 +1,43 @@ +name = "Game" +default_targets = ["win64"] +build_directory = "../builds" +love_files = [ + "+*", + "-*/.*", +] +keep_game_directory = false +[win64] +love_binaries = "../resources/love-12.0-woa64" + +[macos] +love_binaries = "../resources/love-macos" +# The files specified here will be added in addition to the ones specified on top level. +# All specified files will be copied to the /Contents/Resources/ directory of the .app file. +[macos.archive_files] + +[macos.app_metadata] +CFBundleName = "" +CFBundleIdentifier = "tld.yourgamename" +NSHumanReadableCopyright = "Copyright © 2006-2020 LÖVE Development Team" +CFBundleShortVersionString = "{version}" + +[linux] +# These values are included in the .desktop file + +[linux.desktop_file_metadata] +Comment="Scary game about finding teeth in odd places" +Categories="Education;Science;" # Default is "Game;" (semicolon is separator and terminator) + +[appimage] +source_appimage = "../resources/love.AppImage" + +# As with windows, this is a list of .so files to include in the AppImage +shared_libraries = [ + "enet2/enet2.so", + "/lib/x86_64-linux-gnu/libcurl.so", +] + +# See win32.artifacts and win64.artifacts. +# for appimage the possible values are: "appimage" and "appdir", +# where "appdir" is the AppDir the AppImage is generated from. +artifacts = "appimage" # default is to delete the AppDir diff --git a/tools/package.json b/tools/package.json new file mode 100644 index 0000000..ce368e3 --- /dev/null +++ b/tools/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "RunJS": "cd ../builds/lovejs && python -m http.server 8000", + "Publish": "cd ../builds && ../resources/butler/butler push ./win64 user/game:win && ../resources/butler/butler push ./love user/game:win-linux-mac && ../resources/butler/butler push ./lovejs user/game:stable", + "Run": "cd ../game && appimage-run ../resources/love.AppImage --console .", + "Build": "cd ../game && makelove --config ../tools/build/makelove.toml" + } +} diff --git a/tools/requirements.txt b/tools/requirements.txt new file mode 100644 index 0000000..08ca0ea --- /dev/null +++ b/tools/requirements.txt @@ -0,0 +1 @@ +makelove