share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua
changeset 7877 b3fb94986255
parent 7165 aad1aea05f1e
child 8043 da083f8d95e6
equal deleted inserted replaced
7876:a366fbe91b58 7877:b3fb94986255
    42 	-- add a new target gear
    42 	-- add a new target gear
    43 	gear = AddGear(0, 0, gtTarget, 0, 0, 0, 0)
    43 	gear = AddGear(0, 0, gtTarget, 0, 0, 0, 0)
    44 	
    44 	
    45 	-- move it to a random position within 0 and
    45 	-- move it to a random position within 0 and
    46 	-- LAND_WIDTH - the width of the map
    46 	-- LAND_WIDTH - the width of the map
    47 	FindPlace(gear, true, 0, LAND_WIDTH-1350)
    47 	FindPlace(gear, true, 0, LAND_WIDTH-326)
    48 	
    48 	
    49 	-- move the target to a higher vertical position
    49 	-- move the target to a higher vertical position
    50 	-- to ensure it's not somewhere down below
    50 	-- to ensure it's not somewhere down below
    51 	x, y = GetGearPosition(gear)
    51 	x, y = GetGearPosition(gear)
    52 	SetGearPosition(gear, x, 500)
    52 	SetGearPosition(gear, x, 0)
    53 end
    53 end
    54 
    54 
    55 -- This function is called before the game loads its
    55 -- This function is called before the game loads its
    56 -- resources.
    56 -- resources.
    57 -- It's one of the predefined function names that will
    57 -- It's one of the predefined function names that will
    85 
    85 
    86 	-- Create the player team
    86 	-- Create the player team
    87 	AddTeam(loc("Grenadiers"), 14483456, "Simple", "Island", "Default")
    87 	AddTeam(loc("Grenadiers"), 14483456, "Simple", "Island", "Default")
    88 	-- And add a hog to it
    88 	-- And add a hog to it
    89 	player = AddHog(loc("Nade Boy"), 0, 1, "war_grenadier1")
    89 	player = AddHog(loc("Nade Boy"), 0, 1, "war_grenadier1")
    90 	SetGearPosition(player, 1530, 1100)
    90 	SetGearPosition(player, 506, 76)
    91 end
    91 end
    92 
    92 
    93 -- This function is called when the round starts
    93 -- This function is called when the round starts
    94 -- it spawns the first target that has to be destroyed.
    94 -- it spawns the first target that has to be destroyed.
    95 -- In addition it shows the scenario goal(s).
    95 -- In addition it shows the scenario goal(s).