Jump to content

Please help test Phaser 1.2


Recommended Posts

hello rich..  i continued testing phaser 1.2 (collisiongroups work very well btw.)


i tried to add a circle instead of a rectangle to my player  ...   player.body.addCircle(25); 


and  then my testgame stops with "type error" in the  render function.

i use game.debug.renderPhysicsBody(player.body);   if i comment this out the testgame starts (but i don't know if the circle is actiually applied because i don't see it...  any thoughts on this? am i doing it wrong?


edit: i also tried setCircle()  like in the cannon wip example but it doesn't matter..  but since it works in the wip example i guess the error lies on my side.. hmmm...  i just can't see it :( the only difference is thay i am using phaser.min.js  so i tried the example code with phaser.min.js and .. it doesn't work anymore.. i get the same error..

Link to comment
Share on other sites

so .. more testing..   (latest git pull - today 9.20)  and some problems i found.


setCircle is NOT working in phaser.min.js or phaser.js but is working when i include everything seperate.


 game.physics.gravity.y = 40.0;  is NOT working when including everything seperate but it is working in phaser.min.js

( Uncaught TypeError: Cannot call method 'px2p' of undefined InversePointProxy.js:59)



also worldbounds are not working anymore.. no error.. just ignored..  everything just falls out of the game area..  

EDIT: without a collisiongroup for my player worldbounds work as expected.. so this is intended when using collisiongroups? (please help me to set up a collision group for the world bounds then.. i just can't figure it out..  thx in advance!)


i left the "game" running for 1 hour yesterday and when i came back chromium ate about 2GB of ram and the game was very choppy and almost crashed my system...  i had to kill chromium


glhf !

Link to comment
Share on other sites

ok thx!

so i will be using the other approach and include every single file from now on...  well then, setcircle is working :) but still other problems remain or got introduced




what about gravity ? could you please tell me if you changed the way to apply gravity or if there is some error to sort out (i'll stop trying and start waiting in patience).. i've tried several different ways to apply gravity with no success..

EDIT: just saw you did a git commit 2 hours ago..  downloading and testing :)  EDIT2: tested! working again - thx! but the values gone crazy..  to achieve the same speed going down to the ground i have to use gravity 2000 instead of 50


and for the world bounds.. i read the source so i think i found out that  if i set collision groups i have to set    [setCollisionGroup=true] when applying world bounds   so i did this..

game.world.setBounds(0, 0, 2000, 1200,true, true, false, false, true);

now i need to know what the name of the  boundsCollisionGroup  is that should be set now - or how i assign one to the world so i can set my other collision groups to collide with it..  


thank you!

Link to comment
Share on other sites



is it possible that there is an error with the physics engine?

If I try this code:

create(){	this.game.stage.backgroundColor = '#000000';	this.game.physics.gravity.y = 20.0;	this.game.physics.setBoundsToWorld(true, true, false, true, false);	for (var i = 0; i < 10; i++) {		var box = this.game.add.sprite(0, this.game.rnd.integerInRange(-200, 400), 'box');		box.physicsEnabled = true;		box.body.allowSleep = true;		box.body.mass = 1;	}}

The boxes should get created on the far left of the screen (x=0), but after creation they get "shoot" out of the left side. Is this a bug? Or am I doin something wrong?


Here a little video of the behaviour (latest pull - 1.2 branch):


I need to set x = 17 during the sprite creation to get the expected behaviour:

Link to comment
Share on other sites

so no update on the collideWorldBounds thing?



another rather small problem i encountered is that a player with a round hitbox can walk (under special circumstances)  through materials if you move it forward firm enough..  you see what i mean on my playground.. just walk into the first paddle without ducking.. or duck and stand up right under it..  you can continue to walk.. slowly  http://test.xapient.net/phaser/   :huh:

Link to comment
Share on other sites

Is it possible that the new ScaleManager and StateManager aren't included in the latest build at github? My game doesn't run anymore because the states can't be started (this.state is undefined).


Also, how can I build Phaser from the source? Tried to run build/build.php in my browser from a cloned repo but the output file is only 288 bytes in size..

Link to comment
Share on other sites

Right... I'm nearly done on bug fixing. It was essential to me that I clear out and resolve every single issue in github before carrying on with physics. And I'm glad I did! I've fixed and tightened up loads this week:


Brand new visibility api handler (game pausing / resume is a lot more consistent across device now)

Brand new full-screen api handler (updated for new W3C spec + IE)

New "paused duration" handler, so things like pausing animations and tweens work properly now

Updated State handler - you can now pass parameters when you switch states and the load/complete loop is smaller and more sane :)


Today I'm going to finish the outstanding bugs in the TImer classes, and that will close down a load more issues on github.


Once done I'll update p2 and finish off the contact events and add in all the missing ones (postBroadphase, begin impact, end impact, etc).


I also need to decide what to do with the Particle Manager. I think I'll configure it to use p2.Particle objects by default as they're super fast. I'm not happy with it though, it's a real legacy left-over from Flixel, but it works for now I guess. It's an area that needs big improvements later though.

Link to comment
Share on other sites

Hmm it's working fine for me. Please try examples/wip/fullscreen.js and see what happens. But I just tested it on Chrome, FF and IE and it worked fine on them all.


Note: this is from source, not the build files (although I did update them a few hours ago so they should be ok for this).

Link to comment
Share on other sites

wow .. this took longer than expected to figure out..  i tried the new fullscreen.js wip example and it worked..  so i tried to find the difference to my setup..  no difference exept one.. so  i removed the   whole "GameController.init()" part and the gamecontroller.min.js   and guess what..  it's working now..    :)

Link to comment
Share on other sites

Hey Rich!

Just a question I still have misunderstood. 

So with the TypeScript definitions,  would you have, as part of phaser in the build/ directory


For example Nate Long has a great definition for PIXI which appears up to date. (thanks Ezelia)



Can this be added to the phasers build directory?  


Should I grab the relevant bits Phaser uses from Nate, and create a subset (You made a list of unused features on page 3),  and put it inside phaser.d.ts  like you did with the SAT module?  

I am seeing this as a question of best practice, both from an open source perspective and how multiple definitions work together.  It is difficult to google this!

Link to comment
Share on other sites

@rich..  i just wanted to say that i tested the fullscreen option again and it looks like initializing the gamecontroller from https://github.com/austinhallock/html5-virtual-game-controller  breaks it...  


including the javascript file  and the init code is oke but the moment the controller is created (even without any options)  for example:

if (!game.device.desktop){      GameController.init();}

fullscreen stops working.

(but all in all i'd rather like to create this kind of controller with simple phaser.buttons instead of this huge gamecontroller thing.. i just didn't find out yet how to get the button states (over,pressed,nothing) for touch input)



also after the latest update    someobject.body.mass=0;   completely messes up the positioning of the object in the world.. i changed this setting to someobject.body.static=true; to get the "imovable" state and it works..

Link to comment
Share on other sites

@rich..   at this button touch topic..  i found out that the right way to do this would be through   events    right?    so i'm doing this

buttonup = game.add.button(20, 20, 'buttonup', null, this, 1, 2, 1);  buttonup.events.onInputOver.add(function(){jump=true;});buttonup.events.onInputOut.add(function(){jump=false;});

and on inputOVER nothing happens..  but on input down..  (tap) jump gets set to "true"  and my player jumps..   but then it never stops..  paranoid tapping around in the game (on the button, on the blank space, on the button again) stopped it eventually..   did i hit a bug here? or just the wrong approach?   when using the mouse it works perfectly...




EDIT:  it seems that touch is more complicated than i thought...

i have to catch the "onInputDown" and "onInputUp" action too to do nothing or the same wanted thing..  because i just found out that tapping somewhere and than keep the fingers down and move over the button works perfectly on the tablet ... just not tapping..  tapping is somehow interpreted as InputOver and InputDown..  but "untapping" (raising my finger directly over the button not swiping out of its bounds) is not interpreted as InputOut  just as InputUp


i don't know if this is important information for you..  if not..  sorry for spamming :/

Link to comment
Share on other sites

hello.. it's me again.. this time with a HUGE performance problem.


on the ipad2 with canvas my testgame is fast as hell..

on the nexus7 2013 with webgl it is horribly slow.. definitely unplayable !!


this seems to be a pixi.js problem..  now i force canvas :(


it should definitely be the other way around...

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...