John Watson
14e1f0fcc6
Render tilemap when camera outside of world bounds, layer wrapping
...
Prior to this change, TilemapLayers always restricted themselves to
rendering strictly within the world bounds. If the camera was allowed
to go beyond the world bounds, then the tilemap would appear to stop
scrolling once the camera hit the world edge. This allows the tilemap
to continue scrolling, showing empty space beyond the edge of the map.
Additionally, when the new "wrap" parameter is true, the tilemap will
render its opposite edge in the empty space. This simulates the map as
if it was the surface of a toroid (donut) rather than a flat plane.
2014-05-27 14:51:44 -07:00
photonstorm
65022ccc55
Blank Tilemaps no longer create null
tiles, but instead create Tile objects with an index of -1 which can be replaced and updated like any other tile.
...
Tilemap.fill would throw an error if called on a blank tilemap full of null values (thanks @DrHackenstein, fix #761 )
2014-04-28 02:42:38 +01:00
Christian Wesselhoeft
89a1639952
Fix jshint issues in src/tilemap
2014-03-25 14:56:04 -07:00
Christian Wesselhoeft
61f18b675c
Trim trailing whitespace.
2014-03-25 14:56:04 -07:00
photonstorm
26a89f0b84
New build files with tilemap callback fixes in.
2014-03-24 01:39:09 +00:00
photonstorm
e1c98ba617
You can now create multiple blank layers in a Tilemap.
2014-03-23 23:58:01 +00:00
Richard Davey
eddf1edead
Tilemap updates
2014-03-23 10:35:31 +00:00
photonstorm
539d70d581
Testing multi layer blank map updates.
2014-03-22 08:33:38 +00:00
photonstorm
0fa54b0b24
TileSprites now emit outOfBounds and enterBounds events accordingly.
...
TileSprites working with physics bodies again.
2014-03-21 18:04:24 +00:00
photonstorm
0e29bd4300
Tile Collision Callbacks working properly. CSV / Blank map examples added. Multiple tilesets per map working again. That's it folks!
2014-03-14 04:21:56 +00:00
photonstorm
f3ff9c197f
Fixed all the tilemap examples.
2014-03-14 03:26:06 +00:00
photonstorm
017a017b96
TilemapLayer.getRayCastTiles will let you get all tiles that hit the given line for further processing.
...
Fixed Tilemap collision. Added new TILE_BIAS const to aid with fast/small sprites.
2014-03-14 02:33:58 +00:00
photonstorm
f678d1fd31
Line now has x, y, width, height, top, bottom, left and right properties, so you can effectively get its bounds.
2014-03-14 00:19:45 +00:00
photonstorm
5297497632
Tilemap collision finally getting closer.
2014-03-13 22:49:08 +00:00
photonstorm
e955145707
Added p2 kill and reset test + nearing completion on tilemap collision.
2014-03-13 21:14:18 +00:00
photonstorm
c8e63582a4
Lots of small tweaks to pass jshint.
2014-03-13 16:49:52 +00:00
photonstorm
3e93f24583
New split physics system is implemented. Still tidying-up, but ArcadePhysics, P2 and Ninja Physics are in and configured. Lots more examples required, and tilemap collision mostly broken in Arcade at the moment. Time to implement in Ninja.
2014-03-06 06:29:19 +00:00
photonstorm
5a6ae5f696
Tilemap.putTile now correctly re-calculates the collision data based on the new collideIndexes array ( fixes #371 )
...
Tilemap.putTile can now insert a tile into a null/blank area of the map (before it could only replace existing tiles)
2014-03-04 03:08:35 +00:00
photonstorm
d8f5832fa2
Completely empty Tilemaps can now be created. This allows for dynamic map generation at runtime.
...
Loads of updates across most the Tilemap files. Not finished yet, still CSV loading to do and a multi-tileset issue to resolve, but it's a lot more flexible now.
2014-03-03 05:19:46 +00:00
photonstorm
418a161b46
Testing webgl debug overlay.
2014-03-02 20:51:44 +00:00
photonstorm
09d4a35b7f
Fixed issue where Phaser.Canvas.create would always make a screencanvas for CocoonJS, but that should only happen once. New parameter toggles it.
2014-02-28 03:55:06 +00:00
photonstorm
994eaff92b
StateManager fixes for when you change state in the create function.
...
TilemapLayer update for WebGL.
2014-02-26 00:58:19 +00:00
photonstorm
0896c2fac7
Updating copyright year and README.
2014-02-05 16:54:59 +00:00
photonstorm
45b6d5a741
Removed: Debug.renderSpriteTouching, Debug.renderLocalTransformInfo, Debug.renderWorldTransformInfo, Debug.renderSpriteCollision and Debug.dumpLinkedList.
...
Debug.renderPhysicsBody(body, color) is extremely useful for debugging the new physics bodies. Will draw the outline + points in the color given.
Debug.renderBodyInfo(sprite, x, y, color) will display lots of Sprite body data.
2014-01-31 05:42:20 +00:00
photonstorm
13a86765cb
Phaser.CANVAS_PX_ROUND is a boolean. If 'true' the Canvas renderer will Math.floor() all coordinates before drawImage, stopping pixel interpolation. Defaults to false.
...
Phaser.CANVAS_CLEAR_RECT is a boolean. If 'true' (the default) it will context.clearRect() every frame. If false this is skipped (useful if you know you don't need it)
Collision now works between Sprites positioned via sprite.x/y, sprite.body.x/y or sprite.body.velocity.
If you are tweening a sprite and still want physics collision, set `sprite.body.moves = false` otherwise it will fight against the tween motion.
2014-01-31 04:14:02 +00:00
photonstorm
68b7d22e0d
Fixed issue with the camera being slightly out of sync with 'fixedToCamera' sprites. Also fixed 'jitter' issue with camera targets.
2014-01-31 03:32:12 +00:00
photonstorm
6e4e99f436
Added Game Update loop step debugging - has proved utterly invaluable! Resolved camera jitter issues, gravity / downward force on tile/boundary issues and most tilemap collision issues.
2014-01-31 02:06:45 +00:00
photonstorm
651858372c
Added Game core loop stepping support. Super-useful for debugging, and helped me track down the issue with jittery physics collision. Double-win!
2014-01-29 17:10:13 +00:00
photonstorm
bd66be1804
Updated Tilemap classes and further tests.
2014-01-14 22:34:41 +00:00
photonstorm
e7c2b6ae9c
Fixed nearly all of the tilemap examples to use the new tilemap system.
2014-01-14 00:31:58 +00:00
photonstorm
bf72b4d3b0
Tilemap.createFromObjects can now turn a bunch of Tiled objects into Sprites in one single call, and copies across all properties as well.
2013-12-22 04:27:12 +00:00
photonstorm
63d90a0176
Sprites that are fixedToCamera can now be input dragged regardless of world position.
2013-12-22 03:46:08 +00:00
photonstorm
352749e803
Collision commands in and working. Updated sci-fly example. Multiple layers rendering. Mixed tile size on one layer rendering, but collision is grid bound.
2013-12-19 05:09:49 +00:00
photonstorm
4c7a4ebf62
Tiled map loader now working much better, rendering, layering properly.
2013-12-19 03:49:28 +00:00
photonstorm
b2c680811b
New unified Tiled loader.
2013-12-18 13:02:01 +00:00
photonstorm
50eee95c99
Improved TilemapLayer rendering and debug rendering significantly. Cleared out some old assets and added a new map.
2013-12-18 00:44:04 +00:00
photonstorm
896e9af9f5
TilemapLayers now render tiles correctly, with our without debugging overlay. Collision working well across single and index ranges.
2013-12-17 05:07:00 +00:00
photonstorm
669570c701
Tidying up the examples and more Tilemap work.
2013-12-10 12:23:42 +00:00
photonstorm
af5847e8e4
Tilemap and game core loop updates.
2013-12-09 16:40:48 +00:00
photonstorm
886618c056
Tilemap collision fixed, regardless of rotation, number of overlapping tiles and speed (to a point anyway). Maps also don't crash if they are smaller than the render area. Layers can be positioned successfully anywhere in camera but collision isn't yet offset for this.
2013-12-06 04:34:27 +00:00
photonstorm
ea3802a556
Lots of new tilemap code in here. If your game relies on tilemaps then please don't update to this commit unless you want to help debugging!
2013-12-05 18:12:16 +00:00
Josh Shepard (jcs)
539dcdd18a
move 'dirty' flag for Tilemap to a per-layer flag. Fixes #242
2013-12-04 09:42:25 -08:00
Josh Shepard (jcs)
2b99cb4be4
move TilemapLayer positioning/rendering to postUpdate to be in line with ‘normal’ Sprites.
...
reverts e91d40b9fc
- fix was incorrect & regressed fixedToCamera Sprites’ & TilemapLayer positioning.
Fixes #237
2013-11-30 17:40:24 -08:00
photonstorm
a9a46bfbbf
Lots of documentation updates and new Loader examples.
2013-11-27 16:33:49 +00:00
photonstorm
299115ca5d
The entire Phaser library has been updated to match the new JSHint configuration.
2013-11-25 04:40:04 +00:00
photonstorm
13a2cc2feb
Updating all files to adhere to the JSHint settings and fixing lots of documentation errors on the way.
2013-11-25 03:13:04 +00:00
Richard Davey
ebe441666c
BitmapData object added
2013-11-13 20:57:09 +00:00
Josh Shepard
b35da01cfc
Added scrollFactorX/scrollFactorY to TilemapLayers - controls rate of movement of layers as a factor of camera position
2013-11-07 10:44:04 -08:00
photonstorm
3c164b466c
* Updated: event.preventDefault() has been added to all Mouse event handlers.
...
* Updated: Sprite.deltaX/Y removed due to non-use. prevX/Y values moved to Sprite._cache.prevX/Y.
* Updated: Due to missing extends parameter the Sprite prototype was picking up functions from classes it never meant to (Button, TilemapLayer), now fully isolated.
2013-11-01 02:07:21 +00:00
photonstorm
a814cc26cc
* Fixed issue 135 - Added typeof checks into most ArcadePhysics functions to avoid errors with zero values.
...
* Fixed issue 136 - distanceTo using worldX/Y instead of x/y.
2013-10-28 10:17:36 +00:00