Skip to content

Commit

Permalink
Published to PyPi
Browse files Browse the repository at this point in the history
  • Loading branch information
kfields committed Apr 21, 2020
1 parent 33d9fcc commit e54c87d
Show file tree
Hide file tree
Showing 285 changed files with 3,459 additions and 1,115 deletions.
95 changes: 76 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tyled :butterfly:

CLI utility for generating Tiled Tilesets
CLI utility for generating [Tiled](https://www.mapeditor.org/) Tilesets

## Quick Links

Expand All @@ -22,10 +22,6 @@ If you don't already have it installed go to https://pypi.org/project/pipx/ for

pipx install tyled

#### And then run it!

tyled run


### From GitHub

Expand All @@ -49,26 +45,87 @@ Install required packages

pip install -r requirements.txt

## Commands

## Usage
### Bake

Activate the virtual environment, if not already active
tyled bake example.toml [--save/--no-save][--show/--no-show][--rotation/--no-rotation]

cd tyled
source env/bin/activate
Run the game
#### Options

Default options are --save, --no-show, --no-rotation

## Projects

Tyled Projects are defined using TOML files.

All Projects must at least have a name and type

```toml
name = 'mycollection'
type = 'collection'
```

### Options

Options may be defined within the project file. Any options defined here will override the command line options

```toml
[options]
rotation = true
```

## Tilesets

Tyled currently supports three different kinds of Tilesets:

### Collection Tileset

A Collection Tileset is composed of tiles with images stored in separate files

```toml
name = 'collection'
type = 'collection'

firstgid = 1
source = 'sticker-knight/map'
```

This example will generate {name}.tsx in the current working directory

### Orthogonal Tileset

An Orthogonal Tileset is composed of tiles that have the same dimensions in one image file

```toml
name = 'orthogonal'
type = 'orthogonal'

firstgid = 1
source = 'platformer/tiles'
tilewidth = 128
tileheight = 128
spacing = 0
margin = 0
columns = 12
```

python run_game.py
This example will generate {name}.tsx and {name}.png in the current working directory

## Controls
### Atlas Tileset

### Movement
An Atlas Tileset is composed of tiles that do not have the same dimensions in one image file

WASD + cursor keys
Press down to mount/dismount
Press up to do an Ollie! :)
```toml
name = 'atlas'
type = 'atlas'

### Pause/Menu
firstgid = 0
source = 'sticker-knight/map'
width = 1024
height = 1024
spacing = 0
margin = 0
```

Escape key
This example will generate {name}.tsx and {name}.png in the current working directory
Binary file added assets/atlas.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions assets/atlas.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name = 'atlas'
type = 'atlas'

firstgid = 0
source = 'sticker-knight/map'
width = 1024
height = 1024
spacing = 0
margin = 0
266 changes: 266 additions & 0 deletions assets/atlas.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset
version="1.2"
tiledversion="1.3.3"
name="atlas"
tilewidth="0"
tileheight="0"
tilecount="62"
columns="0"
margin="0"
spacing="0"
>

<image source="atlas.png" width="1024" height="1024"/>


<tile id="0" type="alter">
<image x="572" y="704" width="160" height="192" source="atlas.png"/>
</tile>

<tile id="1" type="backgroundArch">
<image x="0" y="109" width="135" height="115" source="atlas.png"/>
</tile>

<tile id="2" type="backgroundMountain">
<image x="0" y="884" width="380" height="140" source="atlas.png"/>
</tile>

<tile id="3" type="backgroundTower">
<image x="764" y="692" width="129" height="332" source="atlas.png"/>
</tile>

<tile id="4" type="backgroundTree">
<image x="896" y="303" width="109" height="177" source="atlas.png"/>
</tile>

<tile id="5" type="blobBlue">
<image x="640" y="640" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="6" type="blobGreen">
<image x="576" y="384" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="7" type="blue">
<image x="576" y="448" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="8" type="bombStroked">
<image x="135" y="96" width="96" height="128" source="atlas.png"/>
</tile>

<tile id="9" type="castleWall">
<image x="96" y="436" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="10" type="cloud">
<image x="380" y="896" width="384" height="128" source="atlas.png"/>
</tile>

<tile id="11" type="column1">
<image x="893" y="832" width="128" height="192" source="atlas.png"/>
</tile>

<tile id="12" type="column2">
<image x="893" y="640" width="128" height="192" source="atlas.png"/>
</tile>

<tile id="13" type="doorBlueStroked">
<image x="0" y="692" width="160" height="192" source="atlas.png"/>
</tile>

<tile id="14" type="doorGreenStroke">
<image x="160" y="692" width="160" height="192" source="atlas.png"/>
</tile>

<tile id="15" type="doorRedStroked">
<image x="320" y="512" width="160" height="192" source="atlas.png"/>
</tile>

<tile id="16" type="doorStroked">
<image x="480" y="512" width="160" height="192" source="atlas.png"/>
</tile>

