aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Scripts/init.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/Scripts/init.lua b/Scripts/init.lua
index 96e031a..572f722 100644
--- a/Scripts/init.lua
+++ b/Scripts/init.lua
@@ -90,11 +90,44 @@ ball = {
},
}
+npc = {
+ Position = {
+ x = 30,
+ y = 75
+ },
+ Velocity = {
+ x = 0.0,
+ y = 0.0
+ },
+ Physics = 0,
+ Name = "Paul",
+ Render = {
+ texture = "Assets/cat.png",
+ visible = true
+ },
+ Light = {
+ r = 1.0,
+ g = 1.0,
+ b = 1.0,
+ strength = 0.5
+ },
+ Idle = function(self)
+ if (self.visibleTick == 0) then
+ self.visibleTick = math.random(40, 60)
+ self.Velocity.x = math.random(-1, 1) * 1.0
+ else
+ self.visibleTick = self.visibleTick - 1
+ end
+ end,
+ visibleTick = 0
+}
+
-- Create the world
dofile("Scripts/world.lua")
playerSpawn = game.spawn(player);
game.spawn(ball);
+game.spawn(npc);
-------------------
-- SERIALIZING --