Commits

mcc committed 84db792

Tank information

  • Participants
  • Parent commits 2fb20ac

Comments (0)

Files changed (3)

media/overlay/play/onLoad.lua

 -- Gameplay, On Load
 
 pull(gm, {p=PhysicsScreen(screen()), canjump = false, what={}, exits={}, lava={}, enemies={}})
-pull(km, {jump_refract = 2,})
+pull(km, {jump_refract = 2, introflick=30, introfor=5})
 
 function levelend(success, touched)
 	gm.player:setColor(0,0,0,0)

media/overlay/play/onUpdate.lua

 if gm.player then
 	local playerv = gm.p:getVelocity(gm.player)
 	
+	-- Flicker level
+	
+	if not gm.playerat then
+		gm.playerat = ticks
+	end
+	if not gm.introdone then
+		local playerticks = ticks-gm.playerat
+		local pmod = playerticks%km.introflick
+		local pat = math.floor(playerticks/km.introflick)
+		
+		if pmod == 0 then
+			if pat == km.introfor then
+				gm.introdone = true
+			else
+				dos:set_centered(0,6,40,string.format("TANK#%d,#SPECIMEN#%d", gm.level.gid,gm.level.sid))
+			end
+		elseif pmod == km.introflick/2 then
+			dos:set_centered(0,6,40,"")
+		end
+	end
+	
+	-- Handle input
+	
 	if down[KEY_LEFT] then
 		gm.p:applyImpulse(gm.player, -1/1, 0)
 	end

media/overlay/pregame/onLoad.lua

 
 class "Spec"
 function Spec:Spec(t)
-	pull(self,{xdim=t.mapx,ydim=t.mapy,e={}}) -- TODO: what if not xdim or not ydim
+	pull(self,{xdim=t.mapx,ydim=t.mapy,e={},gid=t.gid,sid=t.sid}) -- TODO: what if not xdim or not ydim
 	self.scale = 10.0--surface_height/(self.ydim+2)
 	self.board = {}
 	local board2 = {}