add love2d 12 project setup

This commit is contained in:
fnicon 2026-03-13 20:47:52 +09:00
parent 65a505cdfd
commit d015cc7271
15 changed files with 331 additions and 0 deletions

46
.editorconfig Normal file
View File

@ -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

48
.gitignore vendored Normal file
View File

@ -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

27
Workspace.code-workspace Normal file
View File

@ -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
}
}

3
builds/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
!.gitignore
!README.md

7
game/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"sumneko.lua",
"tomblind.local-lua-debugger-vscode",
"editorconfig.editorconfig"
]
}

34
game/.vscode/launch.json vendored Normal file
View File

@ -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",
".",
],
},
]
}

26
game/.vscode/settings.json vendored Normal file
View File

@ -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"
],
}

18
game/.vscode/tasks.json vendored Normal file
View File

@ -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
}
},
]
}

61
game/conf.lua Normal file
View File

@ -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

3
game/main.lua Normal file
View File

@ -0,0 +1,3 @@
function love.load()
print("hello")
end

3
resources/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
!.gitignore
!README.md

3
tools/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/node_modules
package-lock.json
bun.lock

43
tools/build/makelove.toml Normal file
View File

@ -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 <name>/Contents/Resources/ directory of the .app file.
[macos.archive_files]
[macos.app_metadata]
CFBundleName = "<same as the name from the main config>"
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

8
tools/package.json Normal file
View File

@ -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"
}
}

1
tools/requirements.txt Normal file
View File

@ -0,0 +1 @@
makelove