aboutsummaryrefslogtreecommitdiff
path: root/games/minimal
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-30 13:26:40 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-03-30 13:34:21 +0300
commit3241ad3ae8da687262db32776a1da2ef7403b3e9 (patch)
treedaa4e42ed2501e1ad6b9caa17087e4c50c65c1fd /games/minimal
parent9e7ccedba4d9a94c7f2d20013c55e82aac3fe6a3 (diff)
downloadminetest-3241ad3ae8da687262db32776a1da2ef7403b3e9.tar.gz
minetest-3241ad3ae8da687262db32776a1da2ef7403b3e9.tar.bz2
minetest-3241ad3ae8da687262db32776a1da2ef7403b3e9.zip
ObjectRef:set_armor_groups() and ObjectRef:set_properties() - works on players too!
Diffstat (limited to 'games/minimal')
-rw-r--r--games/minimal/mods/experimental/init.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua
index 5dab41354..f1b8ec44a 100644
--- a/games/minimal/mods/experimental/init.lua
+++ b/games/minimal/mods/experimental/init.lua
@@ -6,6 +6,22 @@
experimental = {}
+experimental.player_visual_index = 0
+function switch_player_visual()
+ for _, obj in pairs(minetest.env:get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do
+ if obj:get_player_name() then
+ if experimental.player_visual_index == 0 then
+ obj:set_properties({visual="upright_sprite"})
+ else
+ obj:set_properties({visual="cube"})
+ end
+ end
+ end
+ experimental.player_visual_index = (experimental.player_visual_index + 1) % 2
+ minetest.after(1.0, switch_player_visual)
+end
+minetest.after(1.0, switch_player_visual)
+
--[[
stepsound = -1
function test_sound()