-
Notifications
You must be signed in to change notification settings - Fork 454
Level creation guide
To create a level, you'll first need to fork and clone this repository.
All levels in Journey to the Center of Hawkthorne are created using Tiled, a tile map editor. Levels are saved as .tmx files and located in the src/maps
directory. Once you've downloaded and installed Tiled, you should be able to open up the maps and look around
Levels are broken into object layers and tile layers. Tile layers are non-interactive and create the look and feel of the level. Object layers define abritrary interactive objects, such as doors.
A level can have any number of layers, but it must have one object layers named nodes
A node is an object that will be placed in the level. It can interact with the player, move around, and draw itself to the screen. Sprites, enemies, walls, floors and NPCs are represented as nodes.
A node's type determines it's behavior.
If your level has an object layer named wall, all objects in that layer, regardless of type, will be considered walls.
If your level has an object layer named floor, all objects in that layer, regardless of type, will be considered floors.
The game has a few builtin node types that should be enough to get you started
A sprite is an animated series of images. A sprite node needs the following object properties
-
image: path to the sprite sheet, relative to the
src
directory (Ex images/bartender.png) - width: the width of individual sprites inside the full image
- height: the height of individual sprites inside the full image
- animation: x,y where x and y can be grid values. To five frame in a row, the value would be '1-3, 1'. This value means that the animation consists of grid (1,1), (1,2) and (1,3).
Players can jump through floors, but they cannot fall through them. Floor nodes have no properties
Players can't jump through walls. Wall nodes have no properties.
-
level: name of the level to go to. Must have been loaded in
main.lua
- instant: if set, the player will enter the door as soon as they touch it
- renter: if set, the player will reenter the level at the last point, not start at the beginning
Creating your own nodes is easy. Create a .lua file in the /src/nodes
directory. This file must return a module that implements the following interface.
Node.new(tiled_object, collider)
Node:update(dt, player)
Node:keypressed(key)
Node:draw()
Node:collide(player, dt, wtv_x, wtv_y)
Node:collide_end(player, dt, wtv_x, wtv_y)
A good example of a node is either door.lua and sprite.lua
Make sure your level is being loaded in src/main.lua
.
function love.load()
...
Gamestate.load('studyroom', Level.new('mylevel.tmx'))
...
end
Make sure to load it as the studyroom. This is the first level in the game, so it will make testing easier.
Boot up the game and select a character. In the world map, select the studyroom. Your new level should now be loaded.
If you'd like to work on a level, take a look in the Level To Do Spreadsheet and sign up for a level.
Play Testing
Game Design
- Story Summary
- Gameflow
- NPC
- Enemies
- Camera
- Areas
- Inventory and Items
- Gameplay
- Interface
- Existing Characters and NPCs
- Frequently Asked Questions
- Future Episodes
Development Guides
- Creating a Release
- Level Creation
- Tileset Creation
- Character Creation
- Costume Creation
- Audio Creation
Episode Resources