initial upload

master
thefamilygrog 2013-09-14 21:49:29 -04:00
commit d17d2479a2
8 changed files with 395 additions and 0 deletions

22
.gitattributes vendored Normal file
View File

@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

215
.gitignore vendored Normal file
View File

@ -0,0 +1,215 @@
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg

44
README.txt Normal file
View File

@ -0,0 +1,44 @@
Hedge Maze (maze) mod for Minetest
by thefamilygrog66
Description:
Here's a mod that is based on an old BASIC script that I used to play around with back in the early 1980s(!).
The player crafts a hedge maze block, which when right-clicked, randomly generates a 3-block high, 39x39 hedge (well, cactus) maze, complete with a start and finish.
Recipe:
Maze Generating Block
+---------------+---------------+---------------+
| cactus | cactus | cactus |
+---------------+---------------+---------------+
| cactus | | cactus |
+---------------+---------------+---------------+
| desert stone | desert stone | desert stone |
+---------------+---------------+---------------+
Mod dependencies: default
License:
Sourcecode: WTFPL (see below)
Graphics: WTFPL (see below)
See also:
http://minetest.net/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

1
depends.txt Normal file
View File

@ -0,0 +1 @@
default

113
init.lua Normal file
View File

@ -0,0 +1,113 @@
minetest.register_node("maze:mazeblock", {
description = "Maze Generating Block",
tiles = {"maze_mazeblock.png"},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
on_rightclick = function(pos, node, clicker)
-- inital setup
a = {}
a[1] = 2
a[2] = -78
a[3] = -2
a[4] = 78
math.randomseed(os.time())
route = 41
zed = 0
maze = {}
for i=1, 1521 do
maze[i] = 9
zed = zed + 1
if i > 39 and i < 1483 and zed~=39 then
maze[i] = 8
end
if zed > 39 then
zed = 1
maze[i] = 9
end
end
-- generate maze
maze[route] = 5
::gen1::
j = math.random(4)
m = j
::gen2::
b = route + a[j]
if maze[b] == 8 then
maze[b] = j
tran = route + (a[j]/2)
maze[tran] = 7
route = b
goto gen1
end
j = j + 1
if j == 5 then
j = 1
end
if j ~= m then
goto gen2
end
j = maze[route]
maze[route] = 7
if j < 5 then
route = route - a[j]
goto gen1
end
-- output finished maze
maze2 = {}
for why=-1,2 do
ex = 0
zed = 0
why1 = pos.y + why
for i=1, 1521 do
zed = zed + 1
if zed > 39 then
zed = 1
ex = ex + 1
end
if why > -1 then
if maze[i] == 9 or maze[i] == 8 then
maze2[i] = "default:cactus"
elseif maze[i] == 7 then
maze2[i] = "air"
end
else
maze2[i] = "default:desert_stone"
end
--add start and end points
if i == 40 or i == 1482 then
if why > -1 then
maze2[i] = "air"
else
if i == 40 then
maze2[i] = "maze:start"
else
maze2[i] = "maze:end"
end
end
end
ex1 = pos.x + ex - 1
zed1 = pos.z + zed - 1
minetest.set_node({x=ex1, y=why1, z=zed1},{name=maze2[i]})
end
end
end,
})
minetest.register_node("maze:start", {
tiles = {"maze_start.png"},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
})
minetest.register_node("maze:end", {
tiles = {"maze_end.png"},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
})
-- register mazeblock craft
minetest.register_craft({
output = "maze:mazeblock",
recipe = {
{"default:cactus", "default:cactus", "default:cactus", },
{"default:cactus", "", "default:cactus", },
{"default:desert_stone", "default:desert_stone", "default:desert_stone", }
}
})

BIN
textures/maze_end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
textures/maze_mazeblock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

BIN
textures/maze_start.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B