bcvery1 / tilepix Goto Github PK
View Code? Open in Web Editor NEWLibrary for combining tiled maps with pixel
License: MIT License
Library for combining tiled maps with pixel
License: MIT License
Need functions which accepts a pixel.Rect
/.Circle
/.Vec
, and returns a list of point objects which it collides with
Should extract and provide polyline objects
All layers (<- needs confirmation confirmed) can have x and y offsets. These need to be handled when drawing and (for object layers) returning objects positions
Currently all external data (images, tilesets etc) will be read from disk.
If a user wishes to use bindata for example (excellent package, highly recommended!), they will still need to separately distribute the tilesets and images.
Should expose a function to allow users to provide a function to use to get assets, which, if not set, defaults to os.Open...
Unknown if group layers will require extra functionality requirements. Test with group layers (included nested group layers) and create issues where needed
test
Needs to handle and draw text objects
There are three methods for Map
:
func GetImageLayerByName(name string)
func GetLayerByName(name string)
func GetObjectLayerByName(name string)
Which have been put in the wrong place. Using the coding standards, move these to the correct place in the file.
Need to fill all functions with appropriate logging.
This must follow the coding standards RE logging
Check the decodePoints
function then has test coverage
Hopefully relatively simply adding point objects to test assets, but if this does not work, further changes may be necessary
Should include all things done in release 0.2.0
Write in the wiki
Currently each time Draw
is called on a layer, it will check if the batch is initialised, clear the batch, then draw each tile.
If tiles never change, the two latter steps are unneeded. Layers should be 'static' as default, meaning they are never automatically marked dirty (except with animated panels, but that will be dealt with in #25 and is out of scope for this change).
Only layers which get marked "dirty" by the user (or later on by reading animated panels) should clear and redraw to the batch each time Draw
is called
There are magic numbers introduced by 7cc72b0
This may need quite a bit of shifting of code to establish why the tiles are being shifted left a tile width and down half a tile height.
Should be able to get objects by properties. This should be on ObjectGroup
and Map
Should include all things done in release 0.4.0
Write in wiki
When a map is marked as infinite, Tiled models it in 50x50 (need to confirm this is constant, but the size of the map is the size of the chunks) tile chunks.
These chunks are effectively tilelayers, but have a x and y position. Should be able to reimplement the tilelayer functionality on chunks, but also taking account for the x, y offsets.
Basic tests are coming in at ~20fps on a powerful GPU. This needs to increased by a minimum of 4 times (on average).
Probably doing unnecessary loops or reloading sprites - hopefully workable efficiencies will be easy to come by
Coding standards require all exported variables, constants and functions to had a doc string. The tmx package currently does not reach this standard.
Map
has a property Infinite
, currently this is of int
type, but should be bool
Should be able to read and store object layer data
Should be able to read and store info about image layers
Should provide a function to draw a layer
Need to handle and draw tile objects. Object layers can have an object called a tile
, taken from a TileSet.
The original architectural plan for TilePix has changed, and it now makes sense to have a file for each major type, then renaming tmx.go
-> tilepix.go
for anything non-type specific
Should include all things done in release 0.3.0
Write in the wiki
Placeholder for releasing version 0.2.0 of the library.
Need functions which accepts a pixel.Rect
/.Circle
/.Vec
, and returns a list of rectangle objects which it collides with
Error type
s should end in Error
.
Error var
iables should start with Err
This is for GoLint. The coding standards need updating too
Should extract and provide polygon objects
A tile layer is currently called Layer
, this would be clearer as TileLayer
Note: this is already in the file tilelayer.go
Placeholder for releasing version 0.1.0 of the library.
World files are an advanced option of Tiled which allow multiple tmx files to be associated with offsets. We should be able to read these files and load the maps
TileSets can have margins and tile spacing. This is currently unhandled, so tile sprites will be incorrect if either of these values are set.
The calculation is done in utilities.go
, but the calling code is in tile.go
in the function Draw
which already takes a *Tileset
parameter, shouldn't be difficult to calculate the offsets
Need functions which accepts a pixel.Rect
/.Circle
/.Vec
, and returns a list of polygon objects which it collides with
Need functions which accepts a pixel.Rect
/.Circle
/.Vec
, and returns a list of circle objects which it collides with
Need two functions to get objects by name. Object names are not necessarily unique so the signatures should be:
func (m *Map) GetObjectByName(name string) []*Object {}
func (og *ObjectGroup) GetObjectByName(name string) []*Object {}
Placeholder for releasing version 0.3.0 of the library.
README should be updated
The Map
object currently has a bounds()
method, this should be exported.
In addition, should add a new method Centre() pixel.Vec
- which should return the centre of the bounds (use the public function mentioned above)
Need to introduce tests for these functions.
Not going to support infinite maps until a later version, should return an error if a map read is infinite.
Do this by checking the properties on map. If infinite
is not 0
, return an error
Need a logo; maybe pixelated tiles? Something simple
This needs to go on the README
TilePix has not been tested using multiple tilesets. This should be something which is tested (manually and with test assets!) to ensure at the very least a sensible error is returned, but ideally that it is handled correctly.
If any sort of code change is required, should be created in a separate issue first, this issue is for investigation only.
Map
needs to have a method to retrieve a layer by name.
It should check layers, object layers and image layers.
Should include all things done in release 0.1.0
Write in wiki
Prerequisites:
The Stringer
interface has one function:
String() string
Every struct in tmx.go
should implement this interface to make logging cleaner
Needs to be in new file, the struct should implement Stringer
, as the other objects do.
Add a test tmx file to testdata and ensure it is read. Also need additional test file with any specific LayerGroup
exported functions tested (String()
excluded).
Struct should have the following methods:
String() string
- returns human readable representation of the objectsetParent(*Map)
- sets the parent map, and sets parent map of all children, where appropriateGetXLayerByName(string) X
- same as those on Map
, need to be able to get all three layer typesShould be able to draw layers to pixel batches and provide a function to draw each layer
Placeholder for releasing version 0.4.0 of the library.
Add travis and sonarqube for PR checking
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.