Website URL

Twitter

Skype

Location

Interests

Hi All,
I have been working on a Endless Runner game for mobile and web .
Initially i Used TileSprite for the looping background,but it affects the performance on mobile.
Then i used the classic method of moving two backgrounds simultaneously.
But if i increase the speed of the movement , it gives a gap between two backgrounds.
Kindly help me with the logic
bgSpeed = 10
update()
{
mainBg1.y += bgSpeed;
mainBg2.y += bgSpeed;
if(mainBg1.y >= this.game.height)
{
mainBg1.y = -this.game.height;
}
if(mainBg2.y >= this.game.height)
{
mainBg2.y = -this.game.height;
}
}

Hi guys,
I'm having an issue with a tileSprite I'm using to cover my game screen. It looks like the repeating texture has spacing/margin added on all sides which creates this grid like effect in the screenshot below. I have no idea how this has happened because yesterday when I was working on the game (and all times previously) the tileSprite formed a solid texture the size of the game world. I've tried this with 2 separate textures, in different states/browsers and I'm starting to think I'm going crazy. Any help advice would be greatly appreciated. Thanks!

Hello,
I am creating a tilesprite, but its causing black lines to appear right at edges,
i have ensured that when used as just sprite there is no black line, i have tried adding extra padding in texture packer didnt, work, tried making the tilesprite size in PoT didnt work.
Can anyone suggest anything else I can do?
Thanks

Hi everyone,
I have a strange issue with the webgl and tilesprite behavior which seems for me to not follow the Phaser documentation.
My background is contained inside a sprite atlas described by a json file. All the sprites have dimension equal to a power of 2 (height and width) and the png file too.
I have followed the tutorial https://phaser.io/examples/v2/tile-sprites/tiling-sprite-atlas
It works great with this example and the octopus dimensions used are "w":62,"h":94
But, when I change one of this parameters to a power of 2, for example: "w":64,"h":94, the tilesprite has a strange behavior: the entire image is displayed from x:0 y:0
No problem with canvas.
I suppose it is a newbee issue... any help?
Thanks!

Hi everyone!
I am currently working on a game where a player has to avoid walls that spawn on the top of the screen.
I have a sprite that is a three-line road. Player can step on only one line at a time.
I want the background sprite (the road) to auto scroll from top to bottom.
At the same time I want it to spread across the entire screen width. To I basically want a single sprite to have the width of the screen and tile vertically.
Is it possible to achieve such a thing in Phaser?

Hello everyone!
I have a big map with a tilesprite in the background (repeating mountains). When I want to hide them, the first time I do background.alpha = 0, I notice a huge stutter. I can go back to alpha = 1 and alpha = 0 as much as I want later on, no issue. Only the first alpha = 0 causes the game to lag terribly.
I have tried with visible, renderable, exists etc. : same result! I have also tried to create a tilesprite with different frames and switch between them, but the impact on performance was dreadful (lost 50FPS!).
How could I avoid that? What's the cause of this stutter?
Thanks a lot!

preload: function() {
this.game.load.image('road', 'assets/images/road.png');
},
create: function() {
this.game.world.setBounds(0, 0, 1136, 640);
this.road = this.game.add.tileSprite(this.game.world.centerX, this.game.world.centerY, this.game.width, this.game.height, 'tileRoad');
this.road.anchor.setTo(0.5);
},
update: function() {
this.road.tilePosition.y +=1;
}
this code is for tilling the background from top to bottom. However, I would like to tilling the background straight to the camera view. what technique I need to use for achieving it?
here is the example of the tilling background I have found in this game http://www.nickjr.com/paw-patrol/games/paw-pups-save-the-day/.
Can anyone give me a clue to do so? Thanks!

I'm trying to make a top-down game where the player sprite is fixed in the center of screen and the background is moving (scrolling) in the direction opposite to the player's direction, so it results in effect of the player's movement.
I started with Invaders example. It uses TileSprite and its tilePosition property to make vertical scrolling of the background. This works good for linear scrolling in fixed direction (vertical or horizontal). But in my case I need implement scrolling (i.e. movement) in any direction. Furthermore I need such physics features as acceleration and drag to be applied to the player sprite.
Here is a sort of what I want to get: http://phaser.io/sandbox/OoPDpTwx
As can be seen it features constant movement only, no acceleration and other physics stuff. And I had to calculate angular movement manually.
How can I reproduce such effect using Phaser physics?
I've tried to enable camera following to the player sprite like here. Here is my code: http://phaser.io/sandbox/dowAsYWa
But it doesn't work.
What am I doing wrong?

The rope documentation says
As the texture moves? The rope? I've tried moving the rope around and adjusting the crop and frame of the texture, but nothing works.
I'm using ropes for waves in my game (orangesea.oddkraken.com), and I want to scroll the texture by while keeping the waves moving up and down, so it looks like the player is moving to the right.
Is there a better way to go about this?
Thanks.

