Fix RTAN violations

Also fix deprecated use_texture_alpha, missing screenshot, game.conf title...
This commit is contained in:
ROllerozxa 2023-01-21 11:36:05 +01:00
parent 9037220521
commit f3974abc4c
51 changed files with 103 additions and 82 deletions

View File

@ -1,4 +1,5 @@
name = Labyrinth
name = labyrinth
title = Labyrinth
author = Just_Visiting
description = An aMAZEing Game
allowed_mapgens = singlenode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

View File

@ -45,9 +45,30 @@ local background_primary_c = handleColor("laby_background_primary_c", "#F0F0
local background_secondary_c = handleColor("laby_background_secondary_c", "#D0D0D0FF")
--End Settings Load
local DefaultGenerateMaze = dofile(minetest.get_modpath("game") .. "/maze.lua")
local modpath = minetest.get_modpath("labyrinth")
local DefaultGenerateMaze = dofile(modpath .. "/maze.lua")
local GenMaze = DefaultGenerateMaze
-- Set mapgen to singlenode if not already
minetest.set_mapgen_params('mgname', 'singlenode', true)
-- Compatibility aliases
for _, node in ipairs({
"inv",
"cave_ground", "cave_torch", "cave_rock",
"classic_ground", "classic_wall",
"club_walkway", "club_wall", "club_ceiling", "club_edge", "club_light", "club_ground",
"glass_glass",
"grassy_dirt", "grassy_hedge", "grassy_grass",
}) do
minetest.register_alias("game:" .. node, "labyrinth:" .. node)
end
--Style registrations
local numStyles = 0
@ -76,28 +97,28 @@ function laby_register_style(name, music_name, map_from_maze, cleanup, genMaze)
end
--Common node between styles, used for hidden floor to fall onto
minetest.register_node("game:inv",
minetest.register_node("labyrinth:inv",
{
description = "Ground Block",
drawtype = "airlike",
tiles = {"inv.png"},
tiles = {"blank.png"},
light_source = 11,
})
--Override the default hand
minetest.register_item(":", {
type = "none",
wield_image = "inv.png",
wield_image = "blank.png",
groups = {not_in_creative_inventory=1},
range = 0
})
--Style Registrations
dofile(minetest.get_modpath("game") .. "/styles/classic.lua")
dofile(minetest.get_modpath("game") .. "/styles/grassy.lua")
dofile(minetest.get_modpath("game") .. "/styles/glass.lua")
dofile(minetest.get_modpath("game") .. "/styles/cave.lua")
dofile(minetest.get_modpath("game") .. "/styles/club.lua")
dofile(modpath .. "/styles/classic.lua")
dofile(modpath .. "/styles/grassy.lua")
dofile(modpath .. "/styles/glass.lua")
dofile(modpath .. "/styles/cave.lua")
dofile(modpath .. "/styles/club.lua")
local restart = styles[1].gen_map
local cleanup = styles[1].cleanup
@ -221,7 +242,7 @@ end
local function to_game_menu(player)
first_load = false
minetest.show_formspec(player:get_player_name(), "game:main", main_menu())
minetest.show_formspec(player:get_player_name(), "labyrinth:main", main_menu())
cleanup(gwidth, gheight)
if music then
minetest.sound_fade(music, 0.5, 0)
@ -237,13 +258,13 @@ end
--
-- onRecieveFields(player, formname, fields)
--
-- player: player object
-- player: player object
-- formname: use provided form name
-- fields: standard recieve fields
-- Callback for on_recieve fields
----------------------------------------------------------
local function onRecieveFields(player, formname, fields)
if formname ~= "game:main" and formname ~= "" then return end
if formname ~= "labyrinth:main" and formname ~= "" then return end
if formname == "" then --process the inventory formspec
if fields.game_menu then
minetest.after(0.15, function() to_game_menu(player) end)
@ -254,7 +275,7 @@ local function onRecieveFields(player, formname, fields)
end
return
end
local scroll_in = 0
local width_in = 39
local height_in = 74
@ -274,7 +295,7 @@ local function onRecieveFields(player, formname, fields)
local newStyle = tonumber(string.sub(name,6,-1))
if newStyle ~= selectedStyle then --load level style
selectedStyle = newStyle
minetest.show_formspec(player:get_player_name(), "game:main", main_menu(width_in, height_in, scroll_in))
minetest.show_formspec(player:get_player_name(), "labyrinth:main", main_menu(width_in, height_in, scroll_in))
end
end
end
@ -302,13 +323,13 @@ local function onRecieveFields(player, formname, fields)
end
setup(player)
elseif fields.quit then
minetest.after(0.10, function() minetest.show_formspec(player:get_player_name(), "game:main", main_menu(width_in, height_in, scroll_in)) end)
minetest.after(0.10, function() minetest.show_formspec(player:get_player_name(), "labyrinth:main", main_menu(width_in, height_in, scroll_in)) end)
return
elseif fields.labyexit then
minetest.request_shutdown("Thanks for playing!")
return
else
--minetest.show_formspec(player:get_player_name(), "game:main", main_menu(width_in, height_in, scroll_in))
--minetest.show_formspec(player:get_player_name(), "labyrinth:main", main_menu(width_in, height_in, scroll_in))
end
end
@ -322,9 +343,9 @@ local function safe_clear(w, l)
MinEdge = emin,
MaxEdge = emax
}
local invisible = minetest.get_content_id("game:inv")
local invisible = minetest.get_content_id("labyrinth:inv")
local air = minetest.get_content_id("air")
for z=0, l-10 do --z
for y=0,10 do --y
for x=0, w-10 do --x
@ -346,7 +367,7 @@ minetest.register_on_joinplayer(
function(player)
safe_clear(300,300)
player:set_properties({
textures = {"inv.png", "inv.png"},
textures = {"blank.png", "blank.png"},
visual = "upright_sprite",
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.75, 0.3},
stepheight = 0.6,
@ -364,7 +385,7 @@ function(player)
}
)
player:set_inventory_formspec(pause_menu())
minetest.show_formspec(player:get_player_name(), "game:main", main_menu())
minetest.show_formspec(player:get_player_name(), "labyrinth:main", main_menu())
music = minetest.sound_play("main", {
gain = 1.0, -- default
fade = 0.8, -- default, change to a value > 0 to fade the sound in

View File

@ -55,7 +55,7 @@ local function getNextPoint(current_point,height,width,last_dir)
while(1) do
local dir = math.random(3)
if last_dir == 3 then --east
if dir == 1 then --north
if current_point[1]-2 > 0 then
return {current_point[1]-2,current_point[2]}, 2
@ -225,14 +225,14 @@ local function Generate_Maze(width, height, view)
table.insert(maze[i], 0)
end
end
--initialize first point
math.randomseed(os.time())
local x = math.random(math.floor(maze.width/2)-1)*2+1
local x = math.random(math.floor(maze.width/2)-1)*2+1
local y = math.random(math.floor(maze.height/2)-1)*2+1
--local spot = findNextStarting(maze)
maze[y][x] = 1
--Execute Algorithm
wilsonsAlgo(maze, view)

View File

@ -1,2 +1,2 @@
name = game
name = labyrinth
description = Labyrinth Core Game

View File

@ -6,7 +6,7 @@
-- Node Registrations
minetest.register_node("game:cave_rock",
minetest.register_node("labyrinth:cave_rock",
{
description = "Rock Block",
drawtype = "mesh",
@ -25,12 +25,12 @@ minetest.register_node("game:cave_rock",
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
tiles = {{name = "cave_stone.png", backface_culling=true}},
})
minetest.register_node("game:cave_ground",
minetest.register_node("labyrinth:cave_ground",
{
description = "Ground Rock",
drawtype = "mesh",
@ -54,7 +54,7 @@ minetest.register_node("game:cave_ground",
tiles = {{name = "cave_stone.png", backface_culling=true}},
})
minetest.register_node("game:cave_torch",
minetest.register_node("labyrinth:cave_torch",
{
drawtype = "mesh",
mesh = "torch.obj",
@ -71,7 +71,8 @@ minetest.register_node("game:cave_torch",
type = "wallmounted",
wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8},
},
on_rotate = false
on_rotate = false,
use_texture_alpha = "clip"
})
local clock = os.clock
@ -93,11 +94,11 @@ local function map_function(maze, player)
MinEdge = emin,
MaxEdge = emax
}
local wall = minetest.get_content_id("game:cave_rock")
local ground = minetest.get_content_id("game:cave_ground")
local torch = minetest.get_content_id("game:cave_torch")
local wall = minetest.get_content_id("labyrinth:cave_rock")
local ground = minetest.get_content_id("labyrinth:cave_ground")
local torch = minetest.get_content_id("labyrinth:cave_torch")
local air = minetest.get_content_id("air")
--player target coords
player_x = (math.floor(height/2)+(math.floor(height/2)+1)%2)*3+1
player_z = (math.floor(width/2)+(math.floor(width/2)+1)%2)*3+1
@ -105,7 +106,7 @@ local function map_function(maze, player)
player:set_physics_override({gravity=0})
player:set_velocity({x=0,y=0,z=0})
player:set_pos({x=player_x,y=1,z=player_z})
--Set up the level itself
local torch_count = 0
for z=1, width do --z
@ -158,7 +159,7 @@ local function cleanup(width, height)
MaxEdge = emax
}
local air = minetest.get_content_id("air")
--zero it out
for z=0, width*3+1 do --z
for y=0,5 do --

View File

@ -7,14 +7,14 @@
-- Node Registrations
minetest.register_node("game:classic_ground",
minetest.register_node("labyrinth:classic_ground",
{
description = "Ground Block",
tiles = {"classic_ground.png"},
light_source = 11,
})
minetest.register_node("game:classic_wall",
minetest.register_node("labyrinth:classic_wall",
{
description = "Ground Block",
tiles = {"classic_wall.png"},
@ -34,9 +34,9 @@ local function map_function(maze, player)
MinEdge = emin,
MaxEdge = emax
}
local ground = minetest.get_content_id("game:classic_ground")
local wall = minetest.get_content_id("game:classic_wall")
local invisble = minetest.get_content_id("game:inv")
local ground = minetest.get_content_id("labyrinth:classic_ground")
local wall = minetest.get_content_id("labyrinth:classic_wall")
local invisble = minetest.get_content_id("labyrinth:inv")
local air = minetest.get_content_id("air")
--Set up the level itself
@ -94,9 +94,9 @@ local function cleanup(width, height)
MinEdge = emin,
MaxEdge = emax
}
local ground = minetest.get_content_id("game:classic_ground")
local wall = minetest.get_content_id("game:classic_wall")
local invisble = minetest.get_content_id("game:inv")
local ground = minetest.get_content_id("labyrinth:classic_ground")
local wall = minetest.get_content_id("labyrinth:classic_wall")
local invisble = minetest.get_content_id("labyrinth:inv")
local air = minetest.get_content_id("air")
--Generally a good idea to zero it out

View File

@ -7,46 +7,44 @@
-- Node Registrations
minetest.register_node("game:club_ground",
minetest.register_node("labyrinth:club_ground",
{
description = "Club Ground",
tiles = {"club_ground.png"},
})
minetest.register_node("game:club_walkway",
minetest.register_node("labyrinth:club_walkway",
{
description = "Club Walkway",
tiles = {"club_walkway.png"},
})
minetest.register_node("game:club_wall",
minetest.register_node("labyrinth:club_wall",
{
description = "Club Wall",
tiles = {"club_wall.png"},
drawtype = "nodebox",
node_box = {
node_box = {
type = "fixed",
fixed = {-0.5,-0.499,-0.5,0.5,1.14,0.5},
},
selection_box = {0,0,0,0.01,0.01,0.01},
use_texture_alpha = true,
})
minetest.register_node("game:club_ceiling",
minetest.register_node("labyrinth:club_ceiling",
{
description = "Club ceiling",
tiles = {"club_ceiling.png"},
})
minetest.register_node("game:club_edge",
minetest.register_node("labyrinth:club_edge",
{
description = "Club Edge",
tiles = {"club_edge.png"},
walkable = false,
use_texture_alpha = true,
})
minetest.register_node("game:club_light",
minetest.register_node("labyrinth:club_light",
{
description = "Club light",
tiles = {"club_light.png"},
@ -93,7 +91,7 @@ local function map_function(maze, player)
local loc_maze = maze
width = loc_maze.width
height = loc_maze.height
baseParticleDef.amount = math.floor(width*height/98) --rouhgly good :)
--Copy to the map
local vm = minetest.get_voxel_manip()
@ -103,16 +101,16 @@ local function map_function(maze, player)
MinEdge = emin,
MaxEdge = emax
}
local club_ground = minetest.get_content_id("game:club_ground")
local club_wall = minetest.get_content_id("game:club_wall")
local club_ceiling = minetest.get_content_id("game:club_ceiling")
local club_light = minetest.get_content_id("game:club_light")
local club_walkway = minetest.get_content_id("game:club_walkway")
local club_edge = minetest.get_content_id("game:club_edge")
local club_ground = minetest.get_content_id("labyrinth:club_ground")
local club_wall = minetest.get_content_id("labyrinth:club_wall")
local club_ceiling = minetest.get_content_id("labyrinth:club_ceiling")
local club_light = minetest.get_content_id("labyrinth:club_light")
local club_walkway = minetest.get_content_id("labyrinth:club_walkway")
local club_edge = minetest.get_content_id("labyrinth:club_edge")
local air = minetest.get_content_id("air")
minetest.set_timeofday(0.8)
--player target coords
player_x = (math.floor(height/2)+(math.floor(height/2)+1)%2)*2
player_z = (math.floor(width/2)+(math.floor(width/2)+1)%2)*2
@ -121,7 +119,7 @@ local function map_function(maze, player)
player:set_physics_override({gravity=0})
player:set_velocity({x=0,y=0,z=0})
player:set_pos({x=player_x,y=1.5,z=player_z})
--Set up the level itself
for z=1, width do --z
for x=1, height do --x
@ -209,7 +207,7 @@ local function cleanup(width, height)
minetest.delete_particlespawner(particleID[6])
minetest.delete_particlespawner(particleID[7])
minetest.delete_particlespawner(particleID[8])
--Delete the map
local vm = minetest.get_voxel_manip()
local emin, emax = vm:read_from_map({x=0,y=0,z=0}, {x=height*2+1,y=10,z=width*2+1})
@ -219,7 +217,7 @@ local function cleanup(width, height)
MaxEdge = emax
}
local air = minetest.get_content_id("air")
--zero it out
for z=0, width*2+1 do --z
for y=0,10 do --

View File

@ -6,7 +6,7 @@
-- \_____/ |_| \_||_|(___/ (___/
---- Node Registrations ----
minetest.register_node("game:glass_glass",
minetest.register_node("labyrinth:glass_glass",
{
description = "Glass",
drawtype = "allfaces",
@ -36,7 +36,7 @@ local function map_function(maze, player)
}
-- All nodes are stored as a 16-bit content ID in the map
-- We need those exact numbers to manipulate the voxel manip
local glass = minetest.get_content_id("game:glass_glass")
local glass = minetest.get_content_id("labyrinth:glass_glass")
local air = minetest.get_content_id("air")
--Set up the level itself

View File

@ -7,21 +7,21 @@
-- Node Registrations
minetest.register_node("game:grassy_grass",
minetest.register_node("labyrinth:grassy_grass",
{
description = "Ground Block",
tiles = {"grassy_grass.png"},
light_source = 12,
})
minetest.register_node("game:grassy_dirt",
minetest.register_node("labyrinth:grassy_dirt",
{
description = "Ground Block",
tiles = {"grassy_dirt.png"},
light_source = 12,
})
minetest.register_node("game:grassy_hedge",
minetest.register_node("labyrinth:grassy_hedge",
{
description = "Ground Block",
drawtype = "allfaces",
@ -42,12 +42,12 @@ local function map_function(maze, player)
MinEdge = emin,
MaxEdge = emax
}
local grass = minetest.get_content_id("game:grassy_grass")
local dirt = minetest.get_content_id("game:grassy_dirt")
local hedge = minetest.get_content_id("game:grassy_hedge")
local invisble = minetest.get_content_id("game:inv")
local grass = minetest.get_content_id("labyrinth:grassy_grass")
local dirt = minetest.get_content_id("labyrinth:grassy_dirt")
local hedge = minetest.get_content_id("labyrinth:grassy_hedge")
local invisble = minetest.get_content_id("labyrinth:inv")
local air = minetest.get_content_id("air")
--Set up the level itself
for z=1, width do --z
for x=1, height do --x
@ -72,11 +72,11 @@ local function map_function(maze, player)
end
vm:set_data(data)
vm:write_to_map(true)
--player target coords
player_x = (math.floor(height/2)+(math.floor(height/2)+1)%2)*2
player_z = (math.floor(width/2)+(math.floor(width/2)+1)%2)*2
--Lets now overwrite the channel for the player to fall into:
local emin, emax = vm:read_from_map({x=player_x-1,y=4,z=player_z-1}, {x=player_x+1,y=32,z=player_z+1})
local data = vm:get_data()
@ -98,7 +98,7 @@ local function map_function(maze, player)
end
vm:set_data(data)
vm:write_to_map(true)
--Finally, move the player
player:set_velocity({x=0,y=0,z=0})
player:set_pos({x=player_x,y=32,z=player_z})
@ -114,7 +114,7 @@ local function cleanup(width, height)
MaxEdge = emax
}
local air = minetest.get_content_id("air")
--zero it out
for z=0, width*2+1 do --z
for y=0,4 do --
@ -125,11 +125,11 @@ local function cleanup(width, height)
end
vm:set_data(data)
vm:write_to_map(true)
--player target coords
player_x = (math.floor(height/2)+(math.floor(height/2)+1)%2)*2
player_z = (math.floor(width/2)+(math.floor(width/2)+1)%2)*2
--Lets now overwrite the channel for the player to fall into:
local emin, emax = vm:read_from_map({x=player_x-1,y=4,z=player_z-1}, {x=player_x+1,y=32,z=player_z+1})
local data = vm:get_data()

View File

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

View File

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 108 B

After

Width:  |  Height:  |  Size: 108 B

View File

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

View File

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 209 B

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 85 B

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 270 B

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB