Kiwiboy

Members
  • Content Count

    9
  • Joined

  • Last visited

About Kiwiboy

  • Rank
    Newbie

Contact Methods

  • Twitter
    @jagekiwi
  1. Anyone got any insight on cocoonjs dispose feature and how to use it? I think knowing how that works is what I need. Otherwise I might have to go with just removeImage and trust that the gc removes the stuff if it's almost getting clogged.
  2. Thanks for the replies! I don't load all assets every state change unfortunately, and I don't really want to. And yes, cache.removeImage(key) does release the memory, just not right away, but when the garbage collector wants to. Cocoon controls that so I should find a way to force the gc to do it's thing. Just not sure how. And I use canvas+.
  3. I hate bumping, but I'll still do it
  4. Hi peeps, posted this in the Common Phaser & CocoonJS issues topic as well, but no answer as of yet. This is what's keeping me from finishing the game pretty much so felt like I had to make it it's own topic as well. I've been having some struggles with memory as of late. At first I loaded everything in preload.js which worked fine in my other smaller games, and I use shutdown() for the first time and clear every object when leaving a state which certainly makes the game smoother. But then when making my third world for the game I recieved memory warnings. So I decided to load the necessary parts of each world in their preload-functions, now the problem I'm having is removing them when entering a new one. Say when I'm done with world 1 and enter world 2, I want to clear the loaded assets only used in world 1. I've tried cache.removeImage(key), which alone did not quite work as I'd like, since it doesn't quite clear it right away. Then I've read about cocoons feature .dispose() which I then tried like this: cache.getImage(key).dispose() cache.removeImage(key) I've tried in some other orders too, and a little with PIXI(but since that's part of removeImage I didn't look that much into it), but long story short(er); what's the best way to clear assets from memory, using cocoon and phaser, since I want to load them every time I enter each world. I don't want to do it in an incomplete way like I did with removing objects from states before. Cheers!
  5. Hi guys! I've been having some struggles with memory as of late. At first I loaded everything in preload.js which worked fine in my other smaller games, and I use shutdown() for the first time and clear every object when leaving a state which certainly makes the game smoother. But then when making my third world for the game I recieved memory warnings. So I decided to load the necessary parts of each world in their preload-functions, now the problem I'm having is removing them when entering a new one. Say when I'm done with world 1 and enter world 2, I want to clear the loaded assets only used in world 1. I've tried cache.removeImage(key), which alone did not quite work as I'd like, since it doesn't quite clear it right away. Then I've read about cocoons feature .dispose() which I then tried like this: cache.getImage(key).dispose() cache.removeImage(key) I've tried in some other orders too, and a little with PIXI(but since that's part of removeImage I didn't look that much into it), but long story short(er); what's the best way to clear assets from memory, using cocoon and phaser, since I want to load them every time I enter each world. I don't want to do it in an incomplete way like I did with removing objects from states before.
  6. Hi, so I'm working on a game and I'm wondering if there's an easy way to code the following. I have an animal sprite, with body, collision, gravity, animations etc all implemented and working like I want. But now I want to add a tail sprite to the animal. animal.addChild(tail) works like I want only it puts the tail in front and I can't seem to change that. So I'm wondering if there's a simple way like to do the same thing only put it behind the first sprite. I know you can do stuff with groups, maybe I have to here, but then I have to change how everything interacts with the animal don't I? P.S. it's a cat. Cheers
  7. Hi, I've finally released my first mobile game, Cosmo Starglider! Have you ever wanted to shoot robots in space with a laser-gun? Yeah, me too, but wake up that's not happening bub. Something you can do though is try my new game for free! It's in space so that's similar at least. You are Cosmo, alone in space, gliding among the stars with your jetpack. But an horrific amount of mysterious asteroids are in your way. How long can you survive? How far will you get? Right now you can only try to beat yourself and your closest friends, but get your practice going, because in a week you will be able to compare yourself with the rest of the world! Here's the link if you want to check it out (please do!): http://onelink.to/wh9anz/ (Newer mobiles recommended, inexperienced programming on my part can cause lag) Feedback wildly appreciated! You can do that by rating or on the links below! And for more info on our games and updates, find us here: https://www.facebook.com/PiggybackGames And on my twitter: @jagekiwi Go indiedevs, cheers!
  8. Ehm accidentally sent an unfinished post, used to the code hotkeys now ^^ I'll summarize this time. So the problem is; sometimes the order of the colliding objects are wrong. update: function() { //this.player is a group with two sprites //this.effects is a list, it consists of a particle emitter and just a sprite this.physics.arcade.overlap(this.player, this.effects, this.Death, null, this);},Death: function(p, effect) { console.log(p, effect);}When it's the emitter it logs the player sprite first, then the emitted sprite. When it's the sprite effect, for some reason it logs that first and the player sprite becomes the effect parameter. So... it feels you probably need more to help me but if you have any idea that would be great! Cheers!