valueerror

Members
  • Content Count

    1096
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by valueerror

  1. it seems that after the latest update game.scale.startFullScreen(); doesn't work anymore... changed to the new ScaleManager - the rest works as expected but the fullsceen stopped working...
  2. As you can see here : http://test.xapient.net/phaser/touch.html i managed to make a virtual gamecontroller with gamecontroller.js (source: https://github.com/austinhallock/html5-virtual-game-controller ) the problem with this is.. its horribly slow.. the joystick is the slowest so i use the dpad but for some reason the whole game get's even slower on every restart (if you die for example and respawn - game is a 3rd slower - die again - game slows down again) furthermore it seems like an unwanted overload if you can implement nice buttons with phaser quckly.. so i made these: http://test.xapient.net/phaser/ unfortunately you can click on them with a mouse.. but no touch them.. i do not want to set a function that is triggered on touch because for my purpose i have to ask for the state.. i need something like pseudo: if (buttonLeft.isDown) { left = true; } else { left = false;} if (buttonRight.isDown) { right = true; } else { right = false;}i read through other posts and the docs for hours but i can't figure it out.. so help would be very much appreciated thx!
  3. No vibrating on the nexus 7.. Very nice game btw.
  4. 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/
  5. so.. after playing around another 2 days with collisiongroups i think more and more collision groups should be handled like materials.. maybe i just can't see the advantage of the current approach but to me as newbee it looks like to much work.. i know 2.0 is in the middle of development - so if this is work in progress and will change in the next weeks anyway.. please ignore this post.. in the material world you do the following: define materials (what is the parameter in the brackets for? e.g. 'ground' or 'player') var groundMaterial = game.physics.createMaterial('ground');var playerMaterial = game.physics.createMaterial('player');set materials to physics bodies ground.body.setMaterial(groundMaterial);player.body.setMaterial(playerMaterial);setup what happens when material1 contacts material2 globally.. game.physics.createContactMaterial(playerMaterial, groundMaterial, { friction: 4, restitution: 0.6 })in the collision world you have to do it this way to achive collision between to physics bodies: define collision group var playerCG = game.physics.createCollisionGroup();var groundCG = game.physics.createCollisionGroup(); set collison group and define with which group this body has to collide ground.body.setCollisionGroup(groundCG);ground.body.collides(playerCG); player.body.setCollisionGroup(playerCG);player.body.collides(groundCG);this is i little bit inconsistent.. while this seems oke or as much work as materials in this example, think of a typical platformer where there are several different objects and all of them are in the "groundCG" ... an for every single object you have to define the same thing over and over again.. playerCG collides with groundCG and vice versa... why no do something like this (pseudo):game.physics.createCollisionScenario(playerCG, groundCG, collisionCallback, processCallback, collisonContext, options)so you define it once and every(physics)body in those groups collides as defined. (and of course you can have a custom processCallback like in 1.x to create platforms where you can jump through from below but still stand on ;-) ) ______________ and btw. how do i set a collision group to the game.world?? for materials there is: game.physics.setWorldMaterial(groundMaterial);but there is no.. game.physics.setWorldCollisionGroup(groundCG);once you define collisiongroups everything needs to be defined explicitly - nothing just collides anymore and the player walks right through the world bounds... (there is a setting to create it's own collision group when setting the worldbounds - but what then? how is this group named? how to setup the player to collide with it? collideWorldbounds seems to do nothing at the moment in connection with collision groups.
  6. great to here @education. starting with phaser and a bunch of students next week - we're going to give 2.0 a try. because they don't want to learn an outdated version they decided to be oke with typical development verison problems. but as far as i can see there won't be much problems and it will suit us well and we will grow with it ... thank you very much for creating this great framework/library/engine
  7. 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!
  8. argh.. i could swear i tried this.. thank you very much rich !
  9. @lonan: any luck with those questions? i have the very same questions.. i can't even get a collision callback to work.. the docs say it sends 4 parameters.. This body, the body that impacted, the Shape in this body and the shape in the impacting body. but how to i use these in my callback function? i can do something like this: player.body.createGroupCallback(starsCG, collectStars, this); function collectStars(player,star) { star.removeFromWorld(); } but not this... star.body.moveUp(400); (instead of the removefromworld stuff) because there is no body that can move up
  10. 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 !
  11. so i'm testing collision groups in a very simple testgame and with only 4 different collision groups i have a lot to do now.. so i wonder if it would be possible to set some of the settings directly to the group. an example: playerCG = game.physics.createCollisionGroup(); groundCG = game.physics.createCollisionGroup(); platforms = game.add.group(); plattforms.physicsEnabled = true; platforms.bodies.setCollisionGroup(groundCG); platforms.bodies.collides(playerCG); player.body.collides(groundCG); and another question: is it possible to be in more than one collision groups? thx in advance!
  12. 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..
  13. @rich.. tried materials.. love it ! sticking to paddle is gone now when i apply friction=0 but then i have an ICE paddle with no friction at all.. the moment i apply friction=0.01 the sticking to the side is back.. so i have no clue how to create something where i wouldn't slide over like on a frozen lake and still don't stick on the sides .. you can try my "ice-pedals" against my "ground-pedals" here again http://test.xapient.net/phaser/ also i would like mario to slide down on a rotated paddle with normal "ground-material" i've created an additional "slide-material" and applied it to the rotated paddle but it would be better the friction would be reduced automagically with more rotation.. it should be reduced proportionally .. more degrees less friction or something similar.. then the problem with sticking to the side of objects would be solving itself.. oh.. and how can i do this again? (it's not working in the latest git pull but because i found it in the updated docs i thought it should be working) game.physics.collide(enemies, player) ; thank you very much!!
  14. yay!! great news to me it definitely sounds more like 2.0 than 1.2 ;-)
  15. it doesn't collide with other elements with mass=0 or static=true but it collides with my fireballs and my player.. @box-shadow.. i just can't see how a box shadow drawn around the canvas that is only drawn once can affect performance inside the canvas.. okay.. i CAN see it but it really shouldn't .. i just tried tweens... i wanted to create a paddle that moves around and mario can jump on it.. seems i can either create something to jump on or something that moves.. tweens on physicsEnabled bodies don't move anything (or am i doing something wrong?)
  16. thx rich.. i hope i'll find some time to look into materials tomorrow.. as for the "moving an object from right to left in a world with gravity without changing y" part.. i found a surprisingly easy solution.. bullet.body.mass=0; and in the update function bullet.body.x -= 2; so it's static AND moves to the left another thing maybe worth mentioning.. there is something i already found out when programming with processing.js so maybe this is a problem with webbrowsers, graphics drivers and canvas and has nothing to do with phaser.. but what do i know ^^ chromium browser (at least on linux) slows down when i apply a css box-shadow to the div around the canvas... firefox doesn't seem to suffer from this problem... BUT firefox (27) is extreeeeemly slow when using webgl.. so i set up the game with Phaser.CANVAS and firefox is as fast as chrome again.. even faster... (fast or slow is somehow mesurable in my testcase because the cannons live only for 6 seconds.. with box shadow they die after the 3rd quarter of the game world .. without box shadow they leave the game world.. firefox with webgl is so slow.. the canons die in the first quarter..
  17. ad 3) i thought at something like a beforediecollbackfunction.. but without this it's probably easier to start a well timed tween before the object disappears.. ad 4) sorry.. i found out that it works as expected but forgot to delete point nr4. ad 5) so i gave it mass 0.1 .. even 0.001 and it still moves down to the ground.. it only moves faster to the left now.. i wan't to create something that just flys through my game world.. from x=800 to x=0 without changing y due to gravity.. http://test.xapient.net/phaser/index2.html (EDIT: so when individual gravity arrives this problem will also be solved ) ad 6) i'll give it another try and (if unsuccessfull) post an example ad re cool thx.. i'll give it a shot
  18. hello rich.. i just saw that you added something about materials.. i can't wait to make ice plattforms with almost no friction.. i wonder how to use this? (btw. mario does not only stick to the sides of a plattform, he also sticks to the worldbounds(left/right) i have some more questions if you don't mind.. (if for my questions/problems to solve itself i only have to wait until you release phaser 1.2 - please say it and i'll give it all the time it needs ) 1) player.body.adjustCenterOfMass(); i need to set this, otherwise my player sinks into rotated objects.. but now it hovers over them .. normal? 2) is it already possible to somehow check if the player has hit something or rans into something? i miss the "touching.left/right" part.. 3) lifespan is a usefull method to make things disappear.. is is possible to do something with those objects right before the die (little animation.. scale.. something like that) 4) enemies.forEachAlive(moveAliveEnemy,this); the function moveAiveEnemy is not called anymore.. is there a substitute for something like this? 5) if body.mass=0 why can't i move them anymore.. it makes sense with static=true.. but mass=0 should let them float around or am i wrong? 6) preload bar seems broken in the latest git pull (from yesterday) i just get the green rectangle btw. it's really nice how my fireballs roll down on rotated plattforms .. it's a lot of fun to play with and learn phaser
  19. hey thx! so i tried your suggestions.. 1) rotation is now fixed! 2) 'immovable' works with paddle.body.mass=0; and in the latest git pull (right now) also with paddle.body.static=true; 3) i scaled the sprite before applying physics.. it works now! thx again! 4) with the zip file from yesterday i could move my player with player.body.moveLeft(200); in todays git pull this doesn't work very well ^^ i need to give it 2000 instead of 200 BUT the body.velocity.x works now !! -- can you tell me why the coordinate system is the other way around now? it seems 0,0 is in the lower right instead of the upper left? -- gravity works in the git pull from 5 minutes ago without the strange force to the left .. moarrr testing tomorrow -- phaser.min.js is still 1.1.5 in the git repo? or is it just the comment? -- one strange thing i noticed was that my player sticks on the side of another object and is not falling down when i keep pressing the keyboard button that moves the player towards the object.. you can try it here.. it's on my playground again http://test.xapient.net/phaser/
  20. first of all.. thx for your work.. i really like phaser (i decided to stay with version 1.1.3 for my work with my students because of the functional arcade physics) and i can't wait to use phaser 1.2 !! i also already found out (thx to your examples at http://labs.phaser.io/ ) how to enable physics on my objects.. but then they floated around like in space.. so i read more of your source code and tried a lot of things and found out that setting the gravity for the whole world works game.physics.gravity=[0,-60]; i don't know why but the objects still move to the left of the screen very slowly ?! i have to set it to [18,-60] now i need to tell some objects to be 'immovable' (which doesn't seem to exist anymore) also everything keeps rotating so i set player.body.rotation=0; on every update cycle because player.body.setZeroRotation(); still rotates the body eventually. also i found out that the rectangle around the body with physics.enabled is always in the original size and ignores scaling .. is this behaviour intended? should i manually size down the rectangle somehow? another thing i found out is that the collision detection is not that straight anymore.. things seem to first fall into the other objects and then move out of them slowly.. but it's the same way on all p2 examples here is a link to my test case http://test.xapient.net/phaser/ if you like to try it ;-) thx again and keep up the good work! (my student also love phaser )
  21. hello there! i would love to help testing phaser 1.2 but i just learned how to use 1.4 to make a super mario bros like jumpnrun and now it seems my knowledge is obsolete.. it took me an hour to find out how to get gravity working again and my testMario moving left and right.. still found no game.physics.collide() replacement is there some sort of 1.2 api / reference / howto / demo / documentation / example.. or am i supposed to read the docs for p2.js or just the phaser1,2 source code like i'm doing right now ;-) ?