valueerror Posted March 9, 2014 Share Posted March 9, 2014 i honestly do not know if tweens on tiles fail.. or if I just fail in doing it right ^^ this is just one of a few different approaches i tried on tiles ... (the tile is accessed - no problem there.. i can set alpha or something else without issues)movingtile=map.getTile(4, 23,layerbackground); game.add.tween(movingtile).to({y:225 }, 1250, null,true,0,true,true).start();i also find it very interesting that this one (on a p2 physics body) works (partially)game.add.tween(player).to({y : game.world.centerY, x: game.world.centerX,angle : 360}, 1500, Phaser.Easing.Linear.None).start();it should move to the exact world center and rotate while moving (at least it did in phaser 1.1.x) now it just rotates Link to comment Share on other sites More sharing options...
rich Posted March 9, 2014 Share Posted March 9, 2014 You can't tween tiles or bodies like this and expect normal results, as you're not exposing them to any kind of force in a physics sense, you're just repositioning them in the world. If you want physics based resolutions, you need to use physics based forces (velocity, acceleration) that are created from within the physics simulation. Tiles are fixed in the world at precise locations and can't be moved. Floating platforms / etc should be done with sprites, not tiles. Link to comment Share on other sites More sharing options...
valueerror Posted March 10, 2014 Author Share Posted March 10, 2014 puh... oke.. no tweens with tiles.. noted! floating platform to jump on and float up like on an elevator seems really hard to implement.. i'm trying for a while now with a lot of different approaches... every single one failed.. i would be very happy if you could provide an example for this once phaser 2.0 is released... i'm going to ask the community for help too (in a separate post) and try even harder to make it work on my own thx Link to comment Share on other sites More sharing options...
valueerror Posted March 17, 2014 Author Share Posted March 17, 2014 at least one part of this is solved.. since it is a physics body i have to work with it's properties.. for example velocity.. game.add.tween(movingplatformvertical.body.velocity).to( { x: 0, y: 100 }, 1500, Phaser.Easing.Elastic.Out ).to( { x: 0, y: -100 }, 1500, Phaser.Easing.Elastic.Out).yoyo().loop().start(); Link to comment Share on other sites More sharing options...
Recommended Posts