]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Merge branch 'audio'
authorClyne Sullivan <clyne@bitgloo.com>
Sat, 9 May 2020 13:40:59 +0000 (09:40 -0400)
committerClyne Sullivan <clyne@bitgloo.com>
Sat, 9 May 2020 13:40:59 +0000 (09:40 -0400)
1  2 
Scripts/init.lua

index dc5093bb93e515b2853ca8e452af7e97fe1f60d2,96e031afa8b5c85d293edf382c02de5b501c42d3..572f7224a9a3eef102cb9b25be77f9e34c8b0cba
@@@ -80,40 -85,11 +85,43 @@@ ball = 
              self.Velocity.x = math.random(-1, 1);
          end
      end,
+     Audio = {
+         file = "Assets/boing.wav"
+     },
  }
  
 +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")