Log in

Alixibus #3 [425.9]

335 rounds, 271 wins, 63 losses, 1 draws

Ships

RocketPlatform

{"name": "RocketPlatform", "parts": [{"type": "brain","pos": [0,0],"rot": 0,"welds": [5,21,22,25]},{"type": "reinforced_hull","pos": [-4,1],"rot": 0,"welds": [2,16,17]},{"type": "reinforced_hull","pos": [-3,1],"rot": 0,"welds": [3,10]},{"type": "reinforced_hull","pos": [-2,1],"rot": 0,"welds": [4,11]},{"type": "reinforced_hull","pos": [-1,1],"rot": 0,"welds": [5,12,21]},{"type": "reinforced_hull","pos": [0,1],"rot": 0,"welds": [6,20]},{"type": "reinforced_hull","pos": [1,1],"rot": 0,"welds": [7,13,22]},{"type": "reinforced_hull","pos": [2,1],"rot": 0,"welds": [8,14]},{"type": "reinforced_hull","pos": [3,1],"rot": 0,"welds": [9,15]},{"type": "reinforced_hull","pos": [4,1],"rot": 0,"welds": [18,19]},{"name": "RocketTwo","type": "rocket_launcher","pos": [-3,2],"rot": 0},{"name": "RocketThree","type": "rocket_launcher","pos": [-2,2],"rot": 0},{"name": "RocketFour","type": "rocket_launcher","pos": [-1,2],"rot": 0},{"name": "RocketSix","type": "rocket_launcher","pos": [1,2],"rot": 0},{"name": "RocketSeven","type": "rocket_launcher","pos": [2,2],"rot": 0},{"name": "RocketEight","type": "rocket_launcher","pos": [3,2],"rot": 0},{"name": "TopThrustLeft","type": "thruster","pos": [-4,2],"rot": 2},{"name": "BottomThrustLeft","type": "thruster","pos": [-4,0],"rot": 0},{"name": "TopThrustRight","type": "thruster","pos": [4,2],"rot": 2},{"name": "BottomThrustRight","type": "thruster","pos": [4,0],"rot": 0},{"name": "FrontRanger","type": "ranger","pos": [0,2],"rot": 0},{"type": "reinforced_hull","pos": [-1,0],"rot": 0,"welds": [23]},{"type": "reinforced_hull","pos": [1,0],"rot": 0,"welds": [24]},{"type": "hull","pos": [-1,-1],"rot": 0,"welds": [25]},{"type": "hull","pos": [1,-1],"rot": 0,"welds": [25]},{"name": "gyro","type": "gyroscope","pos": [0,-1],"rot": 0}]}

local turnLeft = false
local friendly = false

function Update()

local angVel = gyro:AngVel()

if FrontRanger:IsAlly() == true then

 friendly = true
 
end

if (FrontRanger:Range() > 0 and FrontRanger:IsAlly() == false) then
 TopThrustLeft:SetThrust(-angVel)  
 TopThrustRight:SetThrust(angVel)  
 BottomThrustLeft:SetThrust(angVel)  
 BottomThrustRight:SetThrust(-angVel) 


 RocketTwo:Fire()
 RocketThree:Fire()
 RocketFour:Fire()

 RocketSix:Fire()
 RocketSeven:Fire()
 RocketEight:Fire()


 
  if angVel > 0 then     
   turnLeft = false
  else  
   turnLeft = true
  end
  
  if FrontRanger.alive == false then
  RocketTwo:Fire() 
  RocketThree:Fire() 
  RocketFour:Fire() 
  RocketSix:Fire() 
  RocketSeven:Fire() 
  RocketEight:Fire()
  end
   
 else   
            
  local desiredAngVel = turnLeft and 45 or -45  

  TopThrustLeft:SetThrust(desiredAngVel - angVel)
  TopThrustRight:SetThrust(angVel - desiredAngVel)   
  BottomThrustLeft:SetThrust(angVel - desiredAngVel)
  BottomThrustRight:SetThrust(desiredAngVel - angVel)
 end
end