phaser-framework

How to create a Phaser button in Facebook instant games for a mobile device

时光总嘲笑我的痴心妄想 提交于 2019-12-02 03:17:44
I am trying to create a button with Phaser 2 CE on a mobile device but it doesn't fires, even if it works fine on desktop, the entiere code will be on my github repository but for the moment i can just display an image like in the code bellow var game = new Phaser.Game(640, 480, Phaser.AUTO, 'game', { preload: preload, create: create, update: update }); function preload () { game.load.image('logo', 'assets/phaser2.png'); game.load.image("upArrow", "assets/up.png"); } function create () { // Initialize player //player = game.add.sprite(20, 20, 'logo'); game.device.desktop || addMobileInputs();

how to get activePointer pressed duration of sprite in Phaser

╄→尐↘猪︶ㄣ 提交于 2019-12-01 12:04:55
问题 I'm creating pinball game using Phaser Framework. When the ball holder is pressed (please check attached screenshot so you have an idea what I mean ball holder), depending on the press speed, it should move the ball around the spiral channel. So now trying to detect the down pressed duration of the holder. Here is my code: var ballButton; ballButton = game.add.sprite(196, 100, 'ballHolder'); ballButton.inputEnabled = true; ballButton.events.onInputDown.add(inputDownAction, this); function

How can I make an infinite side scrolling background in Phaserjs?

孤者浪人 提交于 2019-11-30 03:08:58
I'm using phaser.js to make a game and I cannot find any tutorials on how to make the background scroll infinitely. I'd like the background to tile/repeat sideways, and infinitely as the character moves right. I am currently using a camera and having the camera follow the character. Here's my idea about how to do this: Check the position of the camera constantly in update() , and then move it to the beginning of gameplay (the very left) along with the character at that time. I think that this would probably not be a smooth transition though, so I'm wondering if there is a better way to do it.

Only 'amd' and 'system' modules are supported alongside --out

放肆的年华 提交于 2019-11-29 05:24:32
When building typescript in VSCode, I get the following error: error TS6082: Only 'amd' and 'system' modules are supported alongside --out. My settings are as follows: tsconfig.json { "compilerOptions": { "target": "ES5", "module": "commonjs", "out": "current/game.js", "removeComments": true, "sourceMap": false } } .vscode/tasks.json: { "version": "0.1.0", // The command is tsc. Assumes that tsc has been installed using npm install -g typescript "command": "tsc", // The command is a shell script "isShellCommand": true, // Show the output window only if unrecognized errors occur. "showOutput":

Phaser: Make background screen-width instead of content-width

久未见 提交于 2019-11-27 19:37:18
问题 I am making a game using the Phaser Framework for Android. I need to make the canvas fill the entire screen width and then flood it with background color, then put content in the center of screen. Currently, even though I already set the width of the canvas to window width, Phaser still reset it to content width, which is smaller, then filling only the content width with background. How do I stop Phaser from using content width? var gameObj = new Phaser.Game($(".parent").width(), 700, Phaser

Only 'amd' and 'system' modules are supported alongside --out

喜你入骨 提交于 2019-11-27 03:42:55
问题 When building typescript in VSCode, I get the following error: error TS6082: Only 'amd' and 'system' modules are supported alongside --out. My settings are as follows: tsconfig.json { "compilerOptions": { "target": "ES5", "module": "commonjs", "out": "current/game.js", "removeComments": true, "sourceMap": false } } .vscode/tasks.json: { "version": "0.1.0", // The command is tsc. Assumes that tsc has been installed using npm install -g typescript "command": "tsc", // The command is a shell