New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

# Tag Info

Accepted

### Point plotting with a line graph

You can solve this with some basic trigonometry. I wrote the code in Unity, but the general idea should be the same. Consider the following image: We already have P1 and P2. Here is some code to ...
• 8,424

### How do you do tile-based movement in Phaser?

The player should have a position, that can be any number, and a target position. When the current position is equal to the target position, check the input, and set the new target position ...
• 14.9k

### Why can't i change the background color in Phaser?

If you want to change the background color for the whole game, it´s easier to just set it in the game config. You can even use transparency: ...
• 141

### Pathfinding in Isometric Phaser with Tunnels

I disagree that you have to have a 3D map for this, and depending on how far along you are and how you implemented things, it might be a lot of work or bring other problems if you try to convert your ...
• 2,067

### Is it possible to make a pseudo isometric game with phaser?

Phaser handles this out of the box using sorting based on the y index. I have used this exact technique too to create stacked sprites so the elements at the bottom of the screen are drawn over the ...
• 222
Accepted

### One pixel lines flash on tile map when camera moves

I was able to fix the problem by setting following a point instead of following my hero sprite. The core problem was the camera wasn't moving in round pixels. By making that point move in round pixels ...
• 161
Accepted

### Phaser 3 - How to trigger an event every 1 second?

In your scene's update method you receive both the current timestamp, and the delta since the last update call (see https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html#update__anchor) You ...
• 121
Accepted

### Algorithm for taking the shortest path between two XY coordinates

Your code makes him move vertical and horizontal if needed. He moves the same speed both vertical and horizontal, that's why you only get a 45 degree angle. He moves like this until there is no need ...
• 146
Accepted

### Does Phaser Arcade.Body velocity include deltaTime or not?

Well.... I think I'm stupid... My calculation of the deltaTime was wrong The correct formula will be ...
Accepted

### How to kill a fired bullet sprite after certain amount of time in Phaser?

I found out that objects can be killed with body.lifespan Adding the line bullet.lifespan = 1000; in my ...

### Pathfinding in Isometric Phaser with Tunnels

So you might be rendering in 2d, but effectively by doing this your game map is no longer 2d, it is in fact 3d. You could handle this by pathfinding in three dimensions. Assuming a 3x3 grid with a ...
• 121

### add physics to a group or container body in phaser

I think you can't do it. Phaser groups doesn't have body: http://phaser.io/docs/2.4.4/Phaser.Group But you can use setAll method to set properties to all sprites of a group: http://phaser.io/docs/2....
• 171

### Take an image and cut it up into a tile map

Take a look at Tiled. It's a tool for creating 2D tile maps including hex-based maps like the example in your post. Phaser allows you to load tile map data generated by this tool. Once you've created ...
• 21
Accepted

### Component based architecture in TypeScript

I've got some good suggestions on Phaser forum, the solution shown by user @flyovergames was what I was looking for: ...

### Why are not the images loaded in Phaser?

I tested your Phaser Javascript code and it works fine. So I'm thinking it's a problem with how you've set up your server. Look up Express.js, its an NPM module that makes it really easy to set up ...
• 21
Accepted

### Whay can my player only move in one direction?

I think your problem is that your understanding of if and else is slightly wrong. ...
• 120k
Accepted

### How to justify text that appears character-by-character

I don't know what functionality Phaser offers, so this answer is abstract, but in general you must lay out the full text (or at least the entire next word for ragged-right and the entire next ...
• 5,498
Accepted

### How to make object movable only by the player?

If you want to use the builtin phaser functions, you just need to create a phaser-matter-gameboject, like an image (link to the documentation), and that you configer it to be draggable. create matter-...
1 vote

### phaser.io mouse cursor sprite

You can use JavaScript's pointer lock API. First of all, it's still an experimental feature, so to be sure, you might need to check for compatibility and make sure there's a single working function: ...
• 14.9k
1 vote

### Phaser problem with .damage oneshots

zombies is a Group. You should set health on each individual zombie. By the way, your ...
• 14.8k
1 vote

### Rotating a group of bodies in Phaser

A solution for the ships colliding after being added to the shipgroup is to call enemy.body.clearCollision() before adding it to the shipcollisiongroup. To not have them all go to the same place you ...
• 11
1 vote
Accepted

### Collision not working in phaser node multiplayer

Make sure you're sending the velocity of your physics bodies from the server too. Position alone won't cut it, because it's not the only thing that impacts how the game objects move. The most secure ...
• 126
1 vote

### How do I get an attribute of a function?

You absolutely can. Just change what's returned and how you interact with it. ...
• 354
1 vote

### How to transfer drag control from one sprite to another? (Phaser)

Without code I'm not exactly sure what you're doing for the dragging now. So, I see two options: Spawn a new sprite where the old one was before and let the one that was being dragged continue to be ...
• 354
1 vote

### Phaser Shooting Game

I know very little about Phaser, but for my pure JS/canvas projects I handle key input with eventListeners. Here is how I do it: ...
• 11
1 vote
Accepted

### Phaser game is not registering collisions and input - but only on my machine

I was able to solve it by clearing my local cache in my browser history. Lesson learnt: clear the cache if weird localised problems happen.
1 vote

### setSize in Phaser.io

It doesn't look like you're initializing the physics anywhere. If you're trying to set attributes on the 'body', the body will be null unless you've initialized a physics engine on the sprite. Do ...
1 vote