create basic game

This commit is contained in:
unknown 2021-09-12 23:16:31 -04:00
commit 77821c7202
14 changed files with 111 additions and 0 deletions

17
.github/workflows/luacheck.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: luacheck
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: apt
run: sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck ./

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "mods/minekart"]
path = mods/minekart
url = https://github.com/APercy/minekart.git
[submodule "mods/mobkit"]
path = mods/mobkit
url = https://github.com/TheTermos/mobkit.git

25
.luacheckrc Normal file
View File

@ -0,0 +1,25 @@
unused_args = false
allow_defined_top = true
exclude_files = {".luacheckrc"}
globals = {
"minetest", "core",
--mod provided
}
read_globals = {
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
--luac
"math", "table",
-- Builtin
"vector", "ItemStack", "dump", "DIR_DELIM", "VoxelArea", "Settings", "PcgRandom", "VoxelManip", "PseudoRandom",
--mod produced
}

4
game.conf Normal file
View File

@ -0,0 +1,4 @@
name = MineKart
description = racing game
allowed_mapgens = singlenode
author = wsor

BIN
menu/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

BIN
menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

1
mods/minekart Submodule

@ -0,0 +1 @@
Subproject commit e204c5fd4abaeb937cd25cad08acfde704b3212d

51
mods/mk_mapgen/init.lua Normal file
View File

@ -0,0 +1,51 @@
minetest.register_node("mk_mapgen:bedrock", {
description = "bedrock",
tiles = {"mk_bedrock.png"}
})
minetest.register_node("mk_mapgen:dirt", {
description = "bedrock",
tiles = {"mk_dirt.png"}
})
minetest.register_node("mk_mapgen:dirt_with_grass", {
description = "bedrock",
tiles = {"mk_grass.png"}
})
local layers = {
[0] = minetest.get_content_id("mk_mapgen:bedrock"),
[1] = minetest.get_content_id("mk_mapgen:dirt"),
[2] = minetest.get_content_id("mk_mapgen:dirt"),
[3] = minetest.get_content_id("mk_mapgen:dirt_with_grass"),
}
local gminy, gmaxy = 0, 0
for key, _ in pairs(layers) do
if gminy > key then gminy = key end
if gmaxy < key then gmaxy = key end
end
minetest.register_on_generated(function(minp, maxp, blockseed)
if minp.y > gmaxy or maxp.y < gminy then return end
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
local data = vm:get_data()
for z = minp.z, maxp.z do
for x = minp.x, maxp.x do
for y = minp.y, maxp.y do
local vi = area:index(x, y, z)
if layers[y] then data[vi] = layers[y] end
end
end
end
vm:set_data(data)
vm:set_lighting({day = 0, night = 0})
vm:update_liquids()
vm:calc_lighting()
vm:write_to_map(data)
end)

View File

@ -0,0 +1,6 @@
code:MIT wsor4035
textures
mk_bedrock.png CC-BY-SA 3.0 StarNinjas
mk_dirt.png CC0 jp
mk_grass.png CC0 jp

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

1
mods/mobkit Submodule

@ -0,0 +1 @@
Subproject commit ddea141b081e087900a6acc5a2a90e8d4e564295