-
Notifications
You must be signed in to change notification settings - Fork 124
Creating a Ship
BenjaminAmos edited this page Mar 13, 2022
·
7 revisions
Every ship lives under the assets/ships/
directory, in it's own subfolder. To define a ship, you need to provide 3 files - a configuration file (shipName.json
), a ship icon (shipNameIcon.png
) and a texture (shipName.png
). As things stand, the texture is a power-of-two (128x128, 256x256 or 512x512, depending on the size of ship) coloured sprite with transparency, whereas the ship icon is a scaled down (32x32) white version of the texture.
Here is the JSON file for Imperial Tiny, which we'll be using as an example.
The configuration is a JSON file, consisting of the following attributes:
-
size
: A float representing the scale of the ship sprite in-game. -
maxLife
: An integer representing the maximum hp of the ship. -
type
: A string representing the class of the ship. All ships will have the "std" type, whereas the Capital ships will have the "big" type. -
price:
An integer representing how expensive ship is in-game. -
ability
: A JSON object of the form described in this wiki page. -
displayName
: A string representing the user-friendly name of the ship. -
engine
: A fully qualified (for instance,core:imperialEngine
) engine name. -
particleEmitters
: see here -
gunSlots
: Normalised coordinates of the guns. You can get the normalised positions by dividing the x coordinate of the pixel you choose by the width of the texture and the y coordinate by the height. There can be up to two gun slots in a ship. -
rigidBody
: The collision hull of the ship. See Creating Collision Meshes for more information.