Compare commits
	
		
			2 Commits
		
	
	
		
			c90b56b603
			...
			e0b8386849
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						e0b8386849
	
				 | 
					
					
						|||
| 
						
						
							
						
						2b02d2b94b
	
				 | 
					
					
						
@@ -66,12 +66,13 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-- vore eats another linked list
 | 
					-- vore eats another linked list
 | 
				
			||||||
-- by appending its contents.
 | 
					-- by appending its contents.
 | 
				
			||||||
-- the ingested linked
 | 
					-- the ingested linked is empty.
 | 
				
			||||||
-- list is no longer valid.
 | 
					 | 
				
			||||||
function linked_list:vore(x)
 | 
					function linked_list:vore(x)
 | 
				
			||||||
 if (not x.next) return
 | 
					 if (not x.next) return
 | 
				
			||||||
 self.tail.next = x.next
 | 
					 self.tail.next = x.next
 | 
				
			||||||
 self.tail = x.tail
 | 
					 self.tail = x.tail
 | 
				
			||||||
 | 
					 x.next = nil
 | 
				
			||||||
 | 
					 x.tail = x
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- strip calls f(x) for each
 | 
					-- strip calls f(x) for each
 | 
				
			||||||
@@ -153,6 +154,7 @@ function wipe_level()
 | 
				
			|||||||
 intangibles_fg = linked_list.new()
 | 
					 intangibles_fg = linked_list.new()
 | 
				
			||||||
 intangibles_bg = linked_list.new()
 | 
					 intangibles_bg = linked_list.new()
 | 
				
			||||||
 events = linked_list.new()
 | 
					 events = linked_list.new()
 | 
				
			||||||
 | 
					 new_events = linked_list.new()
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function _update60()
 | 
					function _update60()
 | 
				
			||||||
@@ -169,9 +171,8 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function updategame()
 | 
					function updategame()
 | 
				
			||||||
 leveldone = level_frame()
 | 
					 leveldone = level_frame()
 | 
				
			||||||
	new_events = linked_list.new()
 | 
					 | 
				
			||||||
 events:strip(call_move)
 | 
					 | 
				
			||||||
 events:vore(new_events)
 | 
					 events:vore(new_events)
 | 
				
			||||||
 | 
					 events:strip(call_move)
 | 
				
			||||||
 for _, lst in ipairs{intangibles_bg, pships, eships, pbullets, ebullets} do
 | 
					 for _, lst in ipairs{intangibles_bg, pships, eships, pbullets, ebullets} do
 | 
				
			||||||
  lst:strip(call_move)
 | 
					  lst:strip(call_move)
 | 
				
			||||||
 end
 | 
					 end
 | 
				
			||||||
@@ -1166,21 +1167,32 @@ blast = {
 | 
				
			|||||||
 damage = 4,
 | 
					 damage = 4,
 | 
				
			||||||
 dx = 0,  -- px/frame
 | 
					 dx = 0,  -- px/frame
 | 
				
			||||||
 dy = 2,
 | 
					 dy = 2,
 | 
				
			||||||
 | 
					 awaitcancel = false,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 -- disable damage for 2 frames
 | 
					 -- disable damage for 2 frames
 | 
				
			||||||
 -- when hitting something
 | 
					 -- when hitting something
 | 
				
			||||||
 hitship = function(self, _)
 | 
					 hitship = function(self, _)
 | 
				
			||||||
  self.damage = 0
 | 
					  if self.damage > 0 and not self.awaitcancel then
 | 
				
			||||||
  local wait = 2
 | 
					   self.awaitcancel = true
 | 
				
			||||||
   events:push_back{move = function()
 | 
					   events:push_back{move = function()
 | 
				
			||||||
   wait -= 1
 | 
					    new_events:push_back{
 | 
				
			||||||
   if wait <= 0 then
 | 
					     wait = 2,
 | 
				
			||||||
    self.damage = 4
 | 
					     obj = self,
 | 
				
			||||||
 | 
					     saved_dmg = self.damage,
 | 
				
			||||||
 | 
					     move = function(self)
 | 
				
			||||||
 | 
					      self.wait -= 1
 | 
				
			||||||
 | 
					      if self.wait <= 0 then
 | 
				
			||||||
 | 
					       self.obj.damage = self.saved_dmg
 | 
				
			||||||
       return true
 | 
					       return true
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
   return false
 | 
					     end,
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    self.damage = 0
 | 
				
			||||||
 | 
					    self.awaitcancel = false
 | 
				
			||||||
 | 
					    return true
 | 
				
			||||||
   end}
 | 
					   end}
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					 end
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
blast_t = {
 | 
					blast_t = {
 | 
				
			||||||
 __index = blast
 | 
					 __index = blast
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user