这个游戏需要使用的图片:
HTML代码模板:
<!DOCTYPE html>
<html>
<head>
<title>加农炮</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="https://cdn.jsdelivr.net/npm/phaser@3.15.1/dist/phaser-arcade-physics.min.js"></script>
</head>
<style>
canvas{
border:1px solid black;
}
</style>
<body>
<script>
</script>
</body>
</html>
JS代码模板:
document.addEventListener('contextmenu', event => event.preventDefault());
var config = {
type: Phaser.AUTO,
width: 1600,
height: 900,
parent: 'phaser-example',
pixelArt: true,
physics: {
default: 'arcade',
arcade: {
debug: false,
gravity: { y: 300 }
}
},
scene: {
preload: preload,
create: create,
update: update,
}
};
var game = new Phaser.Game(config);
function preload() {
}
function create() {
}
function update ()
{
}