diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-24 02:29:41 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-24 02:29:41 -0400 |
commit | be9d14233e9fc7b7c5e4fc3711125132e3cee151 (patch) | |
tree | 0b3fefe33ef1ab566df17bfd32217a039d2c2334 /Scripts/init.lua | |
parent | f6a0e340bc82cb5fb96f836686bd59aaffd5db97 (diff) |
Increased texture size for world, made world a little more detailed, and added bouncing ball
Diffstat (limited to 'Scripts/init.lua')
-rw-r--r-- | Scripts/init.lua | 29 |
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 -- |