share/hedgewars/Data/Maps/Knockball/map.lua
changeset 4517 0618b31023dc
parent 4506 37744d5c877e
child 7777 e0be9fbc21b4
equal deleted inserted replaced
4516:ecf012a762d8 4517:0618b31023dc
    34 
    34 
    35 function onGearAdd(gear)
    35 function onGearAdd(gear)
    36 	if GetGearType(gear) == gtShover then
    36 	if GetGearType(gear) == gtShover then
    37 		ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0)
    37 		ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0)
    38 		if ball ~= nil then
    38 		if ball ~= nil then
    39 			CopyPV2(gear, ball)
    39 			local dx, dy = GetGearVelocity(gear)
       
    40 			SetGearVelocity(ball, dx * 2, dy * 2)
    40 			SetState(ball, 0x200) -- temporary - might change!
    41 			SetState(ball, 0x200) -- temporary - might change!
    41 			SetTag(ball, 8) -- baseball skin
    42 			SetTag(ball, 8) -- baseball skin
    42 			FollowGear(ball)
    43 			FollowGear(ball)
    43 		end
    44 		end
    44 	end
    45 	end