From 93b9f3703d257b195c22c99992e3f8d399010243 Mon Sep 17 00:00:00 2001 From: Jeija Date: Wed, 5 Sep 2012 10:35:50 +0200 Subject: [PATCH] Initial upload --- .gitignore | 1 + README.md | 7 ++++ jumping/init.lua | 102 +++++++++++++++++++++++++++++++++++++++++++++++ modpack.txt | 0 4 files changed, 110 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 jumping/init.lua create mode 100644 modpack.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..17e3a09 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +Jumping + +Jumping is a mod for minetest that adds trampolines, cushions, ... + +License: GPLv3 + +Creator: Jeija diff --git a/jumping/init.lua b/jumping/init.lua new file mode 100644 index 0000000..6015819 --- /dev/null +++ b/jumping/init.lua @@ -0,0 +1,102 @@ +local trampolinebox = { + type = "fixed", + fixed = { + {-0.5, -0.2, -0.5, 0.5, 0, 0.5}, + + {-0.5, -0.5, -0.5, -0.4, -0.2, -0.4}, + { 0.4, -0.5, -0.5, 0.5, -0.2, -0.4}, + { 0.4, -0.5, 0.4, 0.5, -0.2, 0.5}, + {-0.5, -0.5, 0.4, -0.4, -0.2, 0.5}, + } +} + +local cushionbox = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5}, + } +} + +minetest.register_node("jumping:trampoline1", { + description = "Trampoline", + drawtype = "nodebox", + node_box = trampolinebox, + selection_box = trampolinebox, + paramtype = "light", + tiles = {"default_stone.png"}, + groups = {dig_immediate=2, bouncy=30, fall_damage_add_percent=-70}, +}) + +minetest.register_node("jumping:trampoline2", { + description = "Trampoline", + drawtype = "nodebox", + node_box = trampolinebox, + selection_box = trampolinebox, + paramtype = "light", + tiles = {"default_stone.png"}, + drop = "jumping:trampoline1", + groups = {not_in_creative_inventory = 1, dig_immediate=2, bouncy=50, fall_damage_add_percent=-70}, +}) + +minetest.register_node("jumping:trampoline3", { + description = "Trampoline", + drawtype = "nodebox", + node_box = trampolinebox, + selection_box = trampolinebox, + paramtype = "light", + tiles = {"default_stone.png"}, + drop = "jumping:trampoline1", + groups = {not_in_creative_inventory = 1, dig_immediate=2, bouncy=70, fall_damage_add_percent=-70}, +}) + +minetest.register_node("jumping:trampoline4", { + description = "Trampoline", + drawtype = "nodebox", + node_box = trampolinebox, + selection_box = trampolinebox, + paramtype = "light", + tiles = {"default_stone.png"}, + drop = "jumping:trampoline1", + groups = {not_in_creative_inventory = 1, dig_immediate=2, bouncy=90, fall_damage_add_percent=-70}, +}) + +minetest.register_node("jumping:trampoline5", { + description = "Trampoline", + drawtype = "nodebox", + node_box = trampolinebox, + selection_box = trampolinebox, + paramtype = "light", + tiles = {"default_wood.png"}, + drop = "jumping:trampoline1", + groups = {not_in_creative_inventory = 1, dig_immediate=2, bouncy=100, fall_damage_add_percent=-70}, +}) + +minetest.register_node("jumping:trampoline6", { + description = "Trampoline", + drawtype = "nodebox", + node_box = trampolinebox, + selection_box = trampolinebox, + paramtype = "light", + tiles = {"default_wood.png"}, + drop = "jumping:trampoline1", + groups = {not_in_creative_inventory = 1, dig_immediate=2, bouncy=110, fall_damage_add_percent=-70}, +}) + +minetest.register_on_punchnode(function (pos, node) + if string.find(node.name, "jumping:trampoline") then + local id = string.sub(node.name, #node.name) --get number + id = id + 1 + if id == 7 then id = 1 end + minetest.env:add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id}) + end +end) + +minetest.register_node("jumping:cushion", { + description = "Cushion", + drawtype = "nodebox", + node_box = cushionbox, + selection_box = cushionbox, + paramtype = "light", + tiles = {"default_stone.png"}, + groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100}, +}) diff --git a/modpack.txt b/modpack.txt new file mode 100644 index 0000000..e69de29