S&box Wiki

Revision Difference


<cat>Code.Game</cat>⤶ <title>Creating A Game</title>⤶ ⤶ <warning>⤶ <key>LEGACY</key>⤶ This article is no longer up to date, consider <page>Your First Project</page>⤶ </warning>⤶ ⤶ 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.⤶ ⤶ # Creating a minimal game⤶ ⤶ You create new project from the editor, go to `Project-> Create New...`, create a new game project, 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 project 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 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`⤶ * `addons/myaddon/sounds`