RichJ

Members
  • Content count

    12
  • Joined

  • Last visited

  1. Shader Texture Oddness

    Time for an upgrade then, I'm still on 4.5.6
  2. Shader Texture Oddness

    Yeh I've been using tint on other things, but I didn't know about PIXI.Texture.WHITE. That's a great little feature, thanks for the info
  3. Shader Texture Oddness

    Really easy with sprite masks, here's a link to the new fiddle using masking Thanks again, much appreciated.
  4. Shader Texture Oddness

    Not sure about the number of sprites yet, just trying to get the technique to work, but if performance is a potential issue then I may abandon it. The sprite mask stuff sounds interesting, I'll try that out shortly. Thanks for the quick and very concise answers
  5. Shader Texture Oddness

    Thanks for the tips, I'll take a look at all that info later today. What I want to do with the extra texture is use it as masking information for the actual sprite, so this combining is just a test to see if the texture gets into the shaders ok, it's not what I actually want to do. So when a pixel is transparent on the mask, I set gl_FragColor to 0,0,0,0 on the sprite texture and therefore suppress rendering of that pixel. The mask texture will be generated dynamically in JS code. I'm new to PIXI, there may be a better way of doing this. I've used shaders to do this in the past with a Monogame project.
  6. Shader Texture Oddness

    I'm trying to render a sprite using a shader that takes a texture as a parameter and combines the sprite with that texture, so the desired outcome is the texture being overlaid onto the original sprite texture. They successfully combine, but the texture passed in appears slightly scaled up and therefore misaligned with the sprite texture. I'm new to shaders, so I hope I haven't missed something obvious. Pulling my hair out with this one. Here's an example fiddle
  7. Camera size

    I'm just getting familiar with the camera object and have it following my player around a Tiled map, which was nice 'n easy. A question though. The documentation mentions camera width and height properties, but my camera is always the same size as the stage. Does version 2.7.3 support limiting the camera viewport size, or is this a future thing?
  8. Physics glitch

    Thanks @samme , I tried reading the "touching" properties but that didn't work either. The debug info showed the touching properties being set every other frame.
  9. Physics glitch

    Thanks for the detailed post @drhayes, I've looked into Tilemaps and got it all up and running perfectly. I was yet to come across Tilemaps, still only a few days into Phaser, so I'd fallen into the trap of going against the framework by trying to build up my tile map manually. Can't believe how simple it is to implement a map exported as JSON from the Tiled map editor Shame about the physics bug, but I understand what you're saying. I wrote a very simple 2D physics engine a few months ago for a Monogame project and ran into pretty much the same problem. Thanks again
  10. Physics glitch

    Thanks for the tip, I didn't realise you could display all that debug info. It doesn't show anything up though. Really odd how the problem only occurs when brushing up against the vertical wall.
  11. Physics glitch

    Anyone else experienced this, even if it hasn't been resolved? It's kind of a deal breaker, quite surprised that the arcade physics engine fails in such a simple scenario, hence I'm thinking I've done something wrong
  12. Physics glitch

    Hi, I'm new to Phaser, but a seasoned games programmer. Seems like a great framework so far, but I'm experiencing a glitch in the Arcade physics engine which I'm not sure is a bug, or down to the way I'm manipulating the body's velocity in code. I've setup a sprite object and strips of horizontal & vertical wall blocks, all of which are enabled in the physics engine. The walls are immovable. If I move my sprite up, it will eventually hit a wall, but with the up key held I can still use the left & right keys to move the sprite smoothly against the wall. If I do the same thing against the vertical wall, the up and down movements get stuck at the edge of some of the wall blocks if I keep the right key pressed. Here's a example... http://cam64.net/temp/phaser/default.html ...and here's the code. Is it a bug, or am I doing something wrong? var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var walls; var player; function preload() { game.load.image('playerImage', 'Images/sprite.png'); game.load.image('wallImage', 'Images/block.png'); } function create() { // Start physics engine game.physics.startSystem(Phaser.Physics.ARCADE); // Setup walls group walls = game.add.group(); walls.enableBody = true; // Create horizontal and vertical wall blocks for (i = 0; i < 9; i++) { var w1 = walls.create(i * 64, 0, 'wallImage'); w1.body.immovable = true; var w2 = walls.create(576, i * 64, 'wallImage'); w2.body.immovable = true; } // Create player player = game.add.sprite(250, 250, 'playerImage'); game.physics.arcade.enable(player); player.body.maxVelocity.setTo(300, 300); player.body.collideWorldBounds = true; } function update() { cursors = game.input.keyboard.createCursorKeys(); // Move left and right if (cursors.left.isDown) { player.body.velocity.x -= 50; } else if (cursors.right.isDown) { player.body.velocity.x += 50; } else { player.body.velocity.x = 0; } // Move up and down if (cursors.up.isDown) { player.body.velocity.y -= 50; } else if (cursors.down.isDown) { player.body.velocity.y += 50; } else { player.body.velocity.y = 0; } // Update collisions game.physics.arcade.collide(player, walls); }