November 2019
Beginner
436 pages
8h 52m
English
Let's prevent the sprite from going off screen. Here, we are going to render the ship in another part of the screen. Follow these steps to do so:
const screenWidth = 800; const screenHeight = 600; var config = { type: Phaser.AUTO, width: screenWidth, height: screenHeight, backgroundColor: '#03187D', scene: { preload: preload, create: create, update: update } };
function update() { // RIGHT button ...Read now
Unlock full access