S&box Wiki

Revision Difference

Making_Gamemode#547830

<cat>Code.Game</cat> <title>Creating A Game</title> Before creating a game you should have an adequate coding workspace setup, the easiest is <page>Setting up Visual Studio</page> but you can get others working with additional setup. # Create addon # Creating a minimal game You create new addons from the editor, go to `Addons -> Create New...`, create a new game addon, you can place this wherever you want on your disk. <upload src="a5727/8d9de839fcae5cd.png" size="1774" name="image.png" /> <upload src="a768a/8da7b505bff18ee.png" size="38366" name="sbox-dev_OxmTlKox2C.png" /> # Code Once you make your addon your code is accessible through your Visual Studio solution, the easiest way to open it is through your editor. <upload src="a768a/8da7b50a6f333c3.png" size="8119" name="sbox-dev_tcXU4Efpqn.png" /> By default, there is basic code for a game that spawns a pawn. # Content All your content can go in folders within your addon folder. * `addons/myaddon/config` - for <page text="fgd">Linking Entities to Hammer</page> files or for defining custom asset types * `addons/myaddon/fonts` - fonts here are automatically loaded and available for usage in UI * `addons/myaddon/materials` * `addons/myaddon/models` * `addons/myaddon/particles` * `addons/myaddon/shaders` - shaders placed in here are automatically compiled * `addons/myaddon/sounds`