Jump to content

Trying to call a tween from a class not working - SOLVED


Recommended Posts

Hi guys

I'm trying to setup a tween inside a classes mousedown function, but for some reason it's not doing anything. Any ideas on what I'm doing wrong?

Thank you in advance :)

LetterTile = game.Class.extend({

    init: function(x, y, frame) {
        this.sprite = new game.Animation([

        this.sprite.mousedown = function() {

            if (game.scene.started) {

            	//this.alpha = (0.5);

            	this.addTween(this.scale, {
                    x: 0.5,
                    y: 0.5
                }, 1000, {
                    easing: 'Quadratic.InOut',
                    repeat: Infinity,
                    yoyo: true

        this.sprite.interactive = true;
        this.sprite.position.set(x, y);
        this.sprite.anchor.set(30, 30);


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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