share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
changeset 9810 54c0fdec4600
parent 9757 9be28be004d4
child 9831 afa4e3e04cc5
equal deleted inserted replaced
9809:1e32628eb167 9810:54c0fdec4600
     3 -- Hero has to pass as fast as possible inside the
     3 -- Hero has to pass as fast as possible inside the
     4 -- rings as in the racer mode
     4 -- rings as in the racer mode
     5 
     5 
     6 HedgewarsScriptLoad("/Scripts/Locale.lua")
     6 HedgewarsScriptLoad("/Scripts/Locale.lua")
     7 HedgewarsScriptLoad("/Scripts/Animate.lua")
     7 HedgewarsScriptLoad("/Scripts/Animate.lua")
       
     8 HedgewarsScriptLoad("/Scripts/Utils.lua")
     8 HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
     9 HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
     9 
    10 
    10 ----------------- VARIABLES --------------------
    11 ----------------- VARIABLES --------------------
    11 -- globals
    12 -- globals
    12 local missionName = loc("Hard flying")
    13 local missionName = loc("Hard flying")
   247 end
   248 end
   248 
   249 
   249 function checkIfHeroInWaypoint()
   250 function checkIfHeroInWaypoint()
   250 	if not hero.dead then
   251 	if not hero.dead then
   251 		local wp = waypoints[currentWaypoint-1]
   252 		local wp = waypoints[currentWaypoint-1]
   252 		local distance = math.sqrt((GetX(hero.gear)-wp.x)^2 + (GetY(hero.gear)-wp.y)^2)
   253 		if gearIsInCircle(hero.gear, wp.x, wp.y, radius+4, false) then
   253 		if distance <= radius+4 then
   254 			SetWind(GetRandom(201)-100)
   254 			SetWind(math.random(-100,100))
       
   255 			return true
   255 			return true
   256 		end
   256 		end
   257 	end
   257 	end
   258 	return false
   258 	return false
   259 end
   259 end