├── Assets ├── Actors │ ├── afternoon_sky.xml │ ├── ai_teapot.xml │ ├── grid.xml │ ├── light.xml │ ├── music.xml │ ├── player_teapot.xml │ ├── remote_teapot.xml │ └── sphere.xml ├── Art │ ├── Grid.bmp │ ├── Gridalpha.bmp │ ├── Sky2_E.JPG │ ├── Sky2_N.JPG │ ├── Sky2_S.JPG │ ├── Sky2_U.JPG │ ├── Sky2_W.JPG │ ├── Teapot.sdkmesh │ ├── grid.dds │ ├── grid_nomips.dds │ ├── sphere.blend │ ├── sphere.sdkmesh │ ├── sphere.x │ └── texture.dds ├── Audio │ ├── Sources.txt │ ├── SpaceGod7-Level2.ogg │ ├── blip.ogg │ ├── blip.wav │ ├── blip16.wav │ ├── computerbeep3.ogg │ └── computerbeep3.wav ├── Config │ └── physics.xml ├── Editor │ └── components.xml ├── Effects │ ├── GameCode4.fx │ ├── GameCode4_PS.hlsl │ ├── GameCode4_VS.hlsl │ └── LineDraw.hlsl ├── Scripts │ ├── ActorManager.lua │ ├── DebugBrain.lua │ ├── DecisionTreeBrain.lua │ ├── Events.lua │ ├── HardCodedBrain.lua │ ├── LevelInit.lua │ ├── LevelPostInit.lua │ ├── PreInit.lua │ ├── TeapotAi.lua │ ├── TeapotBrains.lua │ ├── TeapotStates.lua │ ├── TeapotWars.deproj │ └── test.lua ├── Strings │ └── English.xml └── World │ ├── World.xml │ └── WorldInstances.xml ├── COPYING.txt ├── Extra └── UtilityDemo │ ├── PreInit.lua │ ├── UtilityDemo.deproj │ ├── UtilityDemo.exe │ └── utility.lua ├── Game ├── Assets.zip ├── EditorOptions.xml ├── Logging.xml ├── PlayerOptions.xml └── UI │ ├── DXUTShared.fx │ ├── Font.dds │ ├── arrow.x │ └── dxutcontrols.dds ├── README.txt └── Source ├── GCC4 ├── AI │ ├── Pathing.cpp │ └── Pathing.h ├── Actors │ ├── Actor.cpp │ ├── Actor.h │ ├── ActorComponent.h │ ├── ActorFactory.cpp │ ├── ActorFactory.h │ ├── AmmoPickup.cpp │ ├── AmmoPickup.h │ ├── AudioComponent.cpp │ ├── AudioComponent.h │ ├── BaseScriptComponent.cpp │ ├── BaseScriptComponent.h │ ├── HealthPickup.cpp │ ├── HealthPickup.h │ ├── PhysicsComponent.cpp │ ├── PhysicsComponent.h │ ├── PickupInterface.h │ ├── RenderComponent.cpp │ ├── RenderComponent.h │ ├── RenderComponentInterface.h │ ├── ScriptComponentInterface.h │ ├── TransformComponent.cpp │ └── TransformComponent.h ├── Audio │ ├── Audio.cpp │ ├── Audio.h │ ├── DirectSoundAudio.cpp │ ├── DirectSoundAudio.h │ ├── SoundProcess.cpp │ ├── SoundProcess.h │ ├── SoundResource.cpp │ └── SoundResource.h ├── Debugging │ ├── Debugging.cpp │ ├── Logger.cpp │ ├── Logger.h │ ├── MemoryWatcher.h │ ├── MiniDump.cpp │ └── MiniDump.h ├── EventManager │ ├── EventManager.cpp │ ├── EventManager.h │ ├── EventManagerImpl.cpp │ ├── EventManagerImpl.h │ ├── Events.cpp │ └── Events.h ├── GameCode4 │ ├── BaseGameLogic.cpp │ ├── BaseGameLogic.h │ ├── GameCode.cpp │ ├── GameCode.h │ ├── GameCode4.cpp │ └── interfaces.h ├── Graphics2D │ ├── Font.cpp │ ├── Font.h │ ├── Sprite.cpp │ └── Sprite.h ├── Graphics3D │ ├── D3DRenderer.cpp │ ├── D3DRenderer.h │ ├── Geometry.cpp │ ├── Geometry.h │ ├── Lights.cpp │ ├── Lights.h │ ├── Material.cpp │ ├── Material.h │ ├── Mesh.cpp │ ├── Mesh.h │ ├── MovementController.cpp │ ├── MovementController.h │ ├── Raycast.cpp │ ├── Raycast.h │ ├── Scene.cpp │ ├── Scene.h │ ├── SceneNodes.cpp │ ├── SceneNodes.h │ ├── Shaders.cpp │ ├── Shaders.h │ ├── Sky.cpp │ └── Sky.h ├── LUAScripting │ ├── LuaStateManager.cpp │ ├── LuaStateManager.h │ ├── ScriptEvent.cpp │ ├── ScriptEvent.h │ ├── ScriptEventListener.cpp │ ├── ScriptEventListener.h │ ├── ScriptExports.cpp │ ├── ScriptExports.h │ ├── ScriptProcess.cpp │ ├── ScriptProcess.h │ ├── ScriptResource.cpp │ └── ScriptResource.h ├── Mainloop │ ├── Initialization.cpp │ ├── Initialization.h │ ├── Process.cpp │ ├── Process.h │ ├── ProcessManager.cpp │ └── ProcessManager.h ├── Memory │ ├── MemoryMacros.h │ ├── MemoryPool.cpp │ └── MemoryPool.h ├── Msvc │ ├── GameCode.ico │ ├── GameCode4_2015.cpp │ ├── GameCode4_2015.h │ ├── GameCode4_2015.ico │ ├── GameCode4_2015.rc │ ├── GameCode4_2015.sln │ ├── GameCode4_2015.vcxproj │ ├── GameCode4_2015.vcxproj.filters │ ├── GameCode4_2015.vcxproj.user │ ├── GameCodeStd.cpp │ ├── GameCodeStd.h │ ├── ReadMe.txt │ ├── Resource.h │ ├── small.ico │ └── targetver.h ├── Multicore │ ├── CriticalSection.h │ ├── RealtimeProcess.cpp │ ├── RealtimeProcess.h │ └── SafeStream.h ├── Network │ ├── Network.cpp │ └── Network.h ├── Physics │ ├── Physics.cpp │ ├── Physics.h │ ├── PhysicsDebugDrawer.cpp │ ├── PhysicsDebugDrawer.h │ ├── PhysicsEventListener.cpp │ └── PhysicsEventListener.h ├── ResourceCache │ ├── ResCache.cpp │ ├── ResCache.h │ ├── XmlResource.cpp │ ├── XmlResource.h │ ├── ZipFile.cpp │ └── ZipFile.h ├── UserInterface │ ├── HumanView.cpp │ ├── HumanView.h │ ├── MessageBox.cpp │ ├── MessageBox.h │ └── UserInterface.h └── Utilities │ ├── Math.cpp │ ├── Math.h │ ├── Math_Random.cpp │ ├── PrimeSearch.cpp │ ├── PrimeSearch.h │ ├── String.cpp │ ├── String.h │ ├── templates.h │ └── types.h ├── GCC4Editor ├── EditorApp │ ├── ActorComponentEditor.cs │ ├── ActorCreationForm.Designer.cs │ ├── ActorCreationForm.cs │ ├── ActorCreationForm.resx │ ├── ActorPropertiesForm.Designer.cs │ ├── ActorPropertiesForm.cs │ ├── ActorPropertiesForm.resx │ ├── EditorForm.Designer.cs │ ├── EditorForm.cs │ ├── EditorForm.resx │ ├── EngineDisplayForm.Designer.cs │ ├── EngineDisplayForm.cs │ ├── EngineDisplayForm.resx │ ├── GCC4EditorDLL_2015.dll │ ├── MessageHandler.cs │ ├── NativeMethods.cs │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── TeapotWarsEditorApp_2015.csproj │ ├── TeapotWarsEditorApp_2015.csproj.user │ ├── XPathUtility.cs │ ├── ZipFileUtility.cs │ └── app.config ├── GCC4EditorDLL │ ├── Editor.aps │ ├── Editor.cpp │ ├── Editor.h │ ├── Editor.ico │ ├── Editor.rc │ ├── EditorGlobalFunctions.cpp │ ├── EditorGlobalFunctions.h │ ├── EditorHumanView.cpp │ ├── EditorHumanView.h │ └── resource.h └── Msvc │ ├── GCC4EditorDLL.cpp │ ├── GCC4EditorDLL_2015.vcxproj │ ├── GCC4EditorDLL_2015.vcxproj.filters │ ├── GCC4EditorDLL_2015.vcxproj.user │ ├── GCC4EditorStd.cpp │ └── GCC4EditorStd.h └── TeapotWars ├── Msvc ├── ReadMe.txt ├── Resource.h ├── TeapotResources.h ├── TeapotWars.h ├── TeapotWars.rc ├── TeapotWarsStd.cpp ├── TeapotWarsStd.h ├── TeapotWars_2015.cpp ├── TeapotWars_2015.h ├── TeapotWars_2015.ico ├── TeapotWars_2015.rc ├── TeapotWars_2015.sln ├── TeapotWars_2015.vcxproj ├── TeapotWars_2015.vcxproj.filters ├── TeapotWars_2015.vcxproj.user ├── small.ico ├── stdafx.cpp ├── stdafx.h ├── targetver.h └── teapot.ico ├── TeapotController.cpp ├── TeapotController.h ├── TeapotEvents.cpp ├── TeapotEvents.h ├── TeapotWars.cpp ├── TeapotWarsNetwork.h ├── TeapotWarsView.cpp └── TeapotWarsView.h /Assets/Actors/afternoon_sky.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | art\sky2_n.JPG 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/Actors/ai_teapot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Box 11 | glass 12 | Normal 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Assets/Actors/grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Box 10 | Infinite 11 | Normal 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | art\grid.dds 20 | 100 21 | 22 | 23 | -------------------------------------------------------------------------------- /Assets/Actors/light.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Assets/Actors/music.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | audio\spacegod7-level2.ogg 4 | 1 5 | 5.0 6 | 7 | 8 | -------------------------------------------------------------------------------- /Assets/Actors/player_teapot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Box 10 | glass 11 | Normal 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Assets/Actors/remote_teapot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Box 10 | glass 11 | Normal 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | -------------------------------------------------------------------------------- /Assets/Actors/sphere.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sphere 9 | pine 10 | Bouncy 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Assets/Art/Grid.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Grid.bmp -------------------------------------------------------------------------------- /Assets/Art/Sky2_E.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Sky2_E.JPG -------------------------------------------------------------------------------- /Assets/Art/Sky2_N.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Sky2_N.JPG -------------------------------------------------------------------------------- /Assets/Art/Sky2_S.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Sky2_S.JPG -------------------------------------------------------------------------------- /Assets/Art/Sky2_U.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Sky2_U.JPG -------------------------------------------------------------------------------- /Assets/Art/Sky2_W.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Sky2_W.JPG -------------------------------------------------------------------------------- /Assets/Art/Teapot.sdkmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/Teapot.sdkmesh -------------------------------------------------------------------------------- /Assets/Art/grid.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/grid.dds -------------------------------------------------------------------------------- /Assets/Art/grid_nomips.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/grid_nomips.dds -------------------------------------------------------------------------------- /Assets/Art/sphere.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/sphere.blend -------------------------------------------------------------------------------- /Assets/Art/sphere.sdkmesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/sphere.sdkmesh -------------------------------------------------------------------------------- /Assets/Art/texture.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Art/texture.dds -------------------------------------------------------------------------------- /Assets/Audio/Sources.txt: -------------------------------------------------------------------------------- 1 | blip.wav http://www.a1freesoundeffects.com/ Downloaded Wed, June 23, 2004 2 | computerbeep3.wav http://www.a1freesoundeffects.com/ Downloaded Wed, June 23, 2004 3 | SpaceGod7-Level2.mp3 http://www.themysterioush.net/ Submitted by the Artist known as 'the mysterious h' -------------------------------------------------------------------------------- /Assets/Audio/SpaceGod7-Level2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Audio/SpaceGod7-Level2.ogg -------------------------------------------------------------------------------- /Assets/Audio/blip.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Audio/blip.ogg -------------------------------------------------------------------------------- /Assets/Audio/blip.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Audio/blip.wav -------------------------------------------------------------------------------- /Assets/Audio/blip16.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Audio/blip16.wav -------------------------------------------------------------------------------- /Assets/Audio/computerbeep3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Audio/computerbeep3.ogg -------------------------------------------------------------------------------- /Assets/Audio/computerbeep3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikeMcShaffry/gamecode4/5837cbc520c9625d6b9f7301690d88efc1808a48/Assets/Audio/computerbeep3.wav -------------------------------------------------------------------------------- /Assets/Config/physics.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 0.0013 18 | 1.000 19 | 20 | 21 | 0.0100 22 | 23 | 24 | 0.0170 25 | 0.3500 26 | 0.5000 27 | 0.8300 28 | 1.100 29 | 30 | 31 | 1.060 32 | 1.800 33 | 34 | 35 | 2.400 36 | 2.650 37 | 2.450 38 | 4.500 39 | 3.350 40 | 9.800 41 | 1.750 42 | 2.320 43 | 8.550 44 | 8.640 45 | 8.400 46 | 4.580 47 | 1.950 48 | 7.100 49 | 2.200 50 | 0.800 51 | 8.900 52 | 8.750 53 | 3.510 54 | 2.900 55 | 1.800 56 | 2.600 57 | 2.950 58 | 2.550 59 | 19.30 60 | 5.200 61 | 21.60 62 | 7.200 63 | 7.750 64 | 2.400 65 | 11.34 66 | 3.200 67 | 7.420 68 | 1.740 69 | 2.720 70 | 13.54 71 | 10.20 72 | 8.900 73 | 21.45 74 | 0.860 75 | 2.650 76 | 2.300 77 | 2.750 78 | 10.50 79 | 0.970 80 | 7.800 81 | 2.700 82 | 1.200 83 | 6.120 84 | 7.350 85 | 4.500 86 | 19.22 87 | 18.70 88 | 5.960 89 | 1.800 90 | 1.320 91 | 7.050 92 | 93 | 0.000 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Assets/Editor/components.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Assets/Effects/GameCode4_PS.hlsl: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: GameCode4_PS.hlsl - the pixel shader for GameCode4 (D3D11 renderer) 3 | // 4 | // Part of the GameCode4 Application 5 | // 6 | // GameCode4 is the sample application that encapsulates much of the source code 7 | // discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | // "Rez" Graham, published by Charles River Media. 9 | // ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | // 11 | // If this source code has found it's way to you, and you think it has helped you 12 | // in any way, do the authors a favor and buy a new copy of the book - there are 13 | // detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | // by clicking here: 15 | // http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | // 17 | // There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | // 19 | // The source code is managed and maintained through Google Code: 20 | // http://code.google.com/p/gamecode4/ 21 | // 22 | // (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | // 24 | // This program is free software; you can redistribute it and/or 25 | // modify it under the terms of the GNU Lesser GPL v3 26 | // as published by the Free Software Foundation. 27 | // 28 | // This program is distributed in the hope that it will be useful, 29 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | // http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | // 33 | // You should have received a copy of the GNU Lesser GPL v3 34 | // along with this program; if not, write to the Free Software 35 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | // 37 | //-------------------------------------------------------------------------------------- 38 | 39 | //-------------------------------------------------------------------------------------- 40 | // Globals 41 | //-------------------------------------------------------------------------------------- 42 | cbuffer cbObjectColors : register( b0 ) 43 | { 44 | float4 g_vDiffuseObjectColor : packoffset( c0 ); 45 | float4 g_vAmbientObjectColor : packoffset( c1 ); 46 | bool g_bHasTexture : packoffset( c2.x ); 47 | }; 48 | 49 | 50 | 51 | //-------------------------------------------------------------------------------------- 52 | // Textures and Samplers 53 | //-------------------------------------------------------------------------------------- 54 | Texture2D g_txDiffuse : register( t0 ); 55 | SamplerState g_samLinear : register( s0 ); 56 | 57 | //-------------------------------------------------------------------------------------- 58 | // Input / Output structures 59 | //-------------------------------------------------------------------------------------- 60 | struct PS_INPUT 61 | { 62 | float4 vDiffuse : COLOR0; 63 | float2 vTexcoord : TEXCOORD0; 64 | }; 65 | 66 | //-------------------------------------------------------------------------------------- 67 | // Pixel Shader 68 | //-------------------------------------------------------------------------------------- 69 | float4 GameCode4_PSMain( PS_INPUT Input ) : SV_TARGET 70 | { 71 | float4 vOutputColor; 72 | 73 | if (g_bHasTexture) 74 | vOutputColor = g_txDiffuse.Sample( g_samLinear, Input.vTexcoord ) * Input.vDiffuse; 75 | else 76 | vOutputColor = Input.vDiffuse; 77 | 78 | return vOutputColor; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /Assets/Scripts/DebugBrain.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- DebugBrain.lua : A brain for debugging the AI 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | require("Scripts\\TeapotBrains.lua"); 40 | require("Scripts\\TeapotStates.lua"); 41 | 42 | ----------------------------------------------------------------------------------------------------------------------- 43 | -- DebugBrain 44 | -- This is a brain used for debugging. If you want to lock the teapot into doing just a single thing to debug some 45 | -- action or state, this is the brain to use. 46 | ----------------------------------------------------------------------------------------------------------------------- 47 | DebugBrain = class(TeapotBrain, 48 | { 49 | -- 50 | }); 51 | 52 | function DebugBrain:Think() 53 | return WatchPlayerState; 54 | end 55 | 56 | -------------------------------------------------------------------------------- /Assets/Scripts/Events.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- Events.lua : Defines event handler delegate functions for events 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | function OnPhysicsCollision(eventData) 40 | g_actorMgr:OnPhysicsCollision(eventData); 41 | end 42 | 43 | function OnFireWeapon(eventData) 44 | g_actorMgr:OnFireWeapon(eventData); 45 | end 46 | 47 | function RegisterListeners() 48 | if (EventType.EvtData_PhysCollision ~= nil) then 49 | RegisterEventListener(EventType.EvtData_PhysCollision, OnPhysicsCollision); 50 | end 51 | 52 | if (EventType.EvtData_Fire_Weapon ~= nil) then 53 | RegisterEventListener(EventType.EvtData_Fire_Weapon, OnFireWeapon); 54 | end 55 | end 56 | 57 | -------------------------------------------------------------------------------- /Assets/Scripts/HardCodedBrain.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- HardCodedBrain.lua : Implements a brain using hard-coded logic 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | require("Scripts\\TeapotBrains.lua"); 40 | require("Scripts\\TeapotStates.lua"); 41 | 42 | ----------------------------------------------------------------------------------------------------------------------- 43 | -- HardCodedBrain - Chapter 18, page 620 44 | -- This is the hard-coded brain. It just takes what it needs from the gamestate and does some simple hard-coded logic 45 | -- to find the appropriate state. 46 | ----------------------------------------------------------------------------------------------------------------------- 47 | HardCodedBrain = class(TeapotBrain, 48 | { 49 | -- 50 | }); 51 | 52 | function HardCodedBrain:Think() 53 | local playerPos = Vec3:Create(g_actorMgr:GetPlayer():GetPos()); 54 | local pos = Vec3:Create(self._teapot:GetPos()); 55 | local diff = playerPos - pos; 56 | 57 | -- player close 58 | if (diff:Length() < 20) then 59 | -- hit points low, run 60 | if (self._teapot.hitPoints <= 1) then 61 | return RunAwayState; 62 | -- hit points not low, attack 63 | else 64 | return AttackState; 65 | end 66 | 67 | -- player not close, resume patrol 68 | else 69 | return PatrolState; 70 | end 71 | 72 | end 73 | 74 | -------------------------------------------------------------------------------- /Assets/Scripts/LevelInit.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- LevelInit.lua : A script that's executed when the level is initializing 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | require("scripts\\ActorManager.lua"); 40 | 41 | ----------------------------------------------------------------------------------------------------------------------- 42 | -- Global actor manager - Chapter 21, page 738 43 | ----------------------------------------------------------------------------------------------------------------------- 44 | g_actorMgr = ActorManager:Create(); 45 | 46 | 47 | ----------------------------------------------------------------------------------------------------------------------- 48 | -- constructor / destructor functions for actors 49 | ----------------------------------------------------------------------------------------------------------------------- 50 | function AddPlayer(scriptObject) 51 | g_actorMgr:AddPlayer(scriptObject); 52 | end 53 | 54 | function RemovePlayer(scriptObject) 55 | g_actorMgr:RemovePlayer(scriptObject); 56 | end 57 | 58 | function AddEnemy(scriptObject) 59 | g_actorMgr:AddEnemy(scriptObject); 60 | end 61 | 62 | function RemoveEnemy(scriptObject) 63 | g_actorMgr:RemoveEnemy(scriptObject); 64 | end 65 | 66 | function AddSphere(scriptObject) 67 | g_actorMgr:AddSphere(scriptObject); 68 | end 69 | 70 | function RemoveSphere(scriptObject) 71 | g_actorMgr:RemoveSphere(scriptObject); 72 | end 73 | 74 | 75 | ----------------------------------------------------------------------------------------------------------------------- 76 | -- Debug stuff 77 | ----------------------------------------------------------------------------------------------------------------------- 78 | function ShowPlayerOrientation() 79 | print("Player Orientation: " .. g_actorMgr:GetPlayer():GetYOrientationRadians()); 80 | end 81 | 82 | function SetPlayerOrientation(radians) 83 | g_actorMgr:GetPlayer():RotateY(radians); 84 | end 85 | 86 | -------------------------------------------------------------------------------- /Assets/Scripts/LevelPostInit.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- ActorManager.lua : Executed after initializing the level 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | require("scripts\\Events.lua"); 40 | 41 | RegisterListeners(); 42 | 43 | -------------------------------------------------------------------------------- /Assets/Scripts/TeapotAi.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- TeapotAi.lua : Defines the state machine for AI teapots 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | require("Scripts\\TeapotStates.lua"); 40 | require("Scripts\\TeapotBrains.lua"); 41 | 42 | ----------------------------------------------------------------------------------------------------------------------- 43 | -- State machine - Chapter 18, page 616 44 | ----------------------------------------------------------------------------------------------------------------------- 45 | TeapotStateMachine = class(nil, 46 | { 47 | _teapot = nil, 48 | _currentState = nil, 49 | _brain = nil, 50 | }); 51 | 52 | function TeapotStateMachine:Destroy() 53 | self._currentState = nil; 54 | self._brain = nil; 55 | end 56 | 57 | function TeapotStateMachine:SetState(newState) 58 | if (self._currentState == nil or not self._currentState:IsInstance(newState)) then 59 | self:_InternalSetState(newState); 60 | end 61 | end 62 | 63 | function TeapotStateMachine:ChooseBestState() 64 | if (self._brain) then 65 | local newState = self._brain:Think(); 66 | 67 | if (newState ~= nil) then 68 | print("Teapot chose " .. newState.name); 69 | else 70 | print("Teapot chose nil"); 71 | end 72 | 73 | self:SetState(newState); 74 | end 75 | end 76 | 77 | function TeapotStateMachine:Update(deltaMs) 78 | if (self._currentState) then 79 | self._currentState:Update(deltaMs); 80 | end 81 | end 82 | 83 | function TeapotStateMachine:_InternalSetState(newState) 84 | self._currentState = newState:Create({_teapot = self._teapot}); 85 | self._currentState:Init(); 86 | end 87 | 88 | -------------------------------------------------------------------------------- /Assets/Scripts/TeapotBrains.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- TeapotBrains.lua : Base class for teapot brains 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | require("Scripts\\TeapotStates.lua"); 40 | 41 | 42 | ----------------------------------------------------------------------------------------------------------------------- 43 | -- TeapotBrain base class 44 | -- This is the base class for teapot brains. It defines the interface for all decision making that teapots can do. 45 | -- the Think() function is called from the TeapotStateMachine.UpdateState() function whenever a decision needs to be 46 | -- made. It returns a new state for the teapot. Note how the base class throws an error. This is the closest we can 47 | -- get to a pure virtual function; it defines the interface and requires subclasses to define the implementation. 48 | -- It's not perfect, but it beats the generic "attempting to call nil value" error. 49 | ----------------------------------------------------------------------------------------------------------------------- 50 | TeapotBrain = class(nil, 51 | { 52 | _teapot = nil, 53 | }); 54 | 55 | function TeapotBrain:Init() 56 | return true; 57 | end 58 | 59 | function TeapotBrain:Think() 60 | error("Calling unimplemented base class version of TeapotBrain.Think()"); 61 | end 62 | 63 | -------------------------------------------------------------------------------- /Assets/Scripts/TeapotWars.deproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ActorManager.lua 5 | 6 | 7 | DebugBrain.lua 8 | 9 | 10 | DecisionTreeBrain.lua 11 | 12 | 13 | Events.lua 14 | 15 | 16 | HardCodedBrain.lua 17 | 18 | 19 | LevelInit.lua 20 | 21 | 22 | LevelPostInit.lua 23 | 24 | 25 | PreInit.lua 26 | 27 | 28 | TeapotAi.lua 29 | 30 | 31 | TeapotBrains.lua 32 | 33 | 34 | TeapotStates.lua 35 | 36 | 37 | test.lua 38 | 39 | 40 | -------------------------------------------------------------------------------- /Assets/Scripts/test.lua: -------------------------------------------------------------------------------- 1 | --======================================================================== 2 | -- tests.lua : General testing & debugging functions 3 | -- 4 | -- Part of the GameCode4 Application 5 | -- 6 | -- GameCode4 is the sample application that encapsulates much of the source code 7 | -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David 8 | -- "Rez" Graham, published by Charles River Media. 9 | -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 10 | -- 11 | -- If this source code has found it's way to you, and you think it has helped you 12 | -- in any way, do the authors a favor and buy a new copy of the book - there are 13 | -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com 14 | -- by clicking here: 15 | -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= 16 | -- 17 | -- There's a companion web site at http://www.mcshaffry.com/GameCode/ 18 | -- 19 | -- The source code is managed and maintained through Google Code: 20 | -- http://code.google.com/p/gamecode4/ 21 | -- 22 | -- (c) Copyright 2012 Michael L. McShaffry and David Graham 23 | -- 24 | -- This program is free software; you can redistribute it and/or 25 | -- modify it under the terms of the GNU Lesser GPL v3 26 | -- as published by the Free Software Foundation. 27 | -- 28 | -- This program is distributed in the hope that it will be useful, 29 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 31 | -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. 32 | -- 33 | -- You should have received a copy of the GNU Lesser GPL v3 34 | -- along with this program; if not, write to the Free Software 35 | -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 36 | -- 37 | --======================================================================== 38 | 39 | print("Loading script"); 40 | 41 | function TestEventHandler(eventData) 42 | print("Event Received in Lua: " .. eventData); 43 | eventData = eventData + 1; 44 | QueueEvent(EventType.EvtData_ScriptEventTest_FromLua, eventData); 45 | end 46 | 47 | function RegisterListener() 48 | RegisterEventListener(EventType.EvtData_ScriptEventTest_ToLua, TestEventHandler); 49 | end 50 | 51 | 52 | 53 | TestScriptProcess = class(ScriptProcess, 54 | { 55 | count = 0; 56 | }); 57 | 58 | function TestScriptProcess:OnInit() 59 | print("OnInit()"); 60 | end 61 | 62 | function TestScriptProcess:OnUpdate(deltaMs) 63 | self.count = self.count + 1; 64 | print("Count: " .. self.count); 65 | 66 | if self.count >= 5 then 67 | self:Succeed(); 68 | end 69 | end 70 | 71 | function TestScriptProcess:OnSuccess() 72 | print("Success!!"); 73 | end 74 | 75 | function TestScriptProcess:OnFail() 76 | print("Something failed"); 77 | end 78 | 79 | 80 | 81 | function TestProcess() 82 | parent = TestScriptProcess:Create({frequency = 1000}); 83 | child = TestScriptProcess:Create({frequency = 500}); 84 | parent:AttachChild(child); 85 | AttachProcess(parent); 86 | end 87 | 88 | RegisterListener(); 89 | 90 | print("Script loaded"); 91 | 92 | -------------------------------------------------------------------------------- /Assets/Strings/English.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Assets/World/World.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | 25 |