Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add gunpowder trails
Uses group “connect_to_raillike”
  • Loading branch information
Wuzzy authored and Ekdohibs committed Jun 7, 2015
1 parent 016fa0d commit 0aebf86
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 4 deletions.
2 changes: 2 additions & 0 deletions game_api.txt
Expand Up @@ -218,6 +218,8 @@ Use `minetest.raillike_group(<Name>)` to get the group value.
| Node type | Raillike group name
+-----------------------+----------------------------------
| default:rail | "rail"
| tnt:gunpowder | "gunpowder"
| tnt:gunpowder_burning | "gunpowder"

Example:
If you want to add a new rail type and want it to connect with default:rail,
Expand Down
35 changes: 31 additions & 4 deletions mods/tnt/init.lua
Expand Up @@ -270,14 +270,14 @@ minetest.register_node("tnt:gunpowder", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
tiles = {"tnt_gunpowder.png",},
tiles = {"tnt_gunpowder_straight.png", "tnt_gunpowder_curved.png", "tnt_gunpowder_t_junction.png", "tnt_gunpowder_crossing.png"},
inventory_image = "tnt_gunpowder_inventory.png",
wield_image = "tnt_gunpowder_inventory.png",
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
groups = {dig_immediate=2,attached_node=1},
groups = {dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("gunpowder")},
sounds = default.node_sound_leaves_defaults(),

on_punch = function(pos, node, puncher)
Expand All @@ -297,7 +297,34 @@ minetest.register_node("tnt:gunpowder_burning", {
walkable = false,
light_source = 5,
tiles = {{
name = "tnt_gunpowder_burning_animated.png",
name = "tnt_gunpowder_burning_straight_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1,
}
},
{
name = "tnt_gunpowder_burning_curved_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1,
}
},
{
name = "tnt_gunpowder_burning_t_junction_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1,
}
},
{
name = "tnt_gunpowder_burning_crossing_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
Expand All @@ -310,7 +337,7 @@ minetest.register_node("tnt:gunpowder_burning", {
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
drop = "",
groups = {dig_immediate=2,attached_node=1},
groups = {dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("gunpowder")},
sounds = default.node_sound_leaves_defaults(),
on_timer = function(pos, elapsed)
for dx = -1, 1 do
Expand Down
Binary file removed mods/tnt/textures/tnt_gunpowder.png
Binary file not shown.
Binary file removed mods/tnt/textures/tnt_gunpowder_burning.png
Binary file not shown.
Binary file removed mods/tnt/textures/tnt_gunpowder_burning_animated.png
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/tnt/textures/tnt_gunpowder_crossing.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/tnt/textures/tnt_gunpowder_curved.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/tnt/textures/tnt_gunpowder_straight.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/tnt/textures/tnt_gunpowder_t_junction.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0aebf86

Please sign in to comment.