Simple Phaser tank

This commit is contained in:
oliverbye committed 2018-11-17 14:53:03 +00:00
1 parent 710ec3590b
commit cff4d5d2ec
5 files changed
+170345

No files matched your search

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+16
View File
@@ -0,0 +1,16 @@
class Field extends Phaser.Scene {
constructor() {
super({key:"Field"});
}
preload() {
this.load.image('TankFR1', 'assets/tank2fr1.png');
}
create() {
this.image = this.add.image(400,300,'TankFR1');
this.input.keyboard.on('keyup_D', function (event) {
this.image.x +=10;
}, this);
}
}
+14
View File
@@ -0,0 +1,14 @@
var config = {
type:Phaser.AUTO,
width: 800,
height: 600,
physics: {
default:'arcade',
arcade: {
gravity: {y:200}
}
},
scene: [Field]
};
var game = new Phaser.Game(config);
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>CastTrax</title>
<script src="phaser.js"></script>
<script src="field.js"></script>
<script src="game.js"></script>
</head>
<body>
</body>
</html>
+170304
View File
File diff suppressed because it is too large. Load diff