phaser-framework

having a problem loading a tilemap into phaser 3

不羁岁月 提交于 2020-04-30 10:02:50
问题 I've been having a problem loading a tilemap that I created with "tiled", I looked up the phaser 3 examples, I even copied pasted their file and png tile image into my project folder and it worked, so am pretty sure that the reason is me misusing the "tiled" software and not knowing how to properley handle a json file, I will add images of the errors am getting and the json file. Note: I get a black screen. https://i.stack.imgur.com/dF8ee.png / https://i.stack.imgur.com/E04ng.png function

having a problem loading a tilemap into phaser 3

对着背影说爱祢 提交于 2020-04-30 10:01:44
问题 I've been having a problem loading a tilemap that I created with "tiled", I looked up the phaser 3 examples, I even copied pasted their file and png tile image into my project folder and it worked, so am pretty sure that the reason is me misusing the "tiled" software and not knowing how to properley handle a json file, I will add images of the errors am getting and the json file. Note: I get a black screen. https://i.stack.imgur.com/dF8ee.png / https://i.stack.imgur.com/E04ng.png function

Javascript OOP, Accessing methods from other nested methods

拈花ヽ惹草 提交于 2020-03-25 17:24:52
问题 Ok, folks, getting there with learning my JS. I have come across a singular one. Here's the code: hangar = function(game){ } hangar.prototype = { loadImages: function(graphicAssets){ ... }, writeTerminal: function(timer, str, destination){ }, writeStats: function(){ var writeTerminal = this.writeTerminal; console.log('wt', this.writeTerminal); console.log('wt2', writeTerminal); //ZOMG This does not work! }, handleHangarInput: function(layerShips, layerBg){ ... does some variable declarations

Fix element at zoom on Phaser3

Deadly 提交于 2020-03-03 06:43:13
问题 How to fix an element at one point, despite the zoom? setScrollFactor(x [, y]) doesn't hepl me. I have a moving element behind which the camera is moving. But I need to keep the button always in the right corner Thanks for the fast reply) 回答1: create a separate scene specifically for the element that you want to remain static in Phaser 3 multiple scenes can exist at the same time, and they have their own cameras (at least one main camera per scene), which allows you to have scene A with a

Fix element at zoom on Phaser3

核能气质少年 提交于 2020-03-03 06:42:10
问题 How to fix an element at one point, despite the zoom? setScrollFactor(x [, y]) doesn't hepl me. I have a moving element behind which the camera is moving. But I need to keep the button always in the right corner Thanks for the fast reply) 回答1: create a separate scene specifically for the element that you want to remain static in Phaser 3 multiple scenes can exist at the same time, and they have their own cameras (at least one main camera per scene), which allows you to have scene A with a

Why objects in phaser 2.6.2 do not collide?

情到浓时终转凉″ 提交于 2020-01-25 10:09:15
问题 There are two tanks. One of them is controlled by arrows. I did everything that was necessary so that the tanks could collide, but this does not happen. Why? If this large code is not easy to read, please tell me where I could run the example. Below I commented on the place where the code does not work as it should. UPDATE I downloaded a working example here enter link description here export default function game() { const game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser', { preload:

Phaser: this.game is undefined in the Update function

淺唱寂寞╮ 提交于 2020-01-16 18:17:41
问题 Good evening, sorry for asking again, but I need to be done with this by tomorrow for school. Basically, when I try to access the this.game variable in the update function, it says that it is undefined, to be specific, I get this; "Uncaught TypeError: Cannot read property 'state' of undefined". In my update function I have this: create: function() { [...] map.setCollisionByExclusion([], true, doorLayer); [...] } When I try to access this.game in the update function on the collision action, I

Phaser3 Scenes transitions

别说谁变了你拦得住时间么 提交于 2020-01-14 10:14:23
问题 I'm new to Phaser3 and before starting a crazy project, I want to know how I should start, switch between scenes. I saw that there are several functions, start, launch, switch, run, resume, pause, etc... Example, lets say I want to have 2 scenes, a Menu and a Game. I boot on the Menu and I want to go to the Game scene and if I click on a button then come back to the Menu scene. I've achieved this by calling the start function, but I noticed that the all, init , preload and create functions

Phaser3 Scenes transitions

自闭症网瘾萝莉.ら 提交于 2020-01-14 10:13:52
问题 I'm new to Phaser3 and before starting a crazy project, I want to know how I should start, switch between scenes. I saw that there are several functions, start, launch, switch, run, resume, pause, etc... Example, lets say I want to have 2 scenes, a Menu and a Game. I boot on the Menu and I want to go to the Game scene and if I click on a button then come back to the Menu scene. I've achieved this by calling the start function, but I noticed that the all, init , preload and create functions

How to scale a Phaser 3 game and their assets to it works in smartphones and tablets?

北慕城南 提交于 2020-01-14 08:13:40
问题 I'm new working with Phaser 3 and Apache Córdova for create mobile Android games. I have created a game of 1200 x 800 px. It looks fine in tablets but in smartphones doesn't. How can I scale it to work in multiple screen sizes? Additionally, I need help to force to landscape the game orientation using Phaser 3. Thanks 回答1: function create () { window.addEventListener('resize', resize); resize(); } function resize() { var canvas = game.canvas, width = window.innerWidth, height = window