oliversb

Members
  • Content count

    83
  • Joined

  • Last visited

About oliversb

  • Rank
    Advanced Member

Recent Profile Visitors

397 profile views
  1. How do I get the body to only collide with left or right bounds? I am using arcade physics and tried to convert this over with from a post using a different physics system. 'function createPreviewBounds(x, y, w, h) { var sim = game.physics.arcade; customBounds.left = new Phaser.Body({ mass: 0, position: [ x, y ], angle: 1.5707963267948966 }); customBounds.left.addShape(new Plane()); customBounds.right = new Phaser.Body({ mass: 0, position: [ x + w, y ], angle: -1.5707963267948966 }); customBounds.right.addShape(new Phaser.Plane()); // customBounds.right.shapes[0].collisionGroup = mask; customBounds.top = new Phaser.Body({ mass: 0, position: [ x, y ], angle: -3.141592653589793 }); customBounds.top.addShape(new Phaser.Plane()); // customBounds.top.shapes[0].collisionGroup = mask; customBounds.bottom = new Phaser.Body({ mass: 0, position: [ x, y + h ] }); customBounds.bottom.addShape(new Phaser.Plane()); // customBounds.bottom.shapes[0].collisionGroup = mask; sim.world.addBody(customBounds.left); sim.world.addBody(customBounds.right); sim.world.addBody(customBounds.top); sim.world.addBody(customBounds.bottom); }' I wrote this code were I wanted to createPreviewBounds '//create bounds var bounds = new Phaser.Rectangle(100, 100, 400, 400); customBounds = { left: null, right: null, top: null, bottom: null }; createPreviewBounds(bounds.x, bounds.y, bounds.width, bounds.height);' I cannot seem to find the right constructor. Thanks
  2. Collide with left/right world bound only

    Can I use this kind of thing for arcade physics? Thanks
  3. toLowerCase error

    'Uncaught TypeError: Cannot read property 'toLowerCase' of undefined' Any idea why this might be an error occuring in Phaser? The error is in setStyle. It seems that the align property is not set. 'text = new Phaser.Text(game, 10, 25 * obj.graphicsGroup.length, String(text), null);' Thanks
  4. Collide Only With Left/Right World Bounds

    Ah I thought this was for general collision but reading this it seems not. Thanks
  5. I am trying to find an efficient way to collide only with left or right world bounds. I have tried copying and editing the collideWorldBounds method into something that supports it and including it in the update method of object instances but I find it just gets stuck on the edge of the screen. Maybe this is because there is a specific order of how things are being processed in Phaser? How do I could I create an efficient method for collideWorldBounds that lets me choose specific sides of the screen? Thanks
  6. Switching states with presitance?

    How do I keep sprites alive while switching from one state to another? Thanks
  7. Set width and height or scale of sprite to stretch?

    I was looking for the variables to use actually. Found them in the PIXI docs. Thanks anyway
  8. Assign transparency to sprite

    Thanks people. CtlAltDel seems to have answered my question.
  9. Assign transparency to sprite

    How do I assign transparency to sprite to make textures applied to that sprite semi-transparent? Thanks
  10. Is there anything in Phaser that I could use to stretch a sprite, just like the crop capabilities but you stretch the image instead. Thanks
  11. New Phaser Cheatsheet

    Good thinking and this is a great contribution to the Phaser community.
  12. Glad it was just the docs and it was not programmed wrong. That would have been a nightmare.
  13. The Phaser docs says this in the docs for the Animation class, 'Gets or sets the current speed of the animation, the time between each frame of the animation, given in ms. Takes effect from the NEXT frame. Minimum value is 1.'. Doesn't that the 'speed' in phaser is the duration between each frame and not the rate at which the animation is proceeding frames? Thanks