diff options
Diffstat (limited to 'xml/entities.xml')
-rw-r--r-- | xml/entities.xml | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/xml/entities.xml b/xml/entities.xml index 16bee0f..921e837 100644 --- a/xml/entities.xml +++ b/xml/entities.xml @@ -1,5 +1,29 @@ <spawnx/> +<firefly> + <Position /> + <Visible value="0.1" /> + <Sprite> + <frame> + <src limb="0" offset="0,5" size="1,1" drawOffset="0,0">assets/colorIndex.png</src> + </frame> + </Sprite> + <Direction /> + <Solid /> + <Wander> + countdown = 0 + + update = function() + if (countdown == 0) then + countdown = math.random(100, 500) + velx = math.random(-5, 5) * 0.001 + vely = math.random(-5, 5) * 0.001 + end + countdown = countdown - 1 + end + </Wander> +</firefly> + <npc> <Position value="0.0,100.0" /> <Visible value="0.2" /> @@ -80,10 +104,6 @@ countdown = 0 update = function() - if (velx < 0 and math.abs(selfx - playerx) < 150) then - aggro = 1 - end - if (countdown == 0) then countdown = math.random(3000, 5000) velx = math.random(-1, 1) * 0.005 @@ -92,15 +112,7 @@ end hostile = function() - if (playerx <= selfx) then - velx = -0.01 - else - velx = 0.01 - end - if (math.abs(playerx - selfx) < 50) then - attack(selfx, selfy) - end end </Wander> <Aggro/> @@ -122,7 +134,6 @@ <Solid /> <Physics /> <Name value="birb" /> - <Health value="60" /> <Wander> countdown = 0 onetime = 0 |