-
Posts
1,096 -
Joined
-
Last visited
-
Days Won
3
valueerror last won the day on February 11 2015
valueerror had the most liked content!
Contact Methods
-
Website URL
http://games.xapient.net/
-
Twitter
xapientius
Profile Information
-
Gender
Not Telling
-
Location
Austria
valueerror's Achievements
-
marius98 reacted to a post in a topic: How do you keep music playing between states?
-
quiphop reacted to a post in a topic: do i need to call Sound.stop() after Sound.fadeOut() on a looped sound?
-
Titus reacted to a post in a topic: Mobile performance - tips && tricks
-
Tilde reacted to a post in a topic: Render screen on texture?
-
flow reacted to a post in a topic: The 'moving jumpthrough platform' sum up thread - help very much appreciated
-
DanielKlava reacted to a post in a topic: help - arcade physics with p2 objects
-
DawnPaladin reacted to a post in a topic: How to remove a constraint in p2
-
nimohe reacted to a post in a topic: How to remove a constraint in p2
-
FakeWizard reacted to a post in a topic: Mobile performance - tips && tricks
-
nicloay reacted to a post in a topic: filter - "Gray.js" or "BlurX.js" how to configure filter?
-
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 ^^
-
How to set the world bounds in Phaser framework to circle
valueerror replied to Hitman666's topic in Phaser 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... -
valueerror reacted to a post in a topic: How to add a sensor in p2
-
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){ for (i=0; i<=allConstraints.length; i++){ game.physics.p2.removeConstraint(allConstraints[i]);} }}note that i use a workaround to get all constraints because the last time i checked the "getConstraints()" function returned "undefined" (i already reported the bug so it's probably fixed by now)
-
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
-
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
-
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!
-
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 ?
-
How do I create a Y-axis trail, from an X-axis moving object
valueerror replied to DennisL's topic in Phaser 2
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.. -
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..
-
Zoom into an object in the world (trouble with the camera)
valueerror replied to ForgeableSum's topic in Phaser 2
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 -
Zoom into an object in the world (trouble with the camera)
valueerror replied to ForgeableSum's topic in Phaser 2
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 -
Zoom into an object in the world (trouble with the camera)
valueerror replied to ForgeableSum's topic in Phaser 2
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 thought: don't use easing and definitely don't use tweens! this just delays the userinput and leads to situations where the user triggers an action but the tween is still running.. also your functions will have to wait for the tween to finish or deal with a constantly changing variable.. further you will create a hundred tweens in a second with your mouswheel function and every tween will try to do it's part.. what if the user suddenly wants to scroll out but the scroll-in tween is still running? what if the second tween is started but the first is still running? and btw. because you are not reusing your tweens but creating new ones the garbage collegtor will have a lot of work to do - but that's probably a problem for the future # use: game.camera.view.centerX and you can get rid of your setCenter() function # basically you are centering the object all the time into the center of the camera by moving the object.. this seems to be very problematic.. what if the object is moving on its own? what if there are a hundred objects.. instead try to center the camera over the object(s) - your current code seems to try something completely different than just zoom in or out of your map. # instead of scaling the world you should think of scaling a group.. that way you can define a seperate group that will not zoom (for the UI for example) # what about creating a jsfiddle or a phaser sandbox with a working example where everyone can try your stuff and test with real code? BTW. if you remove the touchzoom from my example and add the necessary code to your example to compensate for the scaling factor there will be no difference in complexity ;-) but it's always a good thing to write your own solution - a solution you fully understand ! -
P2 collision groups - have to set 'collides' twice?
valueerror replied to boolean's topic in Phaser 2
@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) -
Zoom into an object in the world (trouble with the camera)
valueerror replied to ForgeableSum's topic in Phaser 2
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)