DownloadsGet the Castle client.Frequently Asked QuestionsLearn more about Castle.ExamplesUse this list of examples to bootstrap your game.Quick StartGet started in under 5 minutes.Creating an AccountWhy and how to create a Castle account.Make Your First GameFollow this small tutorial to get oriented with a basic workflow.Describe your Game with a Castle Project FileThis tutorial will provide an overview and motivation for a project file.Adding Games to your ProfileShare games you made by adding them to your profile on Castle.Hosting Your Own GamesLearn how to add games to Castle which are hosted on another service.Game Dimensions and ScalingChange the dimensions and scaling behavior of your Castle game.Manually Make a New Castle Game from ScratchAn educational resource for advanced usersCastle Project File ReferenceThe project file contains the title, description and other metadata about your game.User API ReferenceGet information about users playing your game.Post API ReferenceIntegrate with Castle's post system.Storage API ReferenceStore shared or per-user data in the cloud.Game API ReferenceNavigate to or get information about other games on Castle.UI API ReferenceDisplay user interface elements such as buttons and text boxes that allow users to interact with your game.System API ReferenceGet information about or perform activities relating to the system Castle is running on.Code Loading API ReferenceLow-level functionality for loading Lua code over the network.Community Reference LinksUseful community links for learning about Lua and LÖVE.

Manually Make a New Castle Game from Scratch

By The Castle Team // 6-19-2019
This tutorial describes how to manually make a Castle game from scratch. If you're new to Castle, you'll probably find it easier to start by following these instructions. This tutorial exists mostly as an educational reference, explaining what's going on in the details of the new project creation process.

Minimal Example

The absolute minimum that you need in Castle is just a text file with Lua code in it. You typically also will want a .castle file for metadata as well, but it's not strictly necessary just to play around.
To construct a minimal example, put a new text file somewhere that Castle can load it. This would often be in a new directory on your local filesystem but its possible to post it at a URL on the web or anywhere else. You can name this file anything, but let's call it main.lua which is the standard thing to do by convention.
Put this Lua code in your text file


(Optional) Dot Castle Files

If you want a metadata file, you can make one. Call it something like mygame.castle. You can make "mygame" whatever you want, but make sure you give it the .castleextension.
Put this in your .castlefile:

main: main.lua
title: My Game
owner: mycastleusername
primaryColor: ffcc00
coverImage: screenshot.png
description: A description of my game