rich Posted January 20, 2014 Author Share Posted January 20, 2014 Yes you have to use cameraOffset to position a camera fixed sprite. Link to comment Share on other sites More sharing options...
Benjans Posted January 20, 2014 Share Posted January 20, 2014 Hmm that's strange, because :I modified the script to add cameraOffset on the text, it works for the first text, but the second is not displayedOn sprites, it works without cameraOffset... And it's new, it did not work on 1.1.3My new code : var s1 = game.add.sprite(game.world.centerX, game.world.centerY, 'totoro'); s1.fixedToCamera = true; var s2 = game.add.sprite(game.world.centerX + 100, game.world.centerY + 100, 'totoro'); s2.fixedToCamera = true; // Add text var style = { font: "12px Arial", fill: "#ffffff" }; var t1 = game.add.text(10, 10, 'This is the first sentence', style); t1.cameraOffset(10, 10); t1.fixedToCamera = true; var t2 = game.add.text(100, 100, 'This is the second sentence', style); t2.cameraOffset(100, 100); t2.fixedToCamera = true; Link to comment Share on other sites More sharing options...
rich Posted January 20, 2014 Author Share Posted January 20, 2014 cameraOffset isn't a function, it's a Point object: ts.cameraOffset.setTo(100, 100); Link to comment Share on other sites More sharing options...
RestingCoder Posted January 20, 2014 Share Posted January 20, 2014 (edited) I am seeing some collision issues with Tilemaps. I have something setup to show what I mean here: http://play.reminiscencegame.com/example/ If you move left/right into a wall, sometimes there is a gap, and sometimes there isn't. There also appears to be a 1px gap between the character and the floor. From what I see here, it looks like this will be fixed, but I just wanted to provide an example. EDIT: I have also had things get stuck like in the screenshot attached. Edited January 20, 2014 by RestingCoder Link to comment Share on other sites More sharing options...
digitalcake Posted January 21, 2014 Share Posted January 21, 2014 am I missing something the src/phaser.js for the git tag ("1.1.4") sha d9ffd6afd47f198a197e129723f15f6aa5538231 is version 1.1.3. Link to comment Share on other sites More sharing options...
algorix Posted January 22, 2014 Share Posted January 22, 2014 am I missing something the src/phaser.js for the git tag ("1.1.4") sha d9ffd6afd47f198a197e129723f15f6aa5538231 is version 1.1.3. I also saw that. @photonstorm: It's ok clone the dev branch to test the 1.1.4? Link to comment Share on other sites More sharing options...
kass Posted January 29, 2014 Share Posted January 29, 2014 i tested out the phaser touch analog stick on my ipad 1 and ipad 2 and the touch detection was really buggy. sometimes i found myself having to drag my finger along the top left and right of my screen to move the analog stick which is on the very bottom left of the ipad screen. Link to comment Share on other sites More sharing options...
mariogarranz Posted January 29, 2014 Share Posted January 29, 2014 Not sure if it has been mentioned, but tried this with my current game and tweens don't seem to stop. I use the onComplete callback to stop them, works with 1.1.3, does not work with 1.1.4. Link to comment Share on other sites More sharing options...
rich Posted January 29, 2014 Author Share Posted January 29, 2014 * Tween.onStartCallback and onCompleteCallback have been removed to avoid confusion. You should use the onStart, onLoop and onComplete events instead. mariogarranz 1 Link to comment Share on other sites More sharing options...
stevenb Posted January 30, 2014 Share Posted January 30, 2014 Hi, in the previous version there was a ''wasTouching'' property for the Body class. This was useful for preventing e.g. repeating bounce sounds // prevent sounds repeatsif(this.body.wasTouching.down) // skip bounce sound Is there another way to do this in 1.1.4 ? Thanks Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Author Share Posted January 31, 2014 Hi all, I just pushed a brand new build up into dev, including all the new examples, the new build files and other bits and pieces. I'm about 95% sure I'm going to release this today. I've got one annoying bug left that I want to nail, but otherwise it's a pretty monster update! Loads of API changes though. But check out the new collision - polygon stuff jerome 1 Link to comment Share on other sites More sharing options...
Mefteg Posted January 31, 2014 Share Posted January 31, 2014 Thank you ! You left a console.log :-/updateScale 0.8993682499994975 0.8993682499994975 phaser.min.js:12And please, can you tell me what appened to the "center" variable of Body ? Link to comment Share on other sites More sharing options...
jpdev Posted January 31, 2014 Share Posted January 31, 2014 Cool news, I will try it on my game later today. The latest (yesterday evening) version had no working collision on tilemaps + gravity.. so I hope that's fixed now. I have got a question though: In Phaser 1.1.3 there was the option to set collision for tilemaps in so that they only collide from above / below / left /right.This seems to be missing from the 1.1.4 Version. - But it's kind of a must have feature for mario style jump and runs.(Where you can jump through many platforms from below, but then walk on them.) Am I just missing how this is done now, or is it actually missing (if so are there plans to bring it back)? Thanks for any info on this,JP Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Author Share Posted January 31, 2014 Thank you ! You left a console.log :-/updateScale 0.8993682499994975 0.8993682499994975 phaser.min.js:12And please, can you tell me what appened to the "center" variable of Body ? I probably left loads of console.logs! Center has gone because now you have a polygon for the collision shape it didn't really make sense any more. re: the tiles, I'll do an example showing n-way collision. Link to comment Share on other sites More sharing options...
Mefteg Posted January 31, 2014 Share Posted January 31, 2014 I probably left loads of console.logs! Center has gone because now you have a polygon for the collision shape it didn't really make sense any more. re: the tiles, I'll do an example showing n-way collision.Thank you for the answer.So sprite.body.polygon.pos is the "new" center, right ? Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Author Share Posted January 31, 2014 It depends on the shape and its rotation, but by default with a standard rectangle body.x/y would be the top-left and you could derive the center easily by taking that and body.width/height and halving them. This is also true for circles. Body.left/right/width/height are calculated based on the rotation of the points, so can (and will) change if you rotate the body. Leave it untouched and it should be fine. Body.polygon.pos shouldn't really be touched directly (and should match body.x/y anyway). Circle shapes don't have any polygons, hence the way the x/y getter works. Link to comment Share on other sites More sharing options...
Mefteg Posted January 31, 2014 Share Posted January 31, 2014 Thank you again for this informations !I don't rotate my sprite but its body have an offset and a different width and height than the sprite. I can compute center easily but I would know if it's already done by Phaser. Again, thank you ! Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Author Share Posted January 31, 2014 It's not already done, no. You can still give them a different width / height, no problem, and I updated the collision examples to show this. Mefteg 1 Link to comment Share on other sites More sharing options...
jpdev Posted January 31, 2014 Share Posted January 31, 2014 Hi Rich, Quick feedback: With the latest 1.1.4 I have the following problem: Pretty standard stuff: player sprite, gravity enabled, colliding with a tilemap The player sprite is stopped by the "ground" (the colliding tiles) but: spirte.body.touching.down is only set for one call to update() in the following calls to update (while the player sprite is standing on the ground) sprite.body.touching.down is false. (In my case this leads to not being able to jump and playing the wrong animation). Should I use something else to check if the sprite is "on the ground", or will this work when 1.1.4 is done? If you need a quick demo showing the problem I'll make one, just let me know. Thanks,JP Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Author Share Posted January 31, 2014 Yes this is related to one of the final few things on my list: when a body lands on the ground (or a tile) and it has bounce > 0, it will enter a 'flux' state. Visually it may not change at all, but internally its delta values toggle back and forth between super low values - not enough to move it, but enough to cause the 'blocked' flag to reset. If the body had a high velocity you can see it 'jiggling around' on the tiles. I'm open to suggestions on how to fix this actually, because it's quite annoying and really hard to determine the difference between what is a 'jittery' rebound, and what is just the beginning values of a normal rebound. Link to comment Share on other sites More sharing options...
jcs Posted January 31, 2014 Share Posted January 31, 2014 same issue as @jpdev. also, when using parallax scrolling, the background layers seem to "jump" a bit where they didn't use to. I've added a 'dev-phaser-1.1.4' branch to nadion (https://github.com/jcd-as/nadion) with the changes I've made to run under 1.1.4. the sample should show the issue if you go to the 'bushes' just to the right of where you start and walk back and forth quickly. not a show stopper perhaps, but something to be aware of. re the bouncing problem, I imagine it's not possible to clamp the very low values because you would lose the start of an 'actual' bounce as well as the 'jittering'? cheers Link to comment Share on other sites More sharing options...
Mefteg Posted January 31, 2014 Share Posted January 31, 2014 It's not already done, no. You can still give them a different width / height, no problem, and I updated the collision examples to show this.Thank you again. Link to comment Share on other sites More sharing options...
rich Posted January 31, 2014 Author Share Posted January 31, 2014 I've found an issue with sprites placed within Groups, causing them to fly off the screen. It's to do with the Body using the wrong sprite coordinates, so I'll do a fix for that this weekend. Is the parallax thing to do with layers in a tilemap? Or some other way? Link to comment Share on other sites More sharing options...
jcs Posted January 31, 2014 Share Posted January 31, 2014 the parallax effect is done with multiple tile layers (and an 'image layer' - which is just a sprite - for the 'farthest' background) Link to comment Share on other sites More sharing options...
Vaughan Posted February 1, 2014 Share Posted February 1, 2014 Do we have an example of how tilemaps work in the new version? I'm having all my tilemaps show up solid white... Link to comment Share on other sites More sharing options...
Recommended Posts