Improve fps
parent
1e4589fdcd
commit
ef702f099b
|
@ -1,3 +1,6 @@
|
|||
local minetest,name = minetest,minetest.localplayer:get_name()
|
||||
local aether = minetest.mod_channel_join(name..":aether_teleporters")
|
||||
|
||||
--nether teleporters are animation based
|
||||
--the animation must finish before the teleport is initialized
|
||||
local hud_bg_id = nil --aether portal bg
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
local minetest,math = minetest,math
|
||||
|
||||
local old_node
|
||||
local in_water = false
|
||||
local old_in_water = false
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
local minetest,name = minetest,minetest.localplayer:get_name()
|
||||
local fire_handling_channel = minetest.mod_channel_join(name..":fire_state")
|
||||
|
||||
local on_fire = 0
|
||||
local fire_id = nil
|
||||
local fire_animation_timer = 0
|
||||
|
|
35
init.lua
35
init.lua
|
@ -8,27 +8,8 @@ if not minetest.get_node_def("client_version_checker:this_is_the_signature_of_cr
|
|||
return
|
||||
end
|
||||
|
||||
--declare globals
|
||||
weather_intake = nil
|
||||
weather = nil
|
||||
weather_type = nil
|
||||
player_movement_state = nil
|
||||
nether = nil
|
||||
aether = nil
|
||||
name = nil
|
||||
version_channel = nil
|
||||
fire_handling_channel = nil
|
||||
|
||||
function initialize_all()
|
||||
--declare globals for now
|
||||
weather_intake = minetest.mod_channel_join("weather_intake")
|
||||
weather = minetest.mod_channel_join("weather_nodes")
|
||||
weather_type = minetest.mod_channel_join("weather_type")
|
||||
player_movement_state = minetest.mod_channel_join(name..":player_movement_state")
|
||||
nether = minetest.mod_channel_join(name..":nether_teleporters")
|
||||
aether = minetest.mod_channel_join(name..":aether_teleporters")
|
||||
version_channel = minetest.mod_channel_join(name..":client_version_channel")
|
||||
fire_handling_channel = minetest.mod_channel_join(name..":fire_state")
|
||||
|
||||
--next we load everything seperately because it's easier to work on individual files than have everything jammed into one file
|
||||
--not into seperate mods because that is unnecessary and cumbersome
|
||||
|
@ -49,7 +30,6 @@ end
|
|||
local function recursive_startup_attempt()
|
||||
local ready_to_go = minetest.localplayer
|
||||
if ready_to_go and minetest.get_node_or_nil(minetest.localplayer:get_pos()) then
|
||||
name = minetest.localplayer:get_name()
|
||||
--good to begin
|
||||
initialize_all()
|
||||
else
|
||||
|
@ -62,3 +42,18 @@ end
|
|||
|
||||
--begin initial attempt
|
||||
recursive_startup_attempt()
|
||||
|
||||
--leave mod channels on shutdown
|
||||
--[[
|
||||
minetest.register_on_shutdown(function()
|
||||
weather_intake = nil
|
||||
weather = nil
|
||||
weather_type = nil
|
||||
player_movement_state = nil
|
||||
nether = nil
|
||||
aether = nil
|
||||
name = nil
|
||||
version_channel = nil
|
||||
fire_handling_channel = nil
|
||||
end)
|
||||
]]--
|
|
@ -1,3 +1,5 @@
|
|||
local minetest,math = minetest,math
|
||||
|
||||
song_playing = nil
|
||||
local song_tick = 0
|
||||
song_index = nil
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
local minetest,math,name = minetest,math,minetest.localplayer:get_name()
|
||||
local nether = minetest.mod_channel_join(name..":nether_teleporters")
|
||||
|
||||
--nether teleporters are animation based
|
||||
--the animation must finish before the teleport is initialized
|
||||
local hud_bg_id = nil --aether portal bg
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
local minetest,name = minetest,minetest.localplayer:get_name()
|
||||
local player_movement_state = minetest.mod_channel_join(name..":player_movement_state")
|
||||
--double tap running
|
||||
|
||||
--set up our initial values
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
local minetest,name = minetest,minetest.localplayer:get_name()
|
||||
local version_channel = minetest.mod_channel_join(name..":client_version_channel")
|
||||
minetest.after(2,function() -- this needs a few seconds for the mod channel to open up
|
||||
version_channel:send_all("0.05008")
|
||||
end)
|
|
@ -1,6 +1,6 @@
|
|||
local minetest,vector = minetest,vector
|
||||
local hud_item_name = ""
|
||||
|
||||
|
||||
local hud_bg = minetest.localplayer:hud_add({
|
||||
hud_elem_type = "image", -- see HUD element types, default "text"
|
||||
position = {x=0.5, y=0},
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
local minetest,name,vector,math = minetest,minetest.localplayer:get_name(),vector,math
|
||||
|
||||
local weather_intake = minetest.mod_channel_join("weather_intake")
|
||||
local weather = minetest.mod_channel_join("weather_nodes")
|
||||
local weather_type = minetest.mod_channel_join("weather_type")
|
||||
|
||||
local all_nodes = {}
|
||||
local do_effects = false
|
||||
local snow = false
|
||||
|
|
Loading…
Reference in New Issue