• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by valueerror

  1. chrome dev tools are always open here.. the memory consumption rises over time... starts with 15-35 and when fps are as low as 5fps it resides at 50-70 mb.. but this is still ok IMHO.. all functions that need 2ms at the beginning need 25ms or even more after 30 minutes.. it just doesn't make sense.. the rest of the system is snappy as ever, other browser tabs are also not affected restarting the state gets everything back to normal.. 60fps steady.. not a single framedrop.. i also tried with firefox.. but after several minutes the same thing happens...
  2. thank you both.. after inspecting the reset function that is called every second i found a way how this could interfere with the kill function i wrote and removed that rare case.. the game is now running properly and the weird behaviour is gone.. only one problem left though.. the game is getting slower over time.. but this is a topic for a different thread
  3. in my game (an endless runner) there are only 10 sprites and i'm constantly killing and resetting them.. it's simple.. if they passed the world height they get killed and reset on top of the world.. then they fall down again.. now i am searching for the reason why my game drops down from 60fps to 5 fps after running for 20 minutes .. (it's always the same state that is running) first i suspected one or two sprites that are created and destroyed in some rare cases.. so i got rid of them and started reusing the same sprites then i suspected all those anonymous functions that are created in a loop timer that runs over 3 groups (forEach) and always creates new anonymous functions. i got rid of them and now use predefined functions the game is still gettting slower and slower.. so there is only one thing left that comes to my mind.. game.add.tween this is also called 4 times when a sprite is killed and revived because the sprite dies with 2 tweens and gets reborn with 2 tweens... i got rid of them by defining them once and just starting the same tween again when it's needed.. now i'm stuck.. what else should i look out for? thx in advance
  4. i don't think it's that big of a problem.. it only happens if you fall down from a big height and only if the gravity is that high.. (most users use a lower setting than 1400) AND you still can tweak the behaviour through stiffness, relaxation, restitution in the real game you constantly walk and jump and look at enemies and the world surrounding you - so it isn't that obvious that the player sinks into an object. BUT i would definitely want to hear what @rich and @schteppe have to say to this
  5. thx for your reply do you think that something changed the value right between the if statement and the console.log() ?? i'm definitely going to investigate that..... there are only 2 places where i set onAir to true.. the "exploding" function that sets onAir to true but sets it back to false after a tween and right before it calls the kill function (so objects passed to the kill function from here should never be "onAir" ) an the reset function which is called every second ... so this one falls out of the "linear" concept.. it suddenly kicks in and could interfere in very VERY rare cases.. im going over my "reset function" again.. there has to be a logical reason for that ..
  6. yeah but why are we talking about examples where restitution is key.. the topic starter clearly is NOT talking about the bounce effect caused by restitution.. he also postet an example where restitution is left to the default 0 (Zero) and precisely describes what he means. the correct answer to this question is probably: have a look at the relaxation parameter of p2 materials: see this example and play with the values... the very high relaxation value makes the "bounce-back" go away. but now it's stuck inside the other object (because it's not slowly bouncing back anymore)
  7. in my newest game i'm having serious troubles .. it's the first time that i have absolutely no clue why things happen the way they happen the biggest problem is that the game works as expected but after 3 to 10 minutes things suddenly happen that should not happen.. i did not program those things.. i went over my code a hundred times now my sprites that are constantly killed and reset suddenly are killed right after the reset.. but the reset sets a custom object variable to true and therefore should block the killing (but it doesn't) it's no complex thing.. if (var == true) {do not kill !!!!!!} (but it's killed anyway) this is probably related to what i just observed. i wrote the following code in my kill function in order to find out more about those weird problems: if (obj.sprite.onAir === true){console.log(obj.sprite); return;}the interesting thing is that if i look at chromes console log the sprite definitely says " onAir = false " if it really were false it shouldn't be in the log .. right ??? what the hell? (using phaser 2.3)
  8. this has nothing to do with the restitution.. as you can see in the example you postet the circle in the middle also "bounces" -- or in other words .. it sinks into the ground and then moves up again.. you need to observe very carefully to see it.. the faster the object is on collision the bigger the "sink/bounce" effect.. this is a p2 problem. i haven't seen this behaviour in box2d and i already tried to find out more about this but the only person that responded didn't want to see the difference ;-) try this box2d demo.. the box never sinks into the ground.. nomatter how hard you throw it
  9. hey there. i just released my first game (ever) and wanted to show it here so you can try it (and maybe tell me more about how it performs on your device and how many bugs you've found ;-) ) it is called "cool cows on ice" and features a cow (obviously) and some crazy kamikaze penguins that may, or may not help you finish a level... you can touch and hold the cow and then throw it as precisely as you can into the target area. the game is build completely with the amazing phaser.js framework and p2 physics i used crosswalk 10 and intel xdk to package it it also has ads (one interstitial in the menu - only once) and non-intrusive banners in the score screen - and the option to remove them almost all the graphics and animations are created in gimp the audio tracks are composed by good friend of mine (dj k├Ârner) here is a screenshot: here the promo video: and here the link to the play store (please rate and test.. thx)
  10. i proudly present my first game published in googles "playstore" good luck - have fun
  11. you can use this plugin (or my customized code from this post)
  12. so i tried this approach and the thing is.. this only delayed the problem.. when the game starts only 3 pieces are decoded and played almost immediately.. the big portion gets decoded when the first level starts.. i have 30 seconds delay until the first sounds can be heard.. that's just bad so phaser doesn't provide a way to just preload everything at once but start playing the first decoded sound if it's already needed immediately.. it for some reason waits until all sounds are decoded before it plays the sound that is already decoded minutes ago.. i found a simple workaround i set autodecode to false for those sounds that are not needed immediately BUT i make them decode 200ms after my "menu" state is ready - simply by starting it - and stopping it Preloader =, function(){if (firststart === true){'',0,1,false); music1.stop(); firststart = false; }} );this way i can precisely define WHEN a sound is going to be decoded.. any thoughts on this ? is this bad practice ?
  13. found an interesting bug in my game due to 2.3 calling forEach on a group and then (in the forEach function) adding something to the same group causes chrome to crash completely and firefox allowed me to stop the script.. so i was able to find out the source.. this didn't happen in 2.2
  14. doesn't move
  15. short answer: you can't ! long answer: cocoonjs told me (because i asked the same question) that this is currently not possible and the have no plans to allow this at the moment.. this doesn't mean it won't be there at some point in the future. for me this was one of several reasons to use "crosswalk" instead of "cocoonjs"
  16. graviy is not really an overkill.. keeping your update loop simple is much more important.. i make heavy use of physics in my game and what brings performance down are particle emitters... 50 tweened sprites sound horrible to me.. (depends on how many parallel tweens you run) but tweening 6 sprites in a loop costs me 10 fps already in a new game of mine so i deleted the tweens.. do you reuse those sprites properly?
  17. you've set the global gravity.. you can now use the gravityScale setting to configure how much the global gravity affects the specific bodies..
  18. like tomatom said.. also make sure the feet are all on the same position and touching the bottom of the image so your character will stay on the same position
  19. this is ptobably a texture ATLAS.. split them up and recreate the atlas with spritesheetpacker or texture packer or any other suitsble tool so you get the fitting json file too
  20. it probably should be: game.add.image instead of this.add.image (this referrs to "GameState" not "game" right?
  21. all my "fixedToCamera" objects (icons, bitmaptext, etc.) ignore the x and y position values i gave them .. they are always at 0,0 (the upper left corner) but as i said.. only if i set fixedtocamera to true totalStarsicon.fixedToCamera = true;
  22. so sandbox is going to be used as something like jsfiddle for phaser? the play button is also the save button (it took me a while to see that) is there a way to get back to my sandboxes in the future?
  23. first of all.. if you want your player to collide with the map they have to use the same physics system.. you can of course paint such a map in "tiled" editor (using polylines) and then use p2 physics to make an object with physicsbody out of it. you could then use a custom function to determine if the player is touching the ground (i can provide this function for p2 only) BUT the better answer to your first question would probably be.. use directional sensors to figure out if you are touching the ground and where
  24. map.getTileWorldXY(player.body.x, player.body.y,32,32, layerwalls) you can use this line to find out if there is a filled tile in an 32x32 area behind the player on the layerwalls
  25. phaser sandbox.. hope it works