Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

phaser shift position

preload ()
    {
        this.load.image('sky', 'assets/skies/deepblue.png');
        this.load.image('ball', 'assets/demoscene/ball-tlb.png');
    }

    create ()
    {
        this.add.image(0, 0, 'sky')
            .setOrigin(0);
        this.group = this.add.group({ key: 'ball', frameQuantity: 128 });

        this.input.on('pointermove', function (pointer) {
            this.x = pointer.x;
            this.y = pointer.y;
        }, this);
    }

    update (time, delta)
    {
        this.move += delta;
        if (this.move > 6)
        {
            Phaser.Actions.ShiftPosition(this.group.getChildren(), this.x, this.y);
            this.move = 0;
        }
    }
Comment

PREVIOUS NEXT
Code Example
Javascript :: phaser 60 fps animation test 
Javascript :: phaser animation repeat event 
Javascript :: phaser create animation from sprite config.js 
Javascript :: phaser animation on complete event 
Javascript :: phaser remove animation event 
Javascript :: get lat long react native 
Javascript :: mui adding eye toggle at password field 
Javascript :: toast plugin 
Javascript :: how to invoke a function in a class 
Javascript :: js undici fetch data async 
Javascript :: nodejs stream pipeline 
Javascript :: store reference of event listener inside a element 
Javascript :: sadd in redis 
Javascript :: js if animation infinity end 
Javascript :: split array by character javascript 
Javascript :: loop in object 
Javascript :: password 
Javascript :: add google map in react js 
Javascript :: react-scripts not found 
Javascript :: js unshift vs push 
Javascript :: how to do subtraction in javascript 
Javascript :: python json replace string 
Javascript :: how to remove an item from an object in javascript 
Javascript :: mongoose array includes 
Javascript :: how to access value of itself object in javascript 
Javascript :: javascript print square 
Javascript :: append to array in js 
Javascript :: how to add animation over image in Javascript 
Javascript :: js role giveving 
Javascript :: validate on submit not working 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =