valueerror

Members
  • Content Count

    1096
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by valueerror

  1. http://phaser.io/examples/v2/arcade-physics/platformer-basics Maybe this helps?
  2. well.. the knot in my head didn't get lose yet.. it seems this is not possible since noone could answer this question. so i let them collide as usual but in the on presolve event i check if bodyA or bodyB are the specific bodies that should collider with everything but with each other only "report" the collision event without the collision response and i csncel the complete collision there... sounds to complicated for me to be true.. i still think i just overlooked the obvious thin here.
  3. i have a big tilesprite (tiling only vertical) and i need it to be mirrored on some occasions.. so everything on the right will be on the left. if i try the old trick to scale it around the x axis to -1 it just gets black.. is this even possible or is this something restricted to normal sprites?
  4. oh.. and in your case you need to set velocity.x to 0 somewhere if no button is pressed. you know that every basic tutorial and some of the official examples cover all of these problems
  5. game.physics.p2.hitTest({x: 200, y: 300}); this gives you an array of p2 bodies that are underneath the point x:200 and y:300
  6. in arcade physics you have a very convenient method called "onFloor()" to find out if a body is on floor.. that's all you need
  7. i'm (again) not able to remove ALL constraints in my game state by cycling through the array getConstraints should deliver because all entries are "undefined" am i doing it wrong? has something changed in 2.2.2 ??? thx for the help!
  8. create a group for everything.. background layer1 layer2 foreground add every item in your game to one of those group.. if you initialize "background" first and "foreground" last - background will be under foreground and everything added to the group background (even later in the game) will be under the other layers..
  9. the usual way would be to create a json file with the information about the polygon (the coordinates of the points) i'm sure i already saw an example on how to feed the information about the polygon to phaser by an array.. the content of that array can be dynamically created of course..
  10. you can use any polygon as collision shape in phaser if you use p2 physics
  11. my mario is holding a sword in my demo game here: http://games.xapient.net just if you want to have a look
  12. show and hide isnt the problem.. just set visible to true and a timer to set it to false again. or use an animation with a blank frame at the beginning and it ends with that blank frame again.. so it will show,strike,and disappear again.. doesnt link always hold the sword straight up into the air while running? i thought its always visible.. the problem i see is how would you enable collision and disable it after the strike again... are you using arcade or p2?
  13. yes i tried it.. i found the ufo controls surprisingly intuitive.. i mean the method of changing the direction by rotation oke.. you basically build with cordova and did everything manually.. i guess this would be the equivalent to intel xdk "build for android" - i tried to build my game with cordova but on my oneplus one with cyanogenmod the app only showed a white screen.. so i continued using crosswalk..
  14. sorry but if your sun is a circle.. use a cirle as hitbox.. you need to use p2 physics for that of course .. then you could also use polygons to define half moon shapes precisely.. if you expect phaser to automatically adjust the hitbox you will always get a rectangle in the size of your image
  15. im really curious... could you tell me more about how you built this game into an apk... the filesize is so small.. i like that (crosswalk delivers a whole chromium therefore the filesize is always over 20mb) what tool did you use and how?
  16. https://jsfiddle.net/valueerror/pdx0px0w/ so.. this should work now..
  17. phaser does not.. i have ;-) i need to search for it.. wait a secooooond... ah.. there it is http://jsfiddle.net/valueerror/pdx0px0w/ it took me hours to get the math right .. lol sorry.. where do i get the phaser.js file now? i need a https source ??
  18. learning.zip so it was like i "tried" to tell you but i wasn't very clear about it.. sorry your image "Shades_of_blue.jpg" (which btw is a little bit big and you would be better of with a small tilesprite here) anyway.. this image was no multiple of 32 in its height. therefore i needed to kick it out of tiled editor.. resize it and reimport it.. another error was in this line: mymap.setCollisionBetween(1,200,true,'layer2');you need to enable the collision for the tiles 1-200 for one of your layers .. for example "Tile Layer 1" - layer2 is not existing since you also added shadesofblue as tilesprite background there is no need for the additional blue background layer in the tilemap .. it's much better to use a tilesprite for this because every tilemap layer that needs to be rendered has a huge impact on performance.. so here is the working version of your learning example glhf !
  19. well ... especially if you consider working with cocoonjs you need to know that cocoonjs is not able to use bitmap fonts without a custom xml parser.. also canvas+ delivers only the canvas element.. so everything DOM related will not work afaik. also styling the canvas with shadows for example will lead to a huge performance problem so i dare to say your 2 way approach will probably lead to some problems on mobile.. not definitely but it could updating the text is not the problem IMHO.. i think it's a very cheap function.. the text is still going to be rendered 60 times a second.. it doesn't matter how it looks like (if there is a "1" or a "2" or an "A" does't matter at all) if you consider using cocoonjs with webview you lose the huge performance boost canvas+ offers - if so i recommend having a look at intel crosswalk too.. it doesn't require any hacks and has no problem with bitmapfont, buttons, anchors, webgl, etc.
  20. if you really have performance problems i highly doubt that these come from your distance counter... but just in case.. someone told me to use "bitmap fonts" for text because normal text (i can't imagine why) is slow compared to bitmap fonts !?!
  21. huh? the canvas size has nothing to do with the issue.. the error suggests that your tilemap is no multiple of your tileset-tilesize.. if you still struggle with this - zip the whole thing and upload it here as attachment.. i'll have a look at it asap
  22. you definitely can not use the internal emulator and as far as i know ads are not working in the app preview either.. i think i read something about this and they said it will definitely come but is not finished yet.. therefore you need to build and install your app everytime you want to test something related to thirdparty plugins
  23. since the physics and the rendering are not coupled anymore in phaser 2.2.2 my game would still run at the configured 50fps physics frames per second.. in one point you are right though.. my meter-meter would run twice as fast i'm definitely going to fix that