2,230 questions
-3
votes
1
answer
126
views
How to give a pixel wood texture to font similar to Stardew Valley?
I'm currently working on my bachelor's project, I downloaded the Stardew Valley Title font to use it in my Web Game but I'm having problems getting that wooden texture. Here is how my title related ...
1
vote
0
answers
63
views
Hexagonal Tiled map appears offset and misaligned in Phaser 3 (missing rows, gaps, and wrong tile positions)
enter image description here
I’m working on a Phaser 3 game that uses a hexagonal (staggered) map created in Tiled.
However, when I load the map into Phaser, the tile layout appears offset where some ...
0
votes
0
answers
45
views
Camera follow not working properly in Phaser 3
I'm working on a Phaser 3 project where I want the camera to follow a physics-enabled sprite (an orc). I've set world bounds and camera bounds and used startFollow, but the camera doesn't seem to ...
2
votes
2
answers
144
views
How to color only a part of a Text object?
I'm trying to make slightly fancier text objects where part of the text in a Phaser text object is coloured.
Googling around there seemed to be an addColor function to achieve this (shown off here, ...
0
votes
1
answer
83
views
Disable multiple keys in phaser 3
I use the right arrow key for my character’s movement. The problem is, when I press another key at the same time, the movement stops. Is there a way to keep the character moving even when other keys ...
0
votes
1
answer
108
views
Disabling Bootstrap event delegation for specific DOM elements
Environment
Bootstrap version: 5.3.3
Browser: Chrome (latest)
Framework: Vue.js 3 with Phaser 3.87.0
Problem Description
I'm developing a game using Phaser 3 within a Vue.js application that uses ...
2
votes
1
answer
51
views
Is it possible to run a function inside Phaser 3, this.input.on dragstart?
I am writing a game of Solitaire in Phaser 3 and want to run a function inside of this.input.on('dragstart', .... I can drag a single card inside of dragstart, but I need a function to work out which ...
1
vote
1
answer
129
views
Phaser setting FPS is incorrect?
I am setting the FPS in my Phaser game like this:
const config = {
type: window.Phaser.AUTO,
width: window.innerWidth,
height: window.innerHeight,
scene: GameScene,
physics: {
default: &...
1
vote
1
answer
46
views
cursors is not defined at Game.update (Phaser 3)
I'm currently learning Phaser and decided to use this Vite template (https://github.com/phaserjs/template-vite). These are the changes I've made:
Boot.js:
import { Scene } from 'phaser';
export ...
1
vote
1
answer
76
views
Phaser.js: mismatch between coordinates for graphics and Matter.js body
I'm trying to mathematically create some shape graphics in Phaser.js, and to attach matching Matter.js physics bodies to them. I'm finding that the coordinate systems used for these two things don't ...
0
votes
1
answer
59
views
How to make dom elements stay in it's place when camera scroll in phaser
I need to make my dom elements stay in it's place when the camera scroll in phaser. I tried setting setScrollFactor(0) but doesn't work. Is there other solution aside from updating dom elements ...
1
vote
1
answer
84
views
Manipulate matter.js Body
I run into an issue with generated bodies in matter.js.
if i generate a body from svg via:
Matter.Svg.pathToVertices(svgPath, 1)
It can happen that the generated Body consists of more shapes like ...
0
votes
1
answer
41
views
Insert Image between, before or after texts in phaser 3
I want to combine text and an image in Phaser 3 and place them inside a container. What is the most efficient way to achieve this? Ideally, the layout should adapt to the container’s width. Is there a ...
3
votes
2
answers
172
views
Create physics body from svg in phaser with matter.js
I'm loading a svg as xml in the preload function:
this.load.xml("xml-pipe-bottom", "assets/svg/shape_pipe_b.svg");
and create a body and the svg as sprite:
const shapeBody = this....
0
votes
2
answers
108
views
How to detect fullscreenchange if it came from pressing f11
I'm creating a function for full screen via pressing f11 or from icon. What is the efficient way to detect if the fullscreenchange event came from pressing f11 below is my code going full screen by ...
0
votes
0
answers
26
views
Preventing Exit from Full Screen When Pressing F11 Twice in JavaScript [duplicate]
I'm wondering why I can exit full screen when I have a flag that should prevent the user from pressing F11 twice. Please don't tell me to use once I just need to know the reason. Fyi this is just an ...
0
votes
1
answer
96
views
In phaser 3 what is the efficient way to transition from portrait to landscape and vice versa
import Phaser from 'phaser';
import PlayScene from './PlayScene';
import PreloadScene from './PreloadScene';
import QuestionScene from './QuestionScene';
import NotificationBannerScene from './...
1
vote
2
answers
84
views
After zooming in the main camera, how do I get a sprite's zoomed in viewport coordinates?
On a default Phaser project, I have a sprite positioned at 100, 100.
I want to get its coordinates when zoomed in to place an absolute div on top of it in HTML.
On zoom 1 this works:
const ...
1
vote
1
answer
51
views
Spine2D Atlas 404 Error in Phaser with Webpack 5
When I try to load Spine2D's atlas in Phaser, using Webpack 5, I receive 404 for the skeleton.png asset.
// File: skeleton.atlas
skeleton.png
size:2046,1890
filter:Linear,Linear
...
Spine2D's atlas ...
1
vote
1
answer
59
views
Troubles with using Socket.io and Phaser 3
I’m following a walkthrough on creating a Multiplayer Card Game using Phaser 3 and Socket.io
Linked here: https://www.youtube.com/watch?v=6KaGqh1spfs&list=PLCbP9KGntfcEDAiseVwYVbrmJdoYajNtw&...
1
vote
0
answers
37
views
Creating collision to a layer in Phaser using JSON and Tiled
I'm quite new to using Phaser and the Tiled map editor. I'm making a game using html,css,js, Phaser 3 and tiled. I've made my map and exported it as a .json object I can make the map appear in my game,...
1
vote
1
answer
55
views
Animation stops at frame 1 in Phaser 3
In a specific section of my code, the animation for a sprite stops at frame 1 when I run this.sprite.anims.play("key", true).
I have ran animations in other sections of my code and they have ...
1
vote
1
answer
49
views
Tweens method converts my buttons back to their original size an and not the custom one I gave them
I'm creating four buttons, using the game engine Phaser 3. I try to give each button a custom size based on the screen size (so it always fits nice in the screen no matter what screen size). At first ...
0
votes
1
answer
73
views
Phaser Arcade Physics Collision Categories Setup
i´m starting with phaser arcade physics. the assigned categories won´t work - i have to add a collider manually. the bricks should also collide with each other:
for (let i = 0; i < 3; i++) {
...
1
vote
1
answer
112
views
Phaser 3.60+ Video Dropping Frames in Android App (WebView)
Newer versions of Phaser (3.60 and on) seem to be dropping video frames when opening my phaser project in an Android app’s WebView. In other words, if I try to open my project, which is hosted online, ...
-1
votes
1
answer
46
views
Best way to display LaTeX-style expression in phaser 3
Has anyone tried to display LaTeX-style expression in phaser 3? I need to display this latex-style expression
-1
votes
1
answer
83
views
making a light behind text with phaser [closed]
please i would like to add light behind text using phaser js like in this image (its the purple light)
i've tried to use these functions
this.add.pointlight(this.scoreText.x, this.scoreText.y, 0, ...
1
vote
1
answer
114
views
Hold to interact button
I'm developing a game for cats with phaser 3.The game consists of a mouse that keeps moving in the screen and every time the cat touches it, it dies and then he comes from another direction and faster....
2
votes
1
answer
89
views
Making a Tile Follow Another Tile in Phaser 3
This is more of a logic question than a Phaser 3 question. I am trying to make the game 'snake'. I can move 1 body up, down, left, and right easily, however, I do have issues when there is more than 1 ...
2
votes
1
answer
124
views
Rotating a container about its center
So, I am trying to make a tetris game. I have created a tetriminoe using a group of tiles that is helped by a container. The container rotates fine, but I am trying to rotate this container by its ...
1
vote
1
answer
75
views
How to stop PhaserJS from eating mouse events?
I've put a PhaserJS instance on my website for background visuals. Unfortunately, when the mouse is over it, it eats all my clock events (and probably other mouse events too), despite that the ...
0
votes
0
answers
41
views
output or use a js variable from the function (function ($, Drupal) {}) Drupal
After sending data from my php to my js with DrupalSettings, I can use this data only in the function
(function ($, Drupal) {
var myData = null;
Drupal.behaviors.customJs = {
attach: ...
1
vote
1
answer
108
views
Phaser - Struggling with particles
I'm building a game as a side project. I'm struggling with my particles to result the same way it does in my artwork :
Here is a demo of the current state of the game. https://youtube.com/shorts/-...
0
votes
1
answer
42
views
Why is my PhaserJS static body image shifting over when running into the object from the left but not the right?
I have a phaserJS static body; for some reason, the texture shifts over by a few pixels when I run into it. I have to run for a bit before hitting it or it won't do it but it isn't enjoyable and I don'...
1
vote
1
answer
100
views
Text and Image Quality is Very Low
I’m learning to use Phaser. I made a project in Vanilla Framework using Vite.js. In this project, image and font quality are showing very low. When I try to zoom in, then images and fonts are looking ...
2
votes
1
answer
52
views
How to disable Bounce
I want to disable bounced in my io game. Main idea to set object (player) velocity and player must move until io socket command stop movement.
sample this.objects[id].setVelocityX (-speed);
to prevent ...
2
votes
2
answers
132
views
Phaser: Beginner and having issues syncing multiplayers into different scene
I'm building a multiplayer game using Phaser 3 and Socket.IO. I have two scenes: CommonScene and BridgeScene. Players can move around and see each other in CommonScene, and there's a zone that ...
1
vote
1
answer
110
views
Ghost AI not moving through intersections (Phaser 3, PacMan)
I am trying to make a pac_man game with Phaser 3. I have implemented the pac_man movement, however, I really need help with the ghost AI. The ghost is moving by its self, however, it is not passing ...
2
votes
1
answer
57
views
Tiled Map not loading in Phaser, getting only the bg color
Following is my code:
demo.json file (exported map from tiled):
{
"compressionlevel":-1,
"height":16,
"infinite":false,
"layers":[
{
"...
1
vote
2
answers
82
views
Dropdown UI Black Screen Issue on Android in Phaser Game
I’m encountering an issue with a custom dropdown in my Phaser 3 game. The dropdown works perfectly on iOS and web, but on Android (APK), the screen turns black when I attempt to display the dropdown ...
0
votes
2
answers
147
views
Snake game in Phaser, but when the snake moves, it looks like it 'jumps' rather than moving smoothly
How can I fix this?
Below are some functions I've implemented for my Phaser snake game: update, move, setBodyPartTexture, and grow
update(time) {
if (time >= this.moveTime && this....
0
votes
2
answers
173
views
phaser 3: Uncaught TypeError: this.game.scene.launch is not a function unable to launch i have implemented a scene manager and im having trouble
phaser 3:
Uncaught TypeError: this.game.scene.launch is not a function unable to launch
I have implemented a scene manager, and I'm having trouble.
Please help. I really want to be able to use this ...
1
vote
1
answer
72
views
Phaser object not Draggable
This code does not allow the rectangle w/topbar to be draggable. What do I need to change? I created a scrollabel Phaser scene and can get the 'box' to draw but it is not draggable. When the user ...
0
votes
1
answer
49
views
How to correctly center a GameObject in the canvas
I am currently fiddling with Phaser3 with Ionic Capacitor to make a mobile app.
I'm not sure if this is a bug on Phaser3 or on Ionic, but for some reason the readonly values in the Scene (inside the ...
0
votes
1
answer
153
views
Getting error when trying to execute the command npm run build
I am following a course to create a TS/JS-based game through webpack and Phaser. My GameScene Code is
import { Map } from "../components/map";
import TilesGroup from "../components/...
2
votes
1
answer
101
views
How to prevent Phaser 3 shader from moving with camera?
I'm having trouble with a shader in my Phaser game. I've applied the shader as a post pipeline, hoping it would cover the whole screen with a water effect. But when I move my character around, the ...
0
votes
1
answer
46
views
Initial pic or frame is not flipped
In phaser 3 I have the animation below
BaseScene.ball = this.add
.sprite(0, 0, 'ball1')
.setOrigin(0.5)
.setDepth(1);
createBallRotationAnimation(){
this.anims.create({
key: 'ball',
...
1
vote
1
answer
61
views
How do I find the x coordinate and y coordinate of a group in Phaser 3?
I have created a dynamic group in phaser 3 using let group = this.physics.add.group(). However, I have tried group.x,group.x to try and get the x and y coordinate of the group, but the result seems to ...
0
votes
0
answers
27
views
Phaser.Scale.EXACT_FIT creating a proportionate square
In phaser I have set my config with the settings below
const config = {
type: Phaser.CANVAS,
width: window.screen.width,
height: window.screen.height,
scale: {
mode: Phaser.Scale.EXACT_FIT,...
1
vote
1
answer
48
views
No friction on tweened sprite
I have a moving platform and box on top of it. No matter how fast the platform is moving, the box doesnt move sideways along with the platform and eventually falls down if the platform slipped away.
I ...