Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add layer offsets, dynamic object/tile creation, isometric support, and TexturePacker support #1

Merged
merged 141 commits into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
f4d16df
Add layer offsets to objects and tiles
timothymtorres Jan 10, 2019
d462a3b
Add layer offsets to polygon objects
timothymtorres Jan 10, 2019
b17c034
Add isometric and isometric staggered Tiled map support
timothymtorres Jan 10, 2019
169d9e4
Change getObjects method to filter by objType or name or by both
timothymtorres Jan 10, 2019
678bf93
Remove map:getObject method
timothymtorres Jan 10, 2019
1877e0e
Change map:getObjects to return unpacked table
timothymtorres Jan 10, 2019
99b4974
Add map:createObject method
timothymtorres Jan 12, 2019
b21679d
Add map:addLayer method
timothymtorres Jan 12, 2019
a57aa34
Fix addLayer not returning layer
timothymtorres Jan 12, 2019
e5b85a8
Refactor module to use metatable
timothymtorres Jan 13, 2019
99164c0
Change Map.__index to be next to Map module
timothymtorres Jan 13, 2019
a42e73a
Refactor createObject function to be a Map method
timothymtorres Jan 13, 2019
10638f1
Clean variables, print statements, and offset addition
timothymtorres Jan 13, 2019
34424c3
Change a couple of minor things
timothymtorres Jan 13, 2019
9db6028
Remove unneeded gid variable
timothymtorres Jan 13, 2019
9747932
Move tile creation function into it's own local method
timothymtorres Jan 13, 2019
3175ad3
Change map.group:insert to be declared after if loop
timothymtorres Jan 13, 2019
c78227f
Change createTile to be a Map method
timothymtorres Jan 13, 2019
7712efb
Fix createTile method
timothymtorres Jan 13, 2019
84fa5c7
Add map position offsets to createTile method
timothymtorres Jan 13, 2019
1b41b03
Change offsets to appear at bottom of createObject function
timothymtorres Jan 13, 2019
14c4b8a
Fix some formating and variable naming
timothymtorres Jan 13, 2019
1dfca12
Add function to copy Map class methods to map display group
timothymtorres Jan 13, 2019
2ccf8c3
Remove dead code
timothymtorres Jan 13, 2019
faf9502
Add Texture Packer sprites to createObject method
timothymtorres Jan 14, 2019
53ede88
Fix getObjects not matching name or objType properly
timothymtorres Jan 24, 2019
fd9f3fe
Fix Berry code styling and format
timothymtorres Jan 28, 2019
8fbfef3
Refactor tileset variable to be declared in one line
timothymtorres Jan 28, 2019
26b9778
Change objectgroup layer to use layer.type variable
timothymtorres Jan 28, 2019
2cf5a85
Change layer offset to be applied to layer x/y
timothymtorres Jan 28, 2019
df1d539
Refactor isometric math to be simpler and shorter
timothymtorres Jan 28, 2019
90022fb
Add support for isometric maps
ldurniat Jan 28, 2019
d12de80
Fix example
ldurniat Jan 28, 2019
aa47822
Merge remote-tracking branch 'origin/master'
timothymtorres Jan 29, 2019
b3d86d4
Fix code going past 80 character horizontal limit
timothymtorres Jan 29, 2019
b563c5c
Change naming conventions for functions, variables, and constants
timothymtorres Jan 29, 2019
d4069d6
Fix more naming for variables
timothymtorres Jan 29, 2019
75b5a3e
Remove directory arg from loadTileset
timothymtorres Jan 31, 2019
a1b0ea6
Remove loadTileset arg comment
timothymtorres Jan 31, 2019
b99fc79
Add getImageSheet and getTile local functions
timothymtorres Jan 31, 2019
65c8443
Change getTile to getImageTile
timothymtorres Jan 31, 2019
3ecd46d
Remove loadTileset from Map:createTile
timothymtorres Jan 31, 2019
5e720d5
Fix comments for getImageTile
timothymtorres Jan 31, 2019
32f227a
Change getImageSheet to return nil if tileset image sheet not supported
timothymtorres Jan 31, 2019
1b74f7c
Change getImageTile to getTileImage
timothymtorres Jan 31, 2019
9f948c8
Add getImageSheet and getTileImage to Map:createObject
timothymtorres Jan 31, 2019
0f1ca21
Remove loadTileset function
timothymtorres Jan 31, 2019
4005379
Add createImageSheet function
timothymtorres Feb 1, 2019
56ef60d
Change getImageSheet to support texturepacker tilesets
timothymtorres Feb 1, 2019
faf5e10
Refactor isoToScreen function to have local x and y variables
timothymtorres Feb 1, 2019
16802ca
Remove whitespace
timothymtorres Feb 1, 2019
b4f4876
Fix getImageSheet ternary operator always returning nil
timothymtorres Feb 2, 2019
626a89d
Add LuaFileSystem (lfs) to berry
timothymtorres Feb 2, 2019
c801521
Change path variable to be renamed json_path in Map:new
timothymtorres Feb 2, 2019
28005d4
Add texturepacker_dir arg to Map:new
timothymtorres Feb 2, 2019
b930d5a
Add .lua file pattern matching for texturepacker directory
timothymtorres Feb 2, 2019
cc94940
Add require_path to subsitute / and \ for .
timothymtorres Feb 2, 2019
b9a6b4d
Rename lua file type variable
timothymtorres Feb 2, 2019
5b9d55c
Fix require_path having file_extension at the end of path
timothymtorres Feb 2, 2019
9b3db5d
Refactor TexurePacker tileset creation into function
timothymtorres Feb 2, 2019
87f0ea5
Change variable names in texturepacker to be short
timothymtorres Feb 2, 2019
49c61a2
Fix comments for texturepacker function
timothymtorres Feb 2, 2019
17516fd
Fix require_path using systemDirectory
timothymtorres Feb 2, 2019
b20ba5c
Remove print statements
timothymtorres Feb 3, 2019
e29b54f
Add pcall to createTexturepackerTilesets
timothymtorres Feb 3, 2019
d41c5fc
Add comments and clearer variable name
timothymtorres Feb 3, 2019
0b6f687
Shorten variable name
timothymtorres Feb 3, 2019
60e218a
Shorten code comments
timothymtorres Feb 3, 2019
bc17851
Remove error_msg from pcall
timothymtorres Feb 3, 2019
cc1db1e
Add createImageSheet to createTExturepackerTilesets method
timothymtorres Feb 3, 2019
148a13c
Change function name createTexturepackerTilesets to loadTexturePacker
timothymtorres Feb 3, 2019
ff6b0be
Change variable names around
timothymtorres Feb 3, 2019
0ee4fca
Setting up texturepacker to use image_sheets table properly
timothymtorres Feb 4, 2019
da96b1c
Remove dead code
timothymtorres Feb 4, 2019
cd486ad
Add assert for duplicate names for image_sheets
timothymtorres Feb 4, 2019
cfaf66a
Add loadTilesets function back
timothymtorres Feb 4, 2019
facd7e1
Add tilesets arg to loadTilesets function
timothymtorres Feb 4, 2019
a7ce220
Add comments and spacing
timothymtorres Feb 4, 2019
65b1eb1
Add gid to image_sheets table
timothymtorres Feb 4, 2019
718f19d
Fix loadTilesets to use correct lastgid
timothymtorres Feb 4, 2019
49eca1e
Fix tileset name not loading image sheet
timothymtorres Feb 9, 2019
985ccb5
Change getImageSheet to use id arg
timothymtorres Feb 9, 2019
30ed533
Change getImageSheet arg to use gid
timothymtorres Feb 9, 2019
fc3591b
Change function name getTileImage to getImageInfo
timothymtorres Feb 10, 2019
b4419c1
Add image_info table that stores image info
timothymtorres Feb 10, 2019
f2bb96f
Fix getImageInfo to use gid for it's arg
timothymtorres Feb 10, 2019
e87f2a1
Change image_sheets and image_info tables to be image_cache
timothymtorres Feb 10, 2019
26cd4b3
Add tileset to image_cache
timothymtorres Feb 10, 2019
94526a5
Fix image_info to be image_cache
timothymtorres Feb 10, 2019
a40e554
Change getTilesetFromGID to do a direct table lookup in image_cache
timothymtorres Feb 10, 2019
6d78e66
Remove findLastGID
timothymtorres Feb 10, 2019
0c1a450
Change getTIlesetFromGID to getTileset
timothymtorres Feb 10, 2019
e9d9492
Remove dead tileset code
timothymtorres Feb 10, 2019
a6e7705
Change image_cache to be a map instance variable
timothymtorres Feb 10, 2019
7ee6213
Fix image_cache in function args
timothymtorres Feb 10, 2019
4220e56
Fix inherit function to work properly
timothymtorres Feb 10, 2019
21dc003
Remove setupDisplayGroup function and replace with inherit function
timothymtorres Feb 10, 2019
5f88273
Add assert for cache id duplicates
timothymtorres Feb 10, 2019
99e1edf
Remove print statements and shorten variable names
timothymtorres Feb 10, 2019
1dcebac
Add addTexturePack method to Map
timothymtorres Feb 10, 2019
5dde718
Fix cache to be map.image_cache
timothymtorres Feb 10, 2019
472e62c
Fix addTexturePack crashing if .lua file extension present
timothymtorres Feb 10, 2019
8e867b5
Add fileExists helper function
timothymtorres Feb 11, 2019
d8d9a0c
Remove fileExists function and replace with a simple one liner
timothymtorres Feb 11, 2019
a02431e
Add addSprite method to insert texturepacker images
timothymtorres Feb 11, 2019
039688e
Fix sprite creation to account for isometric orientation
timothymtorres Feb 11, 2019
6ce0a87
Change createObject and createTIle methods to be local functions
timothymtorres Feb 11, 2019
267f40c
Fix doc comments for functions
timothymtorres Feb 11, 2019
2cc6f54
Fix layer being a string value in addSprite method
timothymtorres Feb 12, 2019
7aba178
Add cacheTexturePack function
timothymtorres Feb 12, 2019
7475e70
Change tileset to be renamed texture_pack in loadTexturePacker
timothymtorres Feb 12, 2019
e9526ab
Change getImageInfo to getImagePath and getImageSize
timothymtorres Feb 12, 2019
1fabbf3
Remove path variable from texturepacker sprite
timothymtorres Feb 12, 2019
4f569b6
Remove texture_pack file name variable
timothymtorres Feb 12, 2019
934c123
Refactor buildSequence logic to be shorter
timothymtorres Feb 13, 2019
f41ba43
Fix sprite animation to play properly via gid
timothymtorres Feb 13, 2019
0fd1dd9
Fix sprites from crashing if they don't have a name
timothymtorres Feb 13, 2019
e3f29a1
Fix Texturepacker sprites to offset accordingly based on map
timothymtorres Feb 13, 2019
74511e3
Fix texturepacker directory to load correctly
timothymtorres Feb 13, 2019
f211f7f
Remove unneccasary code and whitespace
timothymtorres Feb 13, 2019
cac0a05
Change getImageFile to getMatchingImage
timothymtorres Feb 13, 2019
e04643f
Remove map json
timothymtorres Feb 13, 2019
3efb405
Remove extra test files that were inserted by mistake
timothymtorres Feb 13, 2019
acde24c
Change README.md to reflect new features
timothymtorres Feb 13, 2019
c4f1bbd
Fix names for width and height of tiles from collection of images.
ldurniat Feb 15, 2019
10845ee
Fix position for new added objects
ldurniat Feb 16, 2019
4402002
Fix centering with isometric staggered maps
timothymtorres Feb 17, 2019
e3d8716
Refactor isoToScreen to use map argument
timothymtorres Feb 17, 2019
c5093a0
Simplification of isoToScreen function
ldurniat Feb 17, 2019
488a72f
Fix TexturePacker addSprite position issues
timothymtorres Feb 17, 2019
efb6c17
Fix staggered isometric maps tile positions
timothymtorres Feb 17, 2019
1a17918
Update README.md with list of supporting features
timothymtorres Feb 17, 2019
e35c259
Fix merge conflict
timothymtorres Feb 18, 2019
32c71b7
Remove test files and textures
timothymtorres Feb 18, 2019
861dfd2
Remove test map from game.lua
timothymtorres Feb 18, 2019
b70983f
Fix Map:extend applying plugin to single image instead of multiple
timothymtorres Feb 20, 2019
c3cf6c2
Fix incorrect GID for non-consecutive tile ids
ldurniat Feb 21, 2019
33b9c10
Fix inheritance of properties from Tiled objects
ldurniat Feb 21, 2019
0cbe8d1
Fix incorrect inheritance from Map object due to changes in inherit f…
ldurniat Feb 21, 2019
47058bc
Use more descriptive name for sequence
ldurniat Feb 21, 2019
e88bc4c
Merge branch 'master' into master
ldurniat Feb 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function scene:create( event )
local sceneGroup = self.view -- Add scene display objects to this group

-- Load our map
map = berry.new( 'map/level.json', 'map' )
map = berry:new( 'map/level.json', 'map' )
scene.view:insert( map )

end
Expand Down
Loading