Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


valueerror last won the day on February 11 2015

valueerror had the most liked content!

About valueerror

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

2753 profile views
  1. thank you very much for this explanaiton! i'd suggest Phaser3 as a name.. just because the name stands for a good and easy to use js gameframework.. a good brand should stick to it's name and logo ... have a look at this... they know why they are doing this ^^
  2. http://test.xapient.net/circleworld/ like this for example.. i used 4 polygons to round the edges and tiled map edior to paint those polygons...
  3. of course.. you just should keep track of your constraint.. usually i store the constraint directly on one of the constrained objects.. somesprite.constraint = game.physics.p2.createRevoluteConstraint(somesprite.body, [0,0], someothersprite.body, [0,0], 10000);then i delete it with: game.physics.p2.removeConstraint(somesprite.constraint);somesprite.constraint = null;you could also clear ALL constraints at once: function clearAllConstraints(){ var allConstraints = game.physics.p2.world.constraints.splice(0,game.physics.p2.world.constraints.length); if (allConstraints.length > 0){
  4. every p2 body gets a rectangular shape in the size of the image first.. until you call somesprite.body.setCircle(20); for example.. then the first shape gets replaced with a circle ;-) yanifska's way is perfect if you want to change the physics body anyway.. that way you can always access the playershape directly by its representation "playersensor" (for example) to acces the first shape of any body you could also do the following: somesprite.body.data.shapes[0].sensor = true;as you can see all shapes are stored in the body.data.shapes[] array
  5. hehe.. maybe.. btw. i posted this example because i used sensors of course.. but this is by far not the best way to accomplish what i actually wanted to do there.. (the jumpthrough platform) i managed to get it to work with a totally different approach... (just in case someone needs it ) http://www.html5gamedevs.com/topic/6148-the-moving-jumpthrough-platform-sum-up-thread-help-very-much-appreciated/?p=36930
  6. just configure the bullets to act as sensor.... they will not trigger a collision response but still report the collision.. so you could then change the health of the enemy and destroy the bullet but no physics response will occur !
  7. well.. collisiongroups shouldn't be a problem in general unless you would like to have different collisiongroups for different shapes... (what would be great but i guess that's just not possible right now - correct me if i'm wrong please) the function that is called on contact (either through a collisiongroup callback or an onbegincontact event) has to figure out which shape of the body reported the contact and then act on it accordingly.. should work!
  8. http://test.xapient.net/phaser/ALL/moving-jumpthrough-platform-2.html this is one of my first experiments to get jumpthrough platforms to work.. i used two sensors.. the above one disables collision on contact and the lower one enables it... maybe you could read the code and find out what you want ?
  9. if you want to create a "dust trail" particle emmiters are probably not such a bad idea.. you can define a particle emitter flow, give it a gravity, set it to scale over time and decrease the alpha value.. that way you will easily create something that looks like the smoke coming out of a combustion engine..
  10. for vertical walls i did the same thing.. i used a slightly altered version of the "checkifcanjump" function to figure out if the player is touchingLeft or touchingRight and if so i canceld the movement.. BUT.. this function would probably also prohibit climbing 45deg hills..
  11. ah.. ok thx.. i think i understand if the camera starts to pan it probably reached it's bounds and tries to stay within them ?! you could try.. game.camera.bounds = null; just to find out if the bounds are the reason? and if you decide to put up an example on the sandbox i'l definitely give it a try
  12. oh.. and another thing.. the easiest way of all ways to do this is to just zoom to the current center of the camera.. do not change the camera position at all.. the user can position the wanted object manually into the center of the curren view and just zoom in and then move the camera manually again if the wanted object is not exactly there.. that's totally usable and reliable
  13. oke.. some thoughts: first of all.. it shakes? there is easing activated in the current code so the zooming motion is smooth - this leads to a little overlap.. the camera should reposition itself but the easing function isn't quite at the target scale position.. so the easing is going to finish and afterwards the camera is repositioned.. it's way better with pinch to zoom but the only way (or better the easiest way) you can get rid of this is by removing the easing. set easing to 1 and this "shaking" (i believe i figured out what you mean by that) is gone.. # that leads me to the first
  14. @icp: this doesn't exactly answer the question.. i think boolean already figured out how to make them collide but is wondering why i have to set bodyA to collide with bodyB and vice versa.. if A collides with B the logical outcome would be that B also collides with A - so why the redundance.. IMHO the best approach would be to set it independently from the bodies like. phaser.pyhysics.p2.setCollisions(ArrayA, ArrayB); //pseudocode !! all collisiongroups in arrayA should collide with all collisiongroups in arrayB)
  15. http://jsfiddle.net/valueerror/pdx0px0w/ working code zoom in/out with mousewheel (it will zoom to the pointer) or with pinch2zoom (it will zoom to the center between your fingers)
  • Create New...