Sign in to follow this  

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);


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.