Edited wiki page LuaGuide through web user interface.
authorhenrik.rostedt
Mon, 15 Nov 2010 09:54:08 +0000
changeset 37 acd631a56390
parent 36 f66efe81d8c0
child 38 123cc75cbe6a
Edited wiki page LuaGuide through web user interface.
LuaGuide.wiki
--- a/LuaGuide.wiki	Sun Nov 14 23:34:50 2010 +0000
+++ b/LuaGuide.wiki	Mon Nov 15 09:54:08 2010 +0000
@@ -59,7 +59,7 @@
 end
 }}}
 
-If you are doing a Training or Campaign you should also set Seed, Map and Theme. But you must also add teams and hogs on this event. This is done by using !AddTeam and !AddHog. An example of adding one team with one hog:
+If you are doing a Training or Campaign you should also set Seed, Map and Theme. But you must also add teams and hogs on this event. This is done by using !AddTeam and !AddHog. An example of adding one team with one hog (these functions may only be used here):
 {{{
 AddTeam("Team", 14483456, "Simple", "Island", "Default")
 AddHog("Hedgehog", 0, 1, "NoHat")
@@ -89,4 +89,12 @@
 function onAmmoStoreInit()
     SetAmmo(amShotgun, 9, 0, 0, 0)
 end
-}}}
\ No newline at end of file
+}}}
+
+== Gears everywhere ==
+
+Mostly everything in Hedgewars are made op of gears: grenades, bazooka shells, and cake just to name a few. But these are just the visible gears, the whip's affect and wind change are also gears. But for now we will focus on the more concrete ones.
+
+The hogs are gears too and when you shoot with bazooka the bazooka shell will be created and explode when it hits the ground. When the shell is created the onGearAdd event is called and the gear parameter will be the bazooka. And when it hits the ground, before the gear has been deleted onGearDelete is invoked with the shell as parameter, after that it is removed.
+
+The last event handler onGameTick is called every game tick, that is every millisecond which is a thousand times a second. These three event handlers are the core in the script and where most of the code goes.