Phaser大杂烩

栏目: 后端 · 发布时间: 6年前

<!DOCTYPE html>
<html lang="en">
<head>
    <title>App</title>
    <script src="https://cdn.jsdelivr.net/npm/phaser@3.15.1/dist/phaser-arcade-physics.min.js"></script>
</head>
<body>
<script>
    new Phaser.Game({
        width: 800,
        height: 600,
        physics: {
            default: 'arcade',
            arcade: {
                gravity: {
                    y: 100
                }
            }
        },
        scene: {
            preload: function () {
                this.load.image('pineapple', 'pineapple.png');
                this.load.image('apple', 'apple.png')
            },
            create: function () {
                const particles = this.add.particles('pineapple');
                const emitter = particles.createEmitter({
                    speed: 100,
                    scale: {
                        start: 0.5,
                        end: 0
                    }
                });
                const logo = this.physics.add.image(0, 0, 'apple');
                logo.setVelocity(1000, 1500);
                logo.setBounce(1, 1);
                logo.setCollideWorldBounds(true);
                emitter.startFollow(logo);
            }
        }
    });
</script>
</body>
</html>

以上所述就是小编给大家介绍的《Phaser大杂烩》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Tornado

Introduction to Tornado

Michael Dory、Adam Parrish、Brendan Berg / O'Reilly Media / 2012-3-28 / USD 23.99

Tornado is a scalable, non-blocking web server and web application framework written in Python. It is also light-weight to deploy, fun to write for, and incredibly powerful. Tornado was written with p......一起来看看 《Introduction to Tornado》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

SHA 加密
SHA 加密

SHA 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换