share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
changeset 9483 14ad1ac00ac9
parent 9472 265e5997580e
child 10017 de822cd3df3a
child 10022 eb981a03de90
equal deleted inserted replaced
9481:fbf61ef67c7b 9483:14ad1ac00ac9
    90 
    90 
    91 local currX = {}
    91 local currX = {}
    92 local currY = {}
    92 local currY = {}
    93 local currCount = 0
    93 local currCount = 0
    94 
    94 
       
    95 local specialPointsX = {}
       
    96 local specialPointsY = {}
       
    97 local specialPointsCount = 0
       
    98 
    95 --------------------------
    99 --------------------------
    96 -- hog and team tracking variales
   100 -- hog and team tracking variales
    97 --------------------------
   101 --------------------------
    98 
   102 
    99 local numhhs = 0 -- store number of hedgehogs
   103 local numhhs = 0 -- store number of hedgehogs
   487 
   491 
   488         roundN = 0
   492         roundN = 0
   489         lastRound = TotalRounds
   493         lastRound = TotalRounds
   490         RoundHasChanged = false -- true
   494         RoundHasChanged = false -- true
   491 
   495 
       
   496         for i = 0, (specialPointsCount-1) do
       
   497                 PlaceWayPoint(specialPointsX[i], specialPointsY[i])
       
   498         end
       
   499 
   492         RebuildTeamInfo()
   500         RebuildTeamInfo()
   493 
   501 
   494         ShowMission     (
   502         ShowMission     (
   495                                 loc("RACER"),
   503                                 loc("RACER"),
   496                                 loc("a Hedgewars mini-game"),
   504                                 loc("a Hedgewars mini-game"),
   499                                 loc("Round Limit:") .. " " .. roundLimit .. "|" ..
   507                                 loc("Round Limit:") .. " " .. roundLimit .. "|" ..
   500 
   508 
   501                                 "", 4, 4000
   509                                 "", 4, 4000
   502                                 )
   510                                 )
   503 
   511 
   504 	TryRepositionHogs()
   512         TryRepositionHogs()
   505 
   513 
   506 end
   514 end
   507 
   515 
   508 function PlaceWayPoint(x,y)
   516 function PlaceWayPoint(x,y)
   509 
   517 
   523         end
   531         end
   524 
   532 
   525 end
   533 end
   526 
   534 
   527 function onSpecialPoint(x,y,flag)
   535 function onSpecialPoint(x,y,flag)
   528     PlaceWayPoint(x,y)
   536     specialPointsX[specialPointsCount] = x
       
   537     specialPointsY[specialPointsCount] = y
       
   538     specialPointsCount = specialPointsCount + 1
   529 end
   539 end
   530 
   540 
   531 function onNewTurn()
   541 function onNewTurn()
   532 
   542 
   533         CheckForNewRound()
   543         CheckForNewRound()
   534 	TryRepositionHogs()
   544         TryRepositionHogs()
   535 
   545 
   536         racerActive = false
   546         racerActive = false
   537 
   547 
   538         trackTime = 0
   548         trackTime = 0
   539 
   549