Jump to content

Animating Circle Radius


Recommended Posts

Hello everyone,
I am very new to game development, and even more new to Phaser, so may be i am about to ask something stupid, but i would appreciate helping me with this matter.
I am creating a little HTML5 board game, and for now, i have written an AI for the game which servers the purpose of generating random but solvable game. When AI is run it returns specified amount of circles with x/y/radius and value parameters of the circle. Drawing those object with phaser looks something like this:
At this stage an active circle should be selected, and to describe the selection i want to animate active circle's radius, which would result in circle getting smaller/bigger during the animation. Code i am using for this is:

_this.game.add.tween( _this.phaser.circles[0]).to({ radius: -90 }, 1000, Phaser.Easing.Linear.None, true, 0, 1000, true);

But it is not working, when i want to animate x/y properties it is working just fine, but radius just doesn't work.


is in this case a graphical object, when i log it i can see that it has x/y properties which i guess results in them being animated with the tween, it also has radius property and _diameter property, but i can not animate any of them.


Is it not possible to animate radius, or am i doing something wrong in this case?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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