Questions tagged [phaserjs]

Phaser is a JavaScript framework for game development on desktop and mobile platforms. This tag can be used for all versions of Phaser.

50 questions
1
vote
1 answer

How to achieve responsive design in a Phaser game in a way where the whole screen is the camera/viewport and the focus change on resize?

I want to achieve this kind of responsiveness: Note that as you resize, the camera/viewport uses the whole screen and what changes is the focused area - the UI elements (represented here by the score) also are adjusted following the viewport…
1
vote
1 answer

How to access the internal function?

var $jscomp = $jscomp || {}; $jscomp.scope = {}; $jscomp.ASSUME_ES5 = !1; $jscomp.ASSUME_NO_NATIVE_MAP = !1; $jscomp.ASSUME_NO_NATIVE_SET = !1; $jscomp.SIMPLE_FROUND_POLYFILL = !1; $jscomp.objectCreate = $jscomp.ASSUME_ES5 || "function" == typeof…
uronpen
  • 13
  • 3
1
vote
2 answers

How can I make arcade and matter physics interact with each other?

I'm making a top down game in Phaser 3.60.0 and I have everything coded to run on arcade physics. The only thing I need the matter physics engine for is sloped tiles used for diagonal walls. Here are screenshots of what I have. I haven't figured…
1
vote
1 answer

How can I recreate objects with Phaser?

How can I recreate the bomb when the add bomb function works? when i click the addbomb I created in the top right of the screen, i want to regenerate the destroyed bomb item with the player's theme var player, bomb, platform, keyboard,…
baseus827
  • 11
  • 2
1
vote
1 answer

Phaser3 launch game with parameter

I need to launch the phaser game with some input data such as: user, authorization token,score etc. How can I proceed. thx I didn't figure out how to do it this is my index.js import Phaser import BootScene from './scenes/boot' import PreloadScene…
Diego
  • 37
  • 5
1
vote
1 answer

How to make my 2D array into a map using tile map. Phaser

I am trying to change my code that creates a map from a 2d array through a for loop to 2D array - tile map code. This is my updated code, //DECLARE VARIABLES || DECLARE VARIABLES || DECLARE VARIABLES let random; let attackTimer = false; …
JackF99
  • 125
  • 6
1
vote
1 answer

How do I add a weapon sprite to my player on phaser? I want my weapon sprite to be connected to my player sprites body

I have a player sprite 'this.player' and a weapon sprite 'this.weapon'. I want to attach the weapon around my characters body. My updated code will be on https://replit.com/@JackF99/test-2d-array#script.js. My current code is pasted below, const…
JackF99
  • 125
  • 6
1
vote
1 answer

I created a sprite in over 50 random places in my code and only the last sprite has the animation. How can I make all of them be animated?

I created a sprite in over 50 random places in my code and only the last sprite has the animation. I am trying to create a dungeon crawler game, and I dont want to initialized 50 different sprites for 1 aspect of the game. I used this.spikes =…
JackF99
  • 125
  • 6
0
votes
1 answer

Problem of responsive and playable on every mobile device in Phaser3

I have a problem on Phaser3. I developing a 2D platform game with Phaser3. And this game must be fit and playable on every mobile device with different resoulution. My base game config is (I developing many games so I had wrote a base config for use…
0
votes
1 answer

how can i reuse a texture again in phaser

so i am creating a scratching game where the user is supposed to scratch the cover the clear the area to reveal what is under the cover. the first part is done but i am unable to restart the game when he wants to play again. how can i bring back the…
0
votes
1 answer

Phaser Can't get mouse to work right, want text to appear when the cursor hovers over a sprite

I'm trying to have some text appear when the mouse hovers over an item in the invetory. Here is the code I have for a key appearing in the inventory, disappearing when its used in its quest, and what should make text appear when the player hovers…
EmptyStone
  • 235
  • 1
  • 7
0
votes
1 answer

Phaser Switching to the previous scene

I'm trying to give my game an inventory scene that the player can go to at the press of a button. When they arrive at the scene, they can view their items, and press the same button to return to the previous scene. I want the inventory scene to be…
EmptyStone
  • 235
  • 1
  • 7
0
votes
1 answer

Phaser Hit boxes are invisibly to the right, what gives?

I'm working on a game where the player can interact with stuff around them, like npcs, items, and examinable things in the environment. They can interact with stuff in 2 ways, pressing T to examine or talk to it or R to use or pick it up. For some…
EmptyStone
  • 235
  • 1
  • 7
0
votes
1 answer

How can I detect when the line has crossed both sides of my curve?

Is there a way of detecting when the line (drawn by the mouse) has interseted both sides of the curve? The aim of my game is for the user to successfully cut the object using the mouse. let level4; window.onload = function() { let gameConfig =…
0
votes
1 answer

Phaser timer activated events. How?

I'm trying to make a game where certain things happen based on a timer that keeps going up. For example, certain text, images, or clickable buttons only appear after a certain amount of time has passed on a specific screen. Or maybe an image briefly…
EmptyStone
  • 235
  • 1
  • 7