aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/init.lua')
-rw-r--r--Scripts/init.lua29
1 files changed, 23 insertions, 6 deletions
diff --git a/Scripts/init.lua b/Scripts/init.lua
index 8559f7c..cdd6ccb 100644
--- a/Scripts/init.lua
+++ b/Scripts/init.lua
@@ -55,20 +55,37 @@ player = {
--end
--self.visibleTick = self.visibleTick + 1
end,
- PhysicsIdle = function(self)
- if self.Velocity.x < 0 then
- self.Render.flipx = true
- elseif self.Velocity.x > 0 then
- self.Render.flipx = false
+ visibleTick = 0
+}
+
+ball = {
+ Position = {
+ x = 20,
+ y = 100
+ },
+ Velocity = {
+ x = 0.0,
+ y = 0.0,
+ },
+ Physics = 0,
+ Render = {
+ texture = "Assets/ball.png",
+ normal = "Assets/ball_normal.png",
+ visible = true,
+ },
+ Idle = function(self)
+ if self.Physics.standing == true then
+ self.Velocity.y = self.Velocity.y + 15
+ self.Velocity.x = math.random(-1, 1);
end
end,
- visibleTick = 0
}
-- Create the world
dofile("Scripts/world.lua")
playerSpawn = game.spawn(player);
+game.spawn(ball);
-------------------
-- SERIALIZING --