Jump to content

Unexplainable smoothing turning on/off when placing objects in the game


Recommended Posts

So I've got this neat little rotation tween which gives the effect of a swaying tree:

function tweenTree(tree, autoStart) {

    if (!allowTweenTrees) {
    var randomDelay = rData.between(0, 3000);
    var time = 3500;
    var amountRotation = 2;
    tree.smoothed = true;
    tree.angle = amountRotation * -1;
    var move = game.add.tween(tree).to({
        rotation: amountRotation * (Math.PI / 180),
        //   angle: amountRotation,
        // Phaser.Easing.Quadratic.Out
    }, time, Phaser.Easing.Quadratic.InOut, autoStart, randomDelay, -1, true);
    //   console.log(tree.__proto__.smoothed); 
    tree.treeTween = move;

    move.onUpdateCallback(function() {
        tree.smoothed = true;
    }, this);


Note the onUpdateCallback.... Just another one of the measures I take to try and get smoothing to stay on. For some reason it randomly turns off in webgl. Doesn't seem to happen in canvas mode. See the GIF below. When you turn smoothing off, the tree tween looks horrible. In the GIF below, it turns off randomly when you are placing more trees in the game which makes absolutely no sense. This is one of those issues in which there is no precedence for. After hours of Googling, I've realized no one else has ever had this problem. 

See what I'm talking about here in the below GIF. Notice that when I place a tree, the smoothing turns off for all the trees ... then it goes back on again when I place another tree. it makes no sense!



Phaser 2.3.0 btw. 

Link to comment
Share on other sites

  • 2 weeks later...

  • Recently Browsing   0 members

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