Giter Club home page Giter Club logo

tilepix's People

Contributors

aerth avatar bcvery1 avatar ilmanzo avatar objarni avatar perber avatar pierredavidbelanger avatar svera avatar u5surf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tilepix's Issues

Handle layer offsets when drawing

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

Get input by alternative methods

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...

Test group layers

Unknown if group layers will require extra functionality requirements. Test with group layers (included nested group layers) and create issues where needed

Move map methods

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.

Add logging

Need to fill all functions with appropriate logging.

This must follow the coding standards RE logging

Points code is untested

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

Give layers dirty flag

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

Remove magic numbers

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.

Handle infinite maps

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.

Massively improve fps

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

Add function docs to tmx package

Coding standards require all exported variables, constants and functions to had a doc string. The tmx package currently does not reach this standard.

Handle image layers

Should be able to read and store info about image layers
Should provide a function to draw a layer

Handle tile objects

Need to handle and draw tile objects. Object layers can have an object called a tile, taken from a TileSet.

Refactor into multiple files

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

Release v0.2.0

Placeholder for releasing version 0.2.0 of the library.

Rename layer

A tile layer is currently called Layer, this would be clearer as TileLayer

Note: this is already in the file tilelayer.go

Release v0.1.0

Placeholder for releasing version 0.1.0 of the library.

Handle world files

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

Handle tileset margins and spacing

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

Get objects by name

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 {}

Release v0.3.0

Placeholder for releasing version 0.3.0 of the library.

Write proper README

README should be updated

  • better introduction paragraph
  • motivation behind the library (mention Ludum Dare)
  • Links back to pixel repo
  • very basic example of code using the library (keep in mind, this is not a pixel tutorial!)
  • travis CI status badge

Map bounds

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.

Return error on infinite map

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

Create and add logo

Need a logo; maybe pixelated tiles? Something simple

This needs to go on the README

Investigate multiple tilesets

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.

Get layers by name

Map needs to have a method to retrieve a layer by name.

It should check layers, object layers and image layers.

Make repo public

Prerequisites:

  • code of conduct
  • contribution file
  • LICENCE file
  • bug template
  • PR template

Make all tmx structs Stringers

The Stringer interface has one function:
String() string

Every struct in tmx.go should implement this interface to make logging cleaner

Add layer group object

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 object
  • setParent(*Map) - sets the parent map, and sets parent map of all children, where appropriate
  • GetXLayerByName(string) X - same as those on Map, need to be able to get all three layer types

Release v0.4.0

Placeholder for releasing version 0.4.0 of the library.

Integrate CI apps

Add travis and sonarqube for PR checking

  • TravisCI
  • goreportcard
  • gitter
  • godoc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.