Browse files

Merge branch 'master' of github.com:LOVE-Party/LD24_Jam

  • Loading branch information...
2 parents 9cdb4b8 + 1f72331 commit ec69cd96c67047a1df1e66b5307cf3b301ff2bb8 @Textmode Textmode committed Aug 28, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 space.lua
View
15 space.lua
@@ -80,7 +80,7 @@ function state:enter()
self.endtimer = false
-- reset the level
- self.level.x = -640
+ self.level.x = -800
-- bind enemies/entities to level
-- (a preliminary to reorganising to have a separate level class)
self.level.entities = self.enemies
@@ -99,6 +99,10 @@ function state:enter()
texture = Enemy2;
}
end
+
+ for x = 1, #self.level.data do
+ self.level.data[x] = math.random(6)
+ end
-- Audio
-- Play some music
@@ -145,8 +149,15 @@ function state:update(dt)
-- Loop level
if level.x > level.width * 32 then
- level.x = -640
+ level.x = -800
+ end
+
+ --Randomize tile when you are past it
+ if level.x / 32 > 15 and level.x / 32 < #self.level.data + 15 then
+ self.level.data[math.floor((level.x / 32) - 15)] = math.random(6)
end
+
+
-- update the Player entity
self.player:update(dt, level)

0 comments on commit ec69cd9

Please sign in to comment.