Questions tagged [phaser-framework]
Phaser is a JavaScript framework for game development on desktop and mobile platforms. This tag can be used for all versions of Phaser.
2,081
questions
0
votes
0
answers
19
views
About the use of Phaser3.60 and Tweens Animation
We would like to get the coordinates and angles of multiple objects from a json file and create a playback of around 30,000~50,000 animations.
Is PhaserJS(3.60) suitable for this case?
If suitable, is ...
1
vote
1
answer
33
views
About tween seek in Phaserjs3.60
Is it possible to implement a seek bar function with Tweens animations?
Is it also possible to rewind the Tweens animation with the seek function?
The version of PhaserJs is 3.60.
I am currently ...
1
vote
1
answer
21
views
Phaser I want to split my scene list into 2 lines
The game I'm working on has a lot of scenes, so the scene list in the main file is getting pretty long. Here's how long it is now and be advised that with the plans I have it will get longer:
scene: [...
1
vote
1
answer
25
views
Phaser3 TileMap(.json) Multiple Level
Right now my game only restarts on the same tilemap.
level-1 tilemap is loaded even if the key is level-2.
What do you think is the best way to make multiple levels?
I tried something like this but &...
1
vote
1
answer
36
views
Phaser3 overlap to once tile
I want to select 1 object in my tilemap and check whether my player hits it or not, and I can give collision in this object propslayer, there is no problem with specific objects, but I cannot get it ...
0
votes
0
answers
16
views
phaser 3 scrolling problem in mobile touch screen
I am new to phaser 3 and i don't know how to resolve this touch screen bug.
in desktop mouse scrolling working fin but in touch screen devices io wobbles and very buggy to scroll there is 25 records ...
1
vote
1
answer
23
views
Phaser Image won't delete, maybe because I changed it's size or clarity?
I'm working on an inventory system, for my game, and I'm having some trouble with the code that gets rid of used items. This is the code the makes visible items disappear, which is activated when the ...
0
votes
1
answer
33
views
TypeScript errors in Phaser.js
I have two similar errors that I haven't been able to get rid of. The application works fine in Vite, but it doesn't transpile as it contains the aforementioned errors. That's the code:
import Phaser ...
1
vote
1
answer
21
views
Phaser item is placed in array 18 times
I'm working on an inventory system that puts items in an array with 18 slots. This is the code that places items in the array based on whether they are in a global array, using the has method I wrote, ...
2
votes
1
answer
32
views
When I update the size of an image multiple times, the previous versions of the image remain
I am new to javascript and phaser, and am working to design a task.
In this task, I want the size of an image, a circle, to change as a function of the distance of the pointer (cursor) from a ...
1
vote
1
answer
25
views
html + phaser code and file not getting read
I been trying to get my project to display on a server but for some reason it wont recognize my js file at all.
Ive tried using live server extension on vscode, http-server to run my server and ...
1
vote
1
answer
19
views
Phaser - moving projectiles does not work when projectile added to a group
I'm new to Phaser and try to move projectiles. I managed to have the projectile movements working, but to add collision, I created the group this.projectiles. Since this, projectiles are created at ...
0
votes
1
answer
64
views
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 ...
1
vote
1
answer
22
views
Phaser Background loading trouble, is camera causing it
I'm making a game in which the camera follows the player as they move across the level. But I'm having trouble with the background.
The game window is 1600 x 900, while the background image is 3400 x ...
0
votes
1
answer
51
views
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 ...
1
vote
0
answers
44
views
How can I change the click-drag behavior on this rotatable globe to be more intuitive?
I've been messing around with 3D meshes in Phaser 3, and I'm trying to create a basic 3D shape with click/drag-to-rotate behavior, very much like this globe example:
https://codepen.io/cedarcantab/pen/...
1
vote
1
answer
63
views
is there any other way to monitor the percentage of erased pixels in phaser
so im trying to create a scratch card game where the user need to scratch the card to reveal what's underneath it. i want to check whenever the user has scratched 70% of the canvas to reveal it all. i ...
1
vote
1
answer
37
views
Phaser 3 | Enable sleep event for static object
I want to build a tower stacking game.
A click triggers the block to fall down.
I need to listen on when the falling stone goes to sleep and trigger an event afterwards to get the next round started.
...
1
vote
1
answer
33
views
Tilemap is shaking on camera move in Phaser
I am creating simple 100x100 tilemap using Tiled and Phaser, nothing more, but when I move the camero around, the "map scrolling animation" is not smooth, and there are noise/breaks/shakes ...
0
votes
1
answer
70
views
How to run Phaser games without a local web server?
I have been trying to make a phaser game and port it to Tauri so I can have desktop apps, but I need a local web server. How cannot I do it without one?
Note: I need it to be LOCAL, I can't use tools ...
1
vote
1
answer
23
views
How to detect collisions in Phaser.js
I have been trying to figure out how to detect collisions in Phaser.js 3, but I cannot find any working solutions. Here is my phaser code:
var gameState = {};
function preload() {
this.load.image('...
2
votes
1
answer
21
views
phaser - how to find mobile device notch size
My game is running fullscreen on mobile devices but I need to keep some top safe space to avoid notch space and statusbar.
Found this scale examples but it doesn't handle notch/statusbar spaces.
scale:...
1
vote
1
answer
37
views
phaser - container not moving it's objects
I'm using external class with a container and trying to move it
import Phaser from 'phaser';
export default class tabContainer extends Phaser.GameObjects.Container {
container_hit_clicker;
...
1
vote
2
answers
39
views
Move camera offset phaser
I would like the camera to move to a specific offSetX. Using the method "horizontalCamera.setScroll(800,0)" it moves instantly. How can I make it move with an animation?
P.S. I'm using ...
1
vote
1
answer
34
views
phaser - how to keep game data organized right way
My game will handle a data model like this:
- Characters
- Name
- PowerBase
- League
- Title
- BossName
- Match
- Player
- Character
- League
- Progress
- PowerTotal
- Money
- ...
0
votes
1
answer
32
views
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 ...
1
vote
1
answer
34
views
Phaser setting specific slots in an array didn't work?
I've pretty much gotten past this problem by attacking to from a different angle, but I would like to know why my first approach didn't work.
In my game I had and array:
let inventory = [null,null,...
0
votes
1
answer
36
views
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 ...
0
votes
1
answer
19
views
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 ...
1
vote
1
answer
57
views
Phaser Need a new trigger for text
I'm working on a game in which, when the player talks to an npc with a quest, one of for dialogues is shown, based on what a string made in the main scene is set to. The string can be:
inactive: is ...
0
votes
1
answer
64
views
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;
...
1
vote
1
answer
23
views
Phaser.js Timed callback from a child in a group
I would like for a child from a physics group destroy itself after ~2 seconds, along with other things, and I was thinking along the lines of a function callback which happens two seconds after the ...
1
vote
1
answer
26
views
Phaser : Hitbox of character move anormally since animations added
I'm new to Phaser and trying to do a top down game.
Since I added walking animations, the hitbox of my characters moves anormaly :
Going down : ok !
Any other direction : not ok !
As you can see on ...
0
votes
1
answer
39
views
Loading a tileset in Phaser game
I'm new to Phaser and try to do a top-down game. I followed several tutorials and asked ChatGPT, but I can't manage to use a tilemap I created (using Tiled).
Here is my code :
main.js
import Phaser ...
2
votes
1
answer
33
views
simple tween is not working to move object X
My code below is showing two scenes side-by-side. It's working fine the way I need.
So I'm trying to simply move them using Tween and it's not working.
Am I doing something wrong?
document.body....
1
vote
1
answer
53
views
how to move multiple scenes side-by-side
My game has multiple screens, like side-by-side rooms and I'm trying to allow user to drag between them, like presentation slides.
So I'm doing it by each room as a different scene, just for ...
2
votes
1
answer
45
views
Phaser.js coordinate collisions between two layers
So, I have two layers, objLayer, and BGLayer
So, the wooden bridge, is non colliding, allowing the player to pass through, however, the water underneath it is colliding, and will not let the player ...
1
vote
1
answer
49
views
Is Circle mask image Plugin broken?
in Phaser,I load the plugin in preload function
class Main extends Phaser.Scene {
constructor() {
super("Main");
}
preload() {
this....
0
votes
1
answer
22
views
Phaser create new children for a group
I've looked around the phaser docs, but I cannot find a way to add a new child to a phaser group. how do I create and add a new child?
1
vote
1
answer
54
views
Phaser Move camera mouse position bug
So, I have a simple circle sprite, that's following the mouse, Like this:
this.input.on('pointermove', function (pointer) {
this.circle.setPosition(pointer.x, pointer.y);
}, this);
However, I also ...
2
votes
1
answer
84
views
Phaser Complex Collisions
How can I detect the collisions of multiple children from different groups?
similar
Imagine something like this, but with square hitboxes
the pink object is from one group, the red object from ...
1
vote
1
answer
30
views
Phaser.js Physics group, draggable children
I have a physics group, this.photons
I would like to be able to drag the children of the group separately, but still have it collide with other groups/group members
so far, setDraggable hasn't worked, ...
1
vote
1
answer
24
views
Is there a better way to put together physics colliders for multiple groups in Phaser.js?
So, I have 7 Physics groups, and they all collide with each other, and so far, my collision detector looks like this:
this.physics.add.collider(this.photons, this.bottomQuarks);
this.physics.add....
1
vote
1
answer
21
views
Make a slow drifting motion for a physics group phaser.js
So I have a physics group, with a very low velocity like child.setVelocity(1, 10);
It's fine if this groups children speed up from a faster group collision, but I would like them to be very slow, ...
1
vote
1
answer
42
views
wrong matter.js velocity on phaser.js object
I'm trying to move an object from one side of the screen to the other side using Phaser.js (v 3.6) with physics by Matter.js.
I'm trying to do it with the setVelocity method of Physics.Matter.Sprite (...
1
vote
1
answer
46
views
Phaser change sprite rotation to the direction its going in
I have this sprite group
this.photons = this.physics.add.group({
key: "photon",
repeat: 11,
setXY: { x: 50, y: 50, stepX: 32 },
});
this.photons.children.iterate(...
2
votes
1
answer
134
views
Phaser 3 create tilesprite from dynamic texture
I have developed a slot machine in Phaser 3. The reels are essentially tile sprites that rotate during spinning.
When the reels slow down, I would like to load a tile sprite of symbols representing ...
1
vote
1
answer
135
views
Phaser3 Game Canvas Responsive
I know starting from phaser 3 there is a ScaleManager, to do Phaser.Scale.FIT, however it not the responsive I wish for. My canvas mainly focus on the center of screen, so when resizing the browser, I ...
1
vote
1
answer
58
views
How can I fill my new shapes red after using this.matter.add.fromVertices
I am making a small game which cuts objects in half.
I need the new shapes created to be filled in red, however it is not working.
Lines 94-99 are where the new shape is created, and hopefully filled ...
1
vote
2
answers
65
views
How can I add add colour to my this.matter.add.rectangle
Does anybody know how to add colour to my rectangle?
I have used this.matter.add.rectangle.
I am making a game which cuts shapes in half, however I can't figure out how to keep the game physics and ...