Jump to content

Please help test the Phaser 1.1.4 release


rich
 Share

Recommended Posts

Do we have an example of how tilemaps work in the new version? 

I'm having all my tilemaps show up solid white... 

The examples have been updated by Rich (check out examples/tilemaps/mario.js for example)

 

In short

 

preload: 

    game.load.tilemap('mario', 'assets/tilemaps/maps/super_mario.json', null, Phaser.Tilemap.TILED_JSON);    game.load.image('tiles', 'assets/tilemaps/tiles/super_mario.png');
create:
    var map = game.add.tilemap('mario');    map.addTilesetImage('SuperMarioBros-World1-1', 'tiles');    layer = map.createLayer('World1');    layer.resizeWorld();
Important: The information in the json file plays a much bigger role. Your strings have to match the names in the jsonfile for image name and layer name.
Also the image information (tile size etc.) in the json file must now be correct because it's used to tile the tilesetimage.
Link to comment
Share on other sites

I have just downloaded the latest dev version (againagainagain), and I am testing out tweening a sprites position, and having it collide with another sprite.

 

tweencollide.jpg

Purple boxes are the sprite bodies being rendered, the line is the tween path.

 

The collision is happening fine, the callback is being called and the tween is being stopped in the callback.

CombatState.prototype.collideCharacters = function(player, enemy){    if ( player.tween != null && player.tween.isRunning)        player.tween.stop();    if ( enemy.tween != null && enemy.tween.isRunning)        enemy.tween.stop();};

However, as you can see in the image that the sprite bodies are overlapping still, and this is causing the collision callback to be called every frame after the collision happens.

 

I am not using any custom separation functions, only the collision callback above.

 

This is the code to create the sprites (with player and enemy in place of sprite in the actual code, they are just created identically):

      var sprite = new Phaser.Sprite(this.game, spriteX,  spriteY, "character");      sprite.anchor.x = 0.5;      sprite.anchor.y = 1;      sprite.body.setRectangle(sprite.width, sprite.height/3, 0, sprite.height - (sprite.height/3));      sprite.body.moves = false;      sprite.body.rebound = false;

I tested with unaltered body sizes and anchors, and the result was the same. The sprites do not separate properly and end up overlapping.

Link to comment
Share on other sites

I have the same problem as @jpdev.

 

Recently, I created a game where the map is generated using a text file and bunch of ground sprites. However, when the player jumps and touches the side of a ground sprite, the sprite for the player just sticks there. Here's a screenshot showing the bug:

 

TU7q21a.png

 

Is there anything I can do to resolve this issue? Thanks in advance. By the way, I am using the 1.1.4 release.

Link to comment
Share on other sites

 

The examples have been updated by Rich (check out examples/tilemaps/mario.js for example)

 

In short

 

preload: 

    game.load.tilemap('mario', 'assets/tilemaps/maps/super_mario.json', null, Phaser.Tilemap.TILED_JSON);    game.load.image('tiles', 'assets/tilemaps/tiles/super_mario.png');
create:
    var map = game.add.tilemap('mario');    map.addTilesetImage('SuperMarioBros-World1-1', 'tiles');    layer = map.createLayer('World1');    layer.resizeWorld();
Important: The information in the json file plays a much bigger role. Your strings have to match the names in the jsonfile for image name and layer name.
Also the image information (tile size etc.) in the json file must now be correct because it's used to tile the tilesetimage.

 

 

Gotta say this new tilemap syntax is really nice, takes a lot of the pain out of using tilemaps!

Link to comment
Share on other sites

Ok I've pushed a new version up (no build file, just the src) that should resolve the issue with Sprite coordinates not updating properly when Groups were involved, i.e. the body forcing the sprite to 'zoom off the screen' (like in Invaders game). It's working fine for me now across my tests.

 

I've got most of n-way collision restored as well, but need some more tweaks to make it right, as it's not quite taking the leading face into consideration properly yet. If I can nail that tomorrow along with the 'jittering when on the ground' then I reckon we're good for release.

Link to comment
Share on other sites

Having a tile collide in one direction, but not in another.

(Mario jumping through platforms from below, but landing on the same platform from above.)

 

Phaser 1.1.3 had 4 boolean arguments when setting collision ranges for that, where you could tweak from which side a tile in a tilemap should collide.

 

From what I understand Rich is working on something similar (or even better) as a last touch to 1.1.4 

Link to comment
Share on other sites

Ok I've got n-way collision working for everything except one final test case, which is when a Sprite overlaps with another sprite on its extreme edge - basically it intersects the side of the sprite less than the bottom, so the SAT system thinks it has penetrated on the edge instead of the bottom. This doesn't matter for SAT as it still separates correctly, but it matters if you've hooked an n-way check onto it :(

 

So currently trying to resolve this, ideally without loads of conditional checks to see if objects are above/below each other.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...