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大杂烩》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

Wireshark网络分析实战

Wireshark网络分析实战

[以色列 Yoram Orzach / 古宏霞、孙余强 / 人民邮电出版社 / 2015-1 / 79.00元

本书采用步骤式为读者讲解了一些使用Wireshark来解决网络实际问题的技巧。 本书共分为14章,其内容涵盖了Wireshark的基础知识,抓包过滤器的用法,显示过滤器的用法,基本/高级信息统计工具的用法,Expert Info工具的用法,Wiresahrk在Ethernet、LAN及无线LAN中的用法,ARP和IP故障分析,TCP/UDP故障分析,HTTP和DNS故障分析,企业网应用程序行......一起来看看 《Wireshark网络分析实战》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具