ios - Scrolling a Tilemap in Sprite-Kit (JSTileMap glitch) -
Since JSTileMap Expands Escondition, you use the API to move and enlarge your tilemap like any other node. can do. However, I continue this strange effect / glitch ...
code:
_tiledMap = [JSTileMap mapNamed: @ "Cloud.tmx"]; If (_tillMap) {[auto addChild: _tiledMap]; } _tiledMap.position = CGPointMake (800, 0); SKAction * scrollLeft = [SKAction conduction: CGPointMake (600, 0) Duration: 4]; SKAction * scrollRight = [SKAction conduction: CGPointMake (700, 0) Duration: 4]; SKAction * sequence = [SKAction sequence: @ [scrollLeft, scrollRight]]; SKAction * Repeat = [Squection repeat acnection: sequence]; [Ditlide map run action: repeat];
Result:
As you see Whenever the JSTileMap direction changes, depending on whether it's left or right, the image may be generated or something else, I can not explain it. It does not happen if the node itself is a SKSpriteNode I add numbers to the background image for the visual reference.
Edit
Further tests indicate that the position of the jestle map in the update loop runs manually (_tiredMap.position.x = x + 1) , It has only one effect. When it is animated, the image / tile crop occurs, and when it animates on the right it becomes normal
I got a job- Apparently the problem is around that the first tile column is being grown for some reason (tell me if someone tells me it) so the solution is to create a tilemap Which has more than 2 tile units in comparison to your original tilemap dimension. For example, if your tiles are set to 32x32 (1024x768 tile), then you should create a tilemap of 1088x768 and start drawing after the first column.
See the picture below.
Comments
Post a Comment