<!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大杂烩》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
JavaScript and Ajax for the Web, Sixth Edition
Tom Negrino、Dori Smith / Peachpit Press / August 28, 2006 / $24.99
Book Description Need to learn JavaScript fast? This best-selling reference’s visual format and step-by-step, task-based instructions will have you up and running with JavaScript in no time. In thi......一起来看看 《JavaScript and Ajax for the Web, Sixth Edition》 这本书的介绍吧!