Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
02eeafdc03 | |||
4345462384 | |||
b5205e4e7d | |||
811847b0e7 | |||
f375986e33 | |||
fdd5bbd1e1 | |||
dd985c9a80 | |||
5559e591a7 | |||
c7223539f6 | |||
ea83c64fee | |||
7f4fd224a5 | |||
15a953d3b2 |
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*~
|
37
README.md
Executable file → Normal file
@ -1,7 +1,36 @@
|
|||||||
Jumping
|
# Jumping
|
||||||
|
|
||||||
Jumping is a mod for minetest that adds trampolines, cushions, ...
|
Jumping is a mod for Minetest that adds trampolines of different power levels, and cushions! The trampolines allow you to jump higher, while the cushions let you fall farther and not take as much damage.
|
||||||
|
|
||||||
License: GPLv3
|
## Recipes
|
||||||
|
### Cushion
|
||||||
|

|
||||||
|
|
||||||
Creator: Jeija
|
*  - Cotton
|
||||||
|
|
||||||
|
*  - Wool (can be any colour, as long as it is wool)
|
||||||
|
|
||||||
|
The wool can be any colour, however, different coloured cushions and trampolines will soon be added creating a use for the different colours of wool.
|
||||||
|
|
||||||
|
Two wool is required because you would probably want as much "cushioning" as possible in a cushion. The cotton is meant as an outline creating the cloth surrounding the wool.
|
||||||
|
|
||||||
|
### Trampoline
|
||||||
|