Hi there,
I wonder if anyone can help. I have a custom graphic that I made which represents a reel on a slot / fruit machine. It contains 12 different images. Each image is 96 x 96. So you can imagine a long graphic with a new image going vertically at every 96 pixels.
I need to display 3 graphics at a time and then emulate spinning of the reel. I was looking into the TileSprites which I thought should be able to get my reels spinning (or look like they are) using the tilesprites.
Looking at an example @ phaserjs, its pretty straight forward, I think :-)
// Create tilesprite
tilesprite = game.add.tileSprite(0, 0, 800, 600, 'starfield');
Then could call method x number of times to emulate scrolling ie.
tilesprite.tilePosition.y += 8; // control the speed
The problem is that I would like to start each reel at a different position to start off, otherwise, you would always have the same pictures next to each other. I notice I can pass in a frame to the add.tileSprite and I can create the sprite as a atlas / spritesheet. Anyone know what I should be doing here ?
Once i have them spinning I would need to stop them, this is another task I can't seem to get my head around. If I just stop them spinning then I could stop the reels NOT being centred i.e. A graphics in between the win line and the line above.
Can anyone lend a hand ? I did try searching for some source code already available either free or paid but found none.
I am a little lost how to proceed, I should imagine phaserjs gives me the tools to do what i need to do but just unsure where I should go next.
Any help really appreciated
Thanks

Hey all,
Working on a game that animates a number of different layers to produce an parallax effect however I'm stuck when trying to repeat a single instance of a tile across the world and once out of view, it comes back in, i.e. marquee effect.
The only ways I can think of doing this is:
Create an asset with a lot of white space, however this could result in the tile taking longer on smaller devices and repeating on larger devices.
Use a standard tile and change the X/Y values and use math to reset once out of view.
Is there any way we can tell the TileSprite to effectively not repeat, but still move the image along the path as usual?
Thanks

Hello all, i have a small code on phaser wich needs to parallax two textures at different speeds. i've set the game canvas to transparent mode and my tiles are 1024x512. However, i have the need of resize it according to screen resolution, i.e. apply scale to have a good aspect ratio. how do i do that? here's what i'm seeing. i need to scale it in order to parallax it nicely http://imgur.com/a/swwOI

So i have a tileSprite and would like to change the texture. I call loadTexture and check with the console that the key is correct, but the old texture keeps showing. Then when I change the texture again, it displays the last texture. for example: this.mainBg.loadTexture('city-level-bg'); // Nothing Happensthis.mainBg.loadTexture('park-level-bg'); // Now it displays city-level-bg, why !?!?!

Hi guys, In earlier versions of Phaser I can get texture from a TilemapLayer and use it with a TileSprite... but with the 2.4.2 doesn't work. Any idea that you can suggest me? PD: My code: http://www.html5gamedevs.com/topic/12994-tilesprite-from-tilemap-and-tilemaplayer/ Thanks in advance, any help is greatly appreciated

Hello, guys! That's me again with my foolish questions)) So, the question is: How to stretch tileSprite to fullscreen ? planetSprite = game.add.tileSprite(0, 0, game.width + 500, game.height + 900, planetObject.key + 'Planet');// planetSprite.anchor.setTo(0, 0);planetSprite.scale.set(0.75, 0.6);planetSprite.fixedToCamera = true;and here I have a problem: it looks ok on my screen, but on bigger one this tileSprite is repeated and also it's not stretched to fullScreen on bigger screens image is attached Thank you in advance for your help))

hi, In my project, i'm trying to change the background of a game but i've got some issues. I use a tileSprite as background, i had it in the beginning of create() so it's behind the layers and other objects : (where my loaded images are named bg0, bg1, ...) background = game.add.tileSprite(0, 0, 800, 600, 'bg' + layers.fond);but i want to change it by pressing a key and there it goes wrong : if i use again rhis code with a different image, it creates a new tileSprite IN FRONT of the previous objects i've created. So i tried to change the tileSprite by using : background.key = 'bg' + layers.fond;But then, nothing change, the new image linked with background is good but i can't "refresh" the displayed sprite. Can you give me some advices ?

So I figure if I want a repeating image I'll be using a TileSprite. But I can't get my layer to render to a texture to then generate the tile sprite. I don't know what's going wrong because, basically, nothing shows up and I get no errors in the console. In this code, "map" is a Tilemap instance, "layer" is a TilemapLayer added through "map.createLayer(layerName);". var texture = this.game.add.renderTexture(layer.width, layer.height);texture.renderXY(layer, 0, 0)var tileSprite = this.game.add.tileSprite(0, 0, map.widthInPixels, map.heightInPixels, texture);layer.destroy();Simply nothing shows up. I can display my other images as TileSprites successfully, but I want to be able to make a repeating background in Tiled and have it automatically show up in my game. If this doesn't work I guess I'll get Tiled to render out my backgrounds as images? That's more annoying because I'll have to do that every time I change the background. What do y'all think?

Hello all, I have a tileSprite which looks like this: game.add.tileSprite(0, 0, 0, 0, "wordBG");The first time I create it, it looks fine, when the game.state is reset the following error occurs: Does anyone have any idea what is going on? Note: I'm using Phaser 2.3.0