<tile id="17" type="earthWall">
<image x="701" y="128" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="18" type="earthWall2">
<image x="743" y="192" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="19" type="exit">
<image x="0" y="500" width="160" height="192" source="atlas.png"/>
</tile>

<tile id="20" type="flare">
<image x="380" y="704" width="192" height="192" source="atlas.png"/>
</tile>

<tile id="21" type="gemBlueStroked">
<image x="672" y="0" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="22" type="gemRedStroked">
<image x="736" y="0" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="23" type="grassLarge">
<image x="0" y="0" width="224" height="32" source="atlas.png"/>
</tile>

<tile id="24" type="grassSmall">
<image x="224" y="0" width="160" height="32" source="atlas.png"/>
</tile>

<tile id="25" type="grey">
<image x="737" y="64" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="26" type="hero">
<image x="896" y="480" width="128" height="160" source="atlas.png"/>
</tile>

<tile id="27" type="keyGreenStroked">
<image x="384" y="0" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="28" type="keyRedStroked">
<image x="480" y="0" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="29" type="keyYellowStroked">
<image x="231" y="96" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="30" type="platform1">
<image x="192" y="224" width="192" height="64" source="atlas.png"/>
</tile>

<tile id="31" type="platform2">
<image x="0" y="32" width="192" height="64" source="atlas.png"/>
</tile>

<tile id="32" type="platform3">
<image x="192" y="32" width="192" height="64" source="atlas.png"/>
</tile>

<tile id="33" type="platform4">
<image x="231" y="160" width="192" height="64" source="atlas.png"/>
</tile>

<tile id="34" type="platformBase1">
<image x="640" y="544" width="256" height="96" source="atlas.png"/>
</tile>

<tile id="35" type="platformBase2">
<image x="640" y="448" width="256" height="96" source="atlas.png"/>
</tile>

<tile id="36" type="platformBase3">
<image x="160" y="416" width="256" height="96" source="atlas.png"/>
</tile>

<tile id="37" type="platformBase4">
<image x="0" y="320" width="256" height="96" source="atlas.png"/>
</tile>

<tile id="38" type="platformBlock1">
<image x="416" y="288" width="128" height="96" source="atlas.png"/>
</tile>

<tile id="39" type="platformBlock2">
<image x="384" y="64" width="128" height="96" source="atlas.png"/>
</tile>

<tile id="40" type="platformBlock3">
<image x="423" y="192" width="128" height="96" source="atlas.png"/>
</tile>

<tile id="41" type="platformBlock4">
<image x="544" y="288" width="128" height="96" source="atlas.png"/>
</tile>

<tile id="42" type="platformConnector1">
<image x="0" y="436" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="43" type="platformConnector2">
<image x="576" y="35" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="44" type="platformConnector3">
<image x="605" y="128" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="45" type="platformConnector4">
<image x="647" y="192" width="96" height="64" source="atlas.png"/>
</tile>

<tile id="46" type="pushBlock1">
<image x="800" y="352" width="96" height="96" source="atlas.png"/>
</tile>

<tile id="47" type="pushBlock2">
<image x="800" y="256" width="96" height="96" source="atlas.png"/>
</tile>

<tile id="48" type="pushBlock3">
<image x="551" y="192" width="96" height="96" source="atlas.png"/>
</tile>

<tile id="49" type="shadow">
<image x="800" y="0" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="50" type="shieldStroked">
<image x="512" y="99" width="93" height="93" source="atlas.png"/>
</tile>

<tile id="51" type="sign">
<image x="416" y="384" width="160" height="128" source="atlas.png"/>
</tile>

<tile id="52" type="skeleton">
<image x="160" y="532" width="133" height="160" source="atlas.png"/>
</tile>

<tile id="53" type="swordStroked">
<image x="0" y="224" width="192" height="96" source="atlas.png"/>
</tile>

<tile id="54" type="torch">
<image x="896" y="207" width="96" height="96" source="atlas.png"/>
</tile>

<tile id="55" type="trap">
<image x="736" y="660" width="128" height="32" source="atlas.png"/>
</tile>

<tile id="56" type="wallDecor1">
<image x="672" y="352" width="128" height="96" source="atlas.png"/>
</tile>

<tile id="57" type="wallDecor2">
<image x="672" y="256" width="128" height="96" source="atlas.png"/>
</tile>

<tile id="58" type="wallDecor3">
<image x="256" y="288" width="160" height="128" source="atlas.png"/>
</tile>

<tile id="59" type="window1">
<image x="672" y="64" width="65" height="64" source="atlas.png"/>
</tile>

<tile id="60" type="window2">
<image x="765" y="128" width="64" height="64" source="atlas.png"/>
</tile>

<tile id="61" type="window3">
<image x="327" y="101" width="56" height="59" source="atlas.png"/>
</tile>


</tileset>
Binary file added assets/atlas_rotation.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e54c87d

Please sign in to comment.