|
||||||
|
|
||||||
|
*  - Steel Ingot
|
||||||
|
|
||||||
|
*  - Cushion
|
||||||
|
|
||||||
|
When coloured cushions are implemented, colour will become not only an indicator to show how bouncy the trampoline is, but also a decoration on the top. You can also look at the InfoText to find the value showing how bouncy said trampoline is. This is called the "bouncy level."
|
||||||
|
|
||||||
|
To change the bouncy level, simply left click (punch) any trampoline. This will increase the bouncy level by 1 until 6. Right click to decrease the bouncy level by 1, until 1.
|
||||||
|
|
||||||
|
The steel ingots are used for the legs, while the cushions are obviously acting as the canvas. In fact, when some type of canvas is added, it will be used instead for the trampoline recipe.
|
||||||
|
|
||||||
|
## Development Repositories
|
||||||
|
* **Jeija **: [Jeija/minetest-mod-jumping](http://github.com/Jeija/minetest-mod-jumping)
|
||||||
|
|
||||||
|
## License and Information
|
||||||
|
**License**: [GPLv3](http://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||||
|
|
||||||
|
**Creator**: [Jeija](http://github.com/Jeija)
|
||||||
|
94
init.lua
Executable file → Normal file
@ -7,43 +7,61 @@ local trampolinebox = {
|
|||||||
{ 0.4, -0.5, -0.5, 0.5, -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.4, -0.5, 0.4, 0.5, -0.2, 0.5},
|
||||||
{-0.5, -0.5, 0.4, -0.4, -0.2, 0.5},
|
{-0.5, -0.5, 0.4, -0.4, -0.2, 0.5},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local cushionbox = {
|
local cushionbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local trampoline_punch = function(pos, node)
|
local trampoline_punch = function(pos, node)
|
||||||
local id = string.sub(node.name, #node.name)
|
local id = string.sub(node.name, #node.name)
|
||||||
id = id + 1
|
if id < "6" then
|
||||||
if id == 7 then id = 1 end
|
id = id + 1
|
||||||
minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
||||||
|
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local u = 6
|
local power_decrease = function(pos, node)
|
||||||
|
local id = string.sub(node.name, #node.name)
|
||||||
|
if id > "1" then
|
||||||
|
id = id - 1
|
||||||
|
minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
||||||
|
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local bounces = {90, 100, 110, 120, 130, 140}
|
local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or nil
|
||||||
|
for i = 1, 6 do
|
||||||
for i = 1, u do
|
minetest.register_node("jumping:trampoline"..i, {
|
||||||
local bnc_pct = bounces[i]
|
description = "Trampoline",
|
||||||
minetest.register_node("jumping:trampoline_" .. i, {
|
|
||||||
description = "Trampoline (bounce : " .. bnc_pct .. "%)",
|
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = trampolinebox,
|
node_box = trampolinebox,
|
||||||
selection_box = trampolinebox,
|
selection_box = trampolinebox,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
on_construct = function(pos)
|
||||||
|
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..i)
|
||||||
|
end,
|
||||||
on_punch = trampoline_punch,
|
on_punch = trampoline_punch,
|
||||||
|
on_rightclick = power_decrease,
|
||||||
|
drop = "jumping:trampoline1",
|
||||||
|
use_texture_alpha = use_texture_alpha,
|
||||||
tiles = {
|
tiles = {
|
||||||
"jumping_trampoline_top.png",
|
"jumping_trampoline_top.png",
|
||||||
"jumping_trampoline_bottom.png",
|
"jumping_trampoline_bottom.png",
|
||||||
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay_" .. i .. ".png",
|
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
|
||||||
|
},
|
||||||
|
is_ground_content = false,
|
||||||
|
groups = {
|
||||||
|
dig_immediate = 2,
|
||||||
|
bouncy = 20 + i * 20,
|
||||||
|
fall_damage_add_percent = -70,
|
||||||
|
not_in_creative_inventory = ( i > 1 and 1 or nil),
|
||||||
},
|
},
|
||||||
drop = "jumping:trampoline_1",
|
|
||||||
groups = {dig_immediate = 2, bouncy = bnc_pct, fall_damage_add_percent = -95},
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -53,32 +71,34 @@ minetest.register_node("jumping:cushion", {
|
|||||||
node_box = cushionbox,
|
node_box = cushionbox,
|
||||||
selection_box = cushionbox,
|
selection_box = cushionbox,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
use_texture_alpha = use_texture_alpha,
|
||||||
tiles = {
|
tiles = {
|
||||||
"jumping_cushion_tb.png",
|
"jumping_cushion_tb.png",
|
||||||
"jumping_cushion_tb.png",
|
"jumping_cushion_tb.png",
|
||||||
"jumping_cushion_sides.png",
|
"jumping_cushion_sides.png"
|
||||||
},
|
},
|
||||||
groups = {dig_immediate = 2, disable_jump = 1, fall_damage_add_percent = -100},
|
is_ground_content = false,
|
||||||
|
groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
-- register recipes if the corresponding mods are present
|
||||||
output = "jumping:trampoline_1",
|
if minetest.get_modpath("default") then
|
||||||
recipe = {
|
minetest.register_craft({
|
||||||
{"group:ingot", "group:ingot", "group:ingot"},
|
output = "jumping:trampoline1",
|
||||||
{"default:leaves", "default:leaves", "default:leaves"},
|
recipe = {
|
||||||
{"default:stick", "default:stick", "default:stick"},
|
{"jumping:cushion", "jumping:cushion", "jumping:cushion"},
|
||||||
}
|
{"default:steel_ingot", "", "default:steel_ingot"}
|
||||||
})
|
}
|
||||||
|
})
|
||||||
minetest.register_craft({
|
end
|
||||||
output = "jumping:cushion",
|
|
||||||
recipe = {
|
if minetest.get_modpath("farming") and minetest.get_modpath("wool") then
|
||||||
{"default:junglegrass", "default:junglegrass", "default:junglegrass"},
|
minetest.register_craft({
|
||||||
{"default:leaves", "default:leaves", "default:leaves"},
|
output = "jumping:cushion",
|
||||||
{"default:stick", "default:stick", "default:stick"},
|
recipe = {
|
||||||
}
|
{"farming:cotton", "group:wool", "farming:cotton"},
|
||||||
})
|
{"farming:cotton", "group:wool", "farming:cotton"},
|
||||||
|
{"farming:cotton", "farming:cotton", "farming:cotton"}
|
||||||
if minetest.setting_getbool("log_mods") then
|
}
|
||||||
minetest.log("action", "Carbone: [jumping] loaded.")
|
})
|
||||||
end
|
end
|
||||||
|
2
mod.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
name = jumping
|
||||||
|
description = adds trampolines, cushions, ...
|
BIN
textures/jumping_cushion_sides.png
Executable file → Normal file
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 284 B |
BIN
textures/jumping_cushion_tb.png
Executable file → Normal file
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 618 B |
BIN
textures/jumping_trampoline_bottom.png
Executable file → Normal file
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 451 B |
BIN
textures/jumping_trampoline_sides.png
Executable file → Normal file
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 216 B |
BIN
textures/jumping_trampoline_sides_overlay1.png
Normal file
After Width: | Height: | Size: 185 B |
BIN
textures/jumping_trampoline_sides_overlay2.png
Normal file
After Width: | Height: | Size: 188 B |
BIN
textures/jumping_trampoline_sides_overlay3.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
textures/jumping_trampoline_sides_overlay4.png
Normal file
After Width: | Height: | Size: 180 B |
BIN
textures/jumping_trampoline_sides_overlay5.png
Normal file
After Width: | Height: | Size: 176 B |
BIN
textures/jumping_trampoline_sides_overlay6.png
Normal file
After Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 110 B |
Before Width: | Height: | Size: 114 B |
Before Width: | Height: | Size: 113 B |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 105 B |
BIN
textures/jumping_trampoline_top.png
Executable file → Normal file
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 539 B |