Search
 
SCRIPT & CODE EXAMPLE
 

HTML

phaser hello world

<!DOCTYPE html>
<html>
<head>
    <script src="https://cdn.jsdelivr.net/npm/phaser@3.15.1/dist/phaser-arcade-physics.min.js"></script>
</head>
<body>

    <script>
    var config = {
        type: Phaser.AUTO,
        width: 800,
        height: 600,
        physics: {
            default: 'arcade',
            arcade: {
                gravity: { y: 200 }
            }
        },
        scene: {
            preload: preload,
            create: create
        }
    };

    var game = new Phaser.Game(config);

    function preload ()
    {
        this.load.setBaseURL('http://labs.phaser.io');

        this.load.image('sky', 'assets/skies/space3.png');
        this.load.image('logo', 'assets/sprites/phaser3-logo.png');
        this.load.image('red', 'assets/particles/red.png');
    }

    function create ()
    {
        this.add.image(400, 300, 'sky');

        var particles = this.add.particles('red');

        var emitter = particles.createEmitter({
            speed: 100,
            scale: { start: 1, end: 0 },
            blendMode: 'ADD'
        });

        var logo = this.physics.add.image(400, 100, 'logo');

        logo.setVelocity(100, 200);
        logo.setBounce(1, 1);
        logo.setCollideWorldBounds(true);

        emitter.startFollow(logo);
    }
    </script>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Html :: html mettre 3 photos avec url 
Html :: modal trava bootstrap 
Html :: alert before delete in anchor tag 
Html :: execution time address binding in os 
Html :: how to find out how big an elemnts totla width is in css 
Html :: html anchor in samae page without url 
Html :: <iframe/src=. 
Html :: Restream html5 video player 
Html :: rmarkdown revealjs_presentation remove black border to images 
Html :: multiline input in html 
Html :: xhtml strict 
Html :: HTML <del 
Html :: 2 button component in single row vuetify 
Html :: how to add color to particular text on <pin html 
Html :: serbia meaning 
Html :: 1 aed in rupees 
Html :: terminal command to add data at first in all lines 
Html :: form table selection 
Html :: #c 
Html :: physical and logical tags in html 
Html :: readium github 
Html :: add link to text using span html 
Html :: cshtml set a max value foreach 
Html :: mdboostrap lazy loading 
Html :: fontawesome language icon 
Html :: html interview questions 
Html :: simple website with html and css 
Html :: education html templates 
Html :: html web page examples with source code 
Css :: png shadow css 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =