Permalink
Browse files

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

Conflicts:
	ship.lua
  • Loading branch information...
2 parents e17fac3 + 64f17cc commit 1dc356a5ca519fb1f046b94fbab0ab267b51d16f @Textmode Textmode committed Aug 27, 2012
Showing with 16 additions and 3 deletions.
  1. +2 −0 entity.lua
  2. +9 −0 ship.lua
  3. +5 −3 space.lua
View
@@ -101,6 +101,8 @@ end
function _M:die()
self.state = 'dead'
self.shooting = false
+ self.dir_x = 0
+ self.dir_y = 0
end
-------------------------------------------------------------------------
View
@@ -151,6 +151,15 @@ function ship:docollision(level, dt) -- this is new
end
end
+-- handles the death of the entity.
+function ship:die()
+ entity.die(self)
+
+ if not self.npc then
+ Gamestate.space.level.scrolling = false
+ end
+end
+
function ship:shoot()
self.entities[#self.entities+1] = Bullet.new(self)
end
View
@@ -42,8 +42,8 @@ end
state.enemies = {}
-- level data
-state.level = {name='default'; height = 15; scroll_speed = 50;
- data = {
+state.level = {name='default'; height = 15; scroll_speed = 50; scrolling = true;
+ data = {
0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,3,3,3,3,
3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,5,4,3,2,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,
1,1,1,1,1,1,1,1,1,5,6,5,6,5,6,5,6,5,1,1,1,1,1,1,1,1,2,3,4,3,2,3,2,3,4,
@@ -135,7 +135,9 @@ function state:update(dt)
end
end
- level.x = level.x + level.scroll_speed * dt
+ if level.scrolling then
+ level.x = level.x + level.scroll_speed * dt
+ end
-- spawn additional enemies, to keep the level populated.
if self.timer >= 3 then

0 comments on commit 1dc356a

Please sign in to comment.