Compare commits
2 commits
f5a4ad11c6
...
4bbe47d158
Author | SHA1 | Date | |
---|---|---|---|
|
4bbe47d158 | ||
|
2d9c206552 |
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
src/img/*.png
|
src/img/*.png
|
||||||
|
.luarc.json
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -1,5 +1,21 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"luacats": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1740447442,
|
||||||
|
"narHash": "sha256-naorkTPkgJiEevBfpdRQtbCikN5YGiqWeIAWzCsEW4Q=",
|
||||||
|
"owner": "notpeter",
|
||||||
|
"repo": "playdate-luacats",
|
||||||
|
"rev": "7e56adacbbaceef923f24d898706aa3dec2225c1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "notpeter",
|
||||||
|
"repo": "playdate-luacats",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740367490,
|
"lastModified": 1740367490,
|
||||||
|
@ -38,6 +54,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"luacats": "luacats",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"playdate-sdk": "playdate-sdk"
|
"playdate-sdk": "playdate-sdk"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,13 @@
|
||||||
url = "github:RegularTetragon/playdate-sdk-flake";
|
url = "github:RegularTetragon/playdate-sdk-flake";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
luacats = {
|
||||||
|
url = "github:notpeter/playdate-luacats";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, playdate-sdk }:
|
outputs = { self, nixpkgs, playdate-sdk, luacats }:
|
||||||
let system = "x86_64-linux";
|
let system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
playdate-sdk-pkg = playdate-sdk.packages.${system}.default;
|
playdate-sdk-pkg = playdate-sdk.packages.${system}.default;
|
||||||
|
@ -18,12 +22,14 @@
|
||||||
mkShell {
|
mkShell {
|
||||||
env = {
|
env = {
|
||||||
PLAYDATE_SDK_PATH = playdate-sdk-pkg;
|
PLAYDATE_SDK_PATH = playdate-sdk-pkg;
|
||||||
|
LUACATS_PATH = luacats.outPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
just
|
just
|
||||||
lua-language-server
|
lua-language-server
|
||||||
playdate-sdk-pkg
|
playdate-sdk-pkg
|
||||||
|
nushell
|
||||||
tup
|
tup
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
5
justfile
5
justfile
|
@ -10,4 +10,7 @@ simu: build
|
||||||
|
|
||||||
cook-assets:
|
cook-assets:
|
||||||
@(which aseprite > /dev/null) || (echo "Missing aseprite program"; exit 1)
|
@(which aseprite > /dev/null) || (echo "Missing aseprite program"; exit 1)
|
||||||
tup
|
-tup
|
||||||
|
|
||||||
|
setup:
|
||||||
|
tools/gen-luarc.nu
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
: level_01.ase |> aseprite --batch --export-tileset %f --sheet %o |> %B-table-32-32.png
|
: level_01.ase |> aseprite --batch --export-tileset %f --sheet %o |> %B-table-16-16.png
|
||||||
: player.ase |> aseprite --batch %f --save-as %o |> %B.png
|
: player.ase |> aseprite --batch %f --save-as %o |> %B.png
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
|
@ -9,11 +9,12 @@ local playerSprite = nil
|
||||||
local atlas = nil
|
local atlas = nil
|
||||||
|
|
||||||
function gameInit()
|
function gameInit()
|
||||||
|
playdate.display.setScale(2)
|
||||||
local playerImage = gfx.image.new("img/player")
|
local playerImage = gfx.image.new("img/player")
|
||||||
assert(playerImage)
|
assert(playerImage)
|
||||||
|
|
||||||
playerSprite = gfx.sprite.new(playerImage)
|
playerSprite = gfx.sprite.new(playerImage)
|
||||||
playerSprite:moveTo(200, 120) -- (200,120) is the center of the Playdate screen
|
playerSprite:moveTo(100, 60) -- (200,120) is the center of the Playdate screen
|
||||||
playerSprite:add()
|
playerSprite:add()
|
||||||
|
|
||||||
atlas = gfx.imagetable.new("img/level_01")
|
atlas = gfx.imagetable.new("img/level_01")
|
||||||
|
@ -47,5 +48,5 @@ function playdate.update()
|
||||||
|
|
||||||
gfx.sprite.update()
|
gfx.sprite.update()
|
||||||
playdate.timer.updateTimers()
|
playdate.timer.updateTimers()
|
||||||
atlas:drawImage(2, 32, 32)
|
atlas:drawImage(2, 16, 16)
|
||||||
end
|
end
|
||||||
|
|
8
tools/gen-luarc.nu
Executable file
8
tools/gen-luarc.nu
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env nu
|
||||||
|
|
||||||
|
def main [] {
|
||||||
|
const here = path self .
|
||||||
|
let sample = open ($here | path join luarc_sample.json)
|
||||||
|
mut updated = $sample | update "workspace.library" { $env.LUACATS_PATH}
|
||||||
|
$updated | save --force ($here | path join .. .luarc.json)
|
||||||
|
}
|
19
tools/luarc_sample.json
Executable file
19
tools/luarc_sample.json
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||||
|
"diagnostics.globals": ["import"],
|
||||||
|
"diagnostics.severity": {
|
||||||
|
"duplicate-set-field": "Hint"
|
||||||
|
},
|
||||||
|
"format.defaultConfig": {
|
||||||
|
"indent_style": "space",
|
||||||
|
"indent_size": "4"
|
||||||
|
},
|
||||||
|
"runtime.builtin": {
|
||||||
|
"io": "disable",
|
||||||
|
"os": "disable",
|
||||||
|
"package": "disable"
|
||||||
|
},
|
||||||
|
"runtime.nonstandardSymbol": ["+=", "-=", "*=", "/=", "//=", "%=", "<<=", ">>=", "&=", "|=", "^="],
|
||||||
|
"runtime.version": "Lua 5.4",
|
||||||
|
"workspace.library": []
|
||||||
|
}
|
Loading…
Reference in a new issue