InsOp

Members
  • Content Count

    44
  • Joined

  • Last visited

Everything posted by InsOp

  1. Thank you for your thoughts. Do you think it is possible to merge the multiplayer-aspect of the Isogenic Game Engine with either Phaser or Cocos2d ?
  2. Well I solved the problem. I am destroying sprites which are not in the cameraview and creating those which newly came into the cameraview. I now have 60 fps again and it does not matter whether I have 5 or 50000 units (i guess). the drawback is that scrolling is a little bit slower than before.
  3. thanks for the answer, No I dont. (At some times I do, but this wouldnt be the reason it has low fps all the time) I did profile the app with chromes devtools and i figured out that it probably is not my fault. (the marked game.update is my implementation) nonetheless the fact that i have several groups (layers) full of gameobjects which stretch themselves across the world could be the reason why it is not able to skip objects which are not inside the cameraview(?)
  4. Hello, as I currently noticed, my fps are dropping when i have many (currently ~7.000) gameobjects in a scene. Each object contains several other sprites like shadows,etc. So I wondered whether phaser is rendering all of them. If so: would it make sense to destroy all game objects outside of the cameraview and only display those within the cameraview? (Like here: https://github.com/marcus-robinson/chunk-map ) I'm using phaser 2.4.0a
  5. Is there a global functionality in phaser to pause all animations for later unpausing them ( without starting animations which werent running before)? And if - would the absent of animations wind up the frames per second?
  6. InsOp

    animated tilemap

    thanks I did try that, even with a given smaller area its far too slow - i checked the replace function and what it does is just what im doing manually, but significantly slower..
  7. InsOp

    animated tilemap

    I finally had the chance to test those two proposals. to jmp909: I would have to completely restructure my map.json, since its a different type of layer. Half of my map is water and i feel `createFromObjects` is not supposed to be used in such vast amounts. to Skeptron: I think this is what Im needing, unfortunately its not compatible to the current phaser version i have to wait until Chad Engler has time again for this
  8. InsOp

    animated tilemap

    is this even possible to achieve? does anyone know? ive done it now like this: // in game.create:setInterval(map.animateWater, 100);//in my map object waterTiles:[26,27,28,29,30,31], waterTileIndex:0, animateWater : function(){ var mapTiles = game.layer0.layer.data; var index; //screenSpritesCountW: tiles visible in screen (width) for(var x = 0; x < map.screenSpritesCountW +1; x++){ for (var y = 0; y < map.screenSpritesCountH +1; y++) { //offsetY: offset from y=0 in tiles var m = mapTiles[y+map.offsetY][x+map.offsetX]; index = map.waterTiles.indexOf(m.index); index++; index %= map.waterTiles.length; //finally changing the tileface m.index = map.waterTiles[index]; } } //trigger the stagerendering game.layer0.dirty = true; },I dont know whether this is efficient, since all tilemaps get new indices (not only those who are in the camera view) is there a better way to achieve this? edit: I was able to reduce the cost a little - i only recalculate those water tiles which are currently visible - still having 10-15 fps less
  9. InsOp

    animated tilemap

    Sorry I dont see how i can apply your example to my example
  10. InsOp

    animated tilemap

    hey i made a background just like in that example: http://phaser.io/examples/v2/loader/load-tilemap-json now i have like waterfields and i want them to be animated, how do i achieve this (with this method)?
  11. Hey, I have a 2d field with units occupiing several fields. I change position of this units once in a while - but the data for the positions comes from a node server. that being said: i have some "airunits" and I wanted to implement a certain shaking - to create an illusion of them floating. So I added this code game.phaser.add.tween(unit.sprite) .to({x:unit.sprite.position.x+1,y:unit.sprite.position.y-1}, 400, Phaser.Easing.Bounce.InOut, true, 0, -1, true);works like a charm except for some critical aspects: I cannot move my unit around, now since the tweening interferes with my manual sprite positioningI wouldve liked it more randomized, so my aircraft does float more casualI could have implemented this aspect by myself somehow, but I like the smooth easing. Is there a good approach for this issue? Is the issue sufficient described?
  12. if im having game.input.mouse.onMouseMove = function(e) { //... };defined, the game.input.activePointeris somehow bugged, especially .position.x and position.y and .button . it appears that it only updates, if a button is pressed. well I guess the default onMouseMove event is overwritten if I use the lines above, it is like e.preventDefault(); Is there a way to work around this behaviour?
  13. id like phaser to easily zoom in and out the world
  14. Hey im getting this error when i just reference the javascript file in my html-head. no function called. RC 2 just worked perfectly. Edit: shouldve rechecked the github. a fix already is available. thanks, now it works like a charm
  15. now that game.input.mouse.buttonis depreciated, what is the new equivalent to this? I could still use game.input.mousePointer.buttonbut the changelog says to use the pointer object instead. But im overstrayed, since there are like 10 pointer objects plus the pointers array. which one should i use?
  16. Okey, as i found out, my problem is phaser related. for each created game object, there is an array which then is filled: game.world._hasheven if you call the destroy method of a group or its children, this array still retains all objects. -> Garbage Collector wont collect those objects, because there is still a reference existing. This causes Memory leaks (and ultimately my game to crash because it sucks up too much memory). Is it safe to set game.world._hash.length = 0Or is there another, better way in phaser to do this? I really think its somehow my fault, since i cant imagine that im the first one who has this problem. For what is this array needed anyways?
  17. Hello, I'm having trouble with Memory leaks. This is why I have some scenarios im having questions about s1: var group = game.add.group();var sprite= game.add.sprite(0, 0, 'sprite');group.add(sprite);group.destroy(true,true)s2: var group = game.add.group();var sprite= game.add.sprite(0, 0, 'sprite');group.add(sprite);sprite.destroy();s3: same scenarious, but instead of the sprite object Im having primite graphics or text. Now my Question: Will there still be a reference to that sprite-object? Or is it ready to be collected by the Garbage Collector? Thanks in advance PS: is there a way to check if a reference still exists in the phaser universe - maybe a function where i get back the sprite-object through the key? Edit: I guess it works everything fine relating to destroying objects in phaser. I came up with the idea to count all objects like this countChildren(game.phaser.world.children);var countChildren = function(group){ var sum = 0; for(var i in group){ sum += 1; if (group[i].hasOwnProperty('children') && group[i].children.length>0){ sum += debug.countChildren(group[i].children); } } return sum; }I always got back a constant value - so my memory leak has to be somewhere else ~~
  18. having solved this issue with the help of xervers topic: http://www.html5gamedevs.com/topic/8897-scaling-down-a-tilemap-layer/#entry52797
  19. if i understood you correctly i could change this line: tween = game.add.tween(logo).to( { x: [ w, w, 0, 0 ], y: [ 0, h, h, 0 ] }, 4000, "Sine.easeInOut", true, -1, false);into tween = game.add.tween(logo).to( { x: [ w, w, 0, 0 ], y: [ 0, h, h, 0 ] }, 4000, Phaser.Easing.Linear.None, true, -1, false);? well it works with this particular example, thanks. (then im having trouble with something else, i havent figured out yet, which is giving me the expression of accelerating)
  20. Hey, im observing that youre having a slight acceleration with linear-easing tweening at the beginning and end of the movement: http://phaser.io/examples/v2/tweens/interpolation is there a way to get rid of it?
  21. yes, but that wasnt what i asked
  22. thanks, but still having the same issue. i want to scale out, not to scale in. a workaround could be that i initially make the tiles half the size, but dont know how to accomplish that
  23. Okay this issue was related to the way ive implemented my tilemap. now im having troubles with zooming out the map. well zooming works, but im getting a padding at the right and at the bottom - see for yourselves