plants: update plants mod: add new, save & remove debug
This commit is contained in:
@@ -1,16 +1,40 @@
|
|||||||
local Plant, TileSheet = Smc.requirePlant(), Smc.requireTileSheet()
|
local Plant, TileSheet = Smc.requirePlant(), Smc.requireTileSheet()
|
||||||
|
|
||||||
Plant:new({
|
local placeParam2 = {
|
||||||
settings = {
|
2,
|
||||||
name = 'plants',
|
3,
|
||||||
tiles = { "test_plant.png" },
|
4,
|
||||||
place_param2 = 3,
|
34,
|
||||||
},
|
35,
|
||||||
})
|
36
|
||||||
|
}
|
||||||
|
|
||||||
|
local function afterPlaceNode(pos, placer, itemstack, pointed_thing)
|
||||||
|
local node = core.get_node(pos)
|
||||||
|
node.param2 = 8 + placeParam2[math.random(#placeParam2)]
|
||||||
|
core.set_node(pos, node)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- --- Bog plants ---
|
||||||
|
local BogPlantsTileSheet = TileSheet:new('plants_bog_sheet.png', 16, 16)
|
||||||
|
|
||||||
|
for i=1, 3 do
|
||||||
|
Plant:new({
|
||||||
|
settings = {
|
||||||
|
name = 'bog_grass_'..tostring(i),
|
||||||
|
tiles = { BogPlantsTileSheet:t(i-1, 0) },
|
||||||
|
place_param2 = 8,
|
||||||
|
},
|
||||||
|
callbacks = {
|
||||||
|
after_place_node = afterPlaceNode,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- DEBUG
|
||||||
|
|
||||||
local PlantsTileSheet = TileSheet:new('plants_test_sheet.png', 16, 16)
|
local PlantsTileSheet = TileSheet:new('plants_test_sheet.png', 16, 16)
|
||||||
|
|
||||||
|
|
||||||
for i=0, 3 do
|
for i=0, 3 do
|
||||||
Plant:new({
|
Plant:new({
|
||||||
settings = {
|
settings = {
|
||||||
@@ -53,6 +77,3 @@ Plant:new({
|
|||||||
place_param2 = 3,
|
place_param2 = 3,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
mods/GAME/ITEMS/plants/textures/sheets/plants_bog_sheet.png
Normal file
BIN
mods/GAME/ITEMS/plants/textures/sheets/plants_bog_sheet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user