diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-09 23:53:25 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-10 11:28:14 +0200 |
commit | 989aba1966373885d4cac306daea25e102f8d68d (patch) | |
tree | 7e735cba9a7c38eee1b3ccb4474cd5963e74a378 /data/mods/experimental/init.lua | |
parent | 6b7d6c27ee53836c5f5a702056617770b59bf595 (diff) | |
download | minetest-989aba1966373885d4cac306daea25e102f8d68d.tar.gz minetest-989aba1966373885d4cac306daea25e102f8d68d.tar.bz2 minetest-989aba1966373885d4cac306daea25e102f8d68d.zip |
Fix and tune things, add tool "recharge" animation, add dummyball
Diffstat (limited to 'data/mods/experimental/init.lua')
-rw-r--r-- | data/mods/experimental/init.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/data/mods/experimental/init.lua b/data/mods/experimental/init.lua index 5f01d8b78..76b787031 100644 --- a/data/mods/experimental/init.lua +++ b/data/mods/experimental/init.lua @@ -375,6 +375,51 @@ minetest.register_entity("experimental:tnt", TNT) minetest.register_alias("TNT", "experimental:tnt") -- +-- The dummyball! +-- + +minetest.register_alias("dummyball", "experimental:dummyball") + +minetest.register_entity("experimental:dummyball", { + -- Static definition + physical = false, + collisionbox = {-0.4,-0.4,-0.4, 0.4,0.4,0.4}, + visual = "sprite", + visual_size = {x=1, y=1}, + textures = {"experimental_dummyball.png"}, + spritediv = {x=1, y=3}, + initial_sprite_basepos = {x=0, y=0}, + -- Dynamic variables + phase = 0, + phasetimer = 0, + + on_activate = function(self, staticdata) + minetest.log("Dummyball activated!") + end, + + on_step = function(self, dtime) + self.phasetimer = self.phasetimer + dtime + if self.phasetimer > 2.0 then + self.phasetimer = self.phasetimer - 2.0 + self.phase = self.phase + 1 + if self.phase >= 3 then + self.phase = 0 + end + self.object:setsprite({x=0, y=self.phase}) + phasearmor = { + [0]={cracky=3}, + [1]={crumbly=3}, + [2]={fleshy=3} + } + self.object:set_armor_groups(phasearmor[self.phase]) + end + end, + + on_punch = function(self, hitter) + end, +}) + +-- -- A test entity for testing animated and yaw-modulated sprites -- |