• Content Count

  • Joined

  • Last visited

Everything posted by Edricus

  1. So I've been looking into the new updates to Phaser CE (2.7.0+) and what has caught my eye the most is the updates to the way Phaser handles textures. It now seems to have the ability to handle texture compression formats for WebGL which is exciting! Previous to this, all the games I had worked in were just loading PNG RGBA data into the graphics card and having come from other engines that support texture compression for GPU RAM optimizations, it was definitely a feature I missed. I've branched on an old project I had in order to test this new compression system but I'm not sure how it would work with atlases. I was already using Texture Packer before to generate Texture Atlases for the game but they were just PNG atlases. I came across this Advanced Rendering Tutorial where it explains how to set up your Texture Packer project. I've gone ahead and done that but the examples only show the ability to load an image with those compression settings. Here is a doc reference to the load image function. Currently, I am using this.game.load.atlasJSONHash('key', 'texturePNGURL', 'jsonURL'); It seems the new update only supports the following two calls this.game.load.image('factory', { etc1: 'assets/factory_etc1.pkm', s3tc: 'assets/factory_dxt1.pvr', pvrtc: 'assets/factory_pvrtc.pvr', truecolor: 'assets/factory.png' }); this.game.load.texture('factory', { etc1: 'assets/factory_etc1.pkm', s3tc: 'assets/factory_dxt1.pvr', pvrtc: 'assets/factory_pvrtc.pvr', truecolor: 'assets/factory.png' }); How would I go about loading my atlases with the accompanying JSON information using the new compression system?
  2. Hmm, so you want one object to pass through another object? I'm not quite sure what your initial question means. Could you try rephrasing or further explaining? Perhaps a hypothetical example would help.
  3. If your talking about one object being able to push another then set their immovable member to true. This will make it so whatever physics body hits that immovable object, the immovable object won't move.
  4. // Audiothis.game.load.audio('bgMusic' , 'assets/audio/DST-Blam.mp3');this.game.load.audio('splashSFX' , 'assets/audio/Kayyy-Wave.mp3');this.game.load.audio('sparkleSFX' , 'assets/audio/Sparkle-Robinhood76.mp3');this.game.load.audio('gameOverSFX', 'assets/audio/Benboncan-SadTrombone.mp3');So this is the code in my preload to load audio. When running it in CocoonJS Launcher app on Android I get the following warnings in this order: Phaser.Loader error loading file: gameOverSFX from url null Phaser.Loader error loading file: sparkleSFX from url null Phaser.Loader error loading file: splashSFX from url null Phaser.Loader error loading file: bgMusic from url null Running the game through a localhost loads the audio perfectly fine which is what I find odd. Anyone have any idea?
  5. Does your world happen to have a gravity set on it?
  6. So as the screenshot above displays I have a character that surfs along a set of teeth. Every time a tooth is touched it plays a cleaning animation. The goal of the game is to dodge the incoming germs and clean as many teeth as possible before becoming victim to the germs. On desktop the games runs smoothly. Over the past few weeks I posted a few topics here to try and get some help with performance and such. I figured instead of writing a new topic I would post in here again. On mobile I noticed a jitteriness before. At first I saw no frame drop but upon close inspection frames do drop when the jitteriness happens. I have done quite a bit of performance handling from suggestions on these forums and the jitteriness has gone down quite a bit however it's still there. It's there mostly towards the beginning of the game for about 30 seconds or so. Frames will spike between 50 and 60 FPS causing a noticeable jitter. However after about 30 seconds the frames stabilize a bit and hang mostly between 55 and 60 FPS. The jitter is less often but still happens. Another thing I noticed is that if I hover in the middle and don't touch any teeth there is no FPS drop at all. Thus why I am back in this thread. Lwester32, I know you mentioned rendering is heavy part of Phaser and that it most likely wasn't the physics. I made the changes above that you suggested and took out the unnecessary for loops. After atlasing my assets and compressing I am still lost as to what I could do to help get rid of this.
  7. Woops. Totally misread that while watching the video! Haha, I feel a bit stupid now. Thanks for pointing that out.
  8. I heard editors like Tiled support multiple layers for tilemaps. From your video it looks like you do to. However what I also heard is that Phaser does not support multiple layers for tile maps. Would you happen to know if this is true?
  9. Well derp. Turns out I was using the right member: frameName, but I was typing the wrong name... I had a capital letter in it and the atlas key didn't have one. >_> It's too early in the morning here
  10. How would I go about accomplishing this for a button though? This is the code I currently have button = this.game.add.sprite(0, 0, 'buttonPack');It currently loads the first texture in the texture pack so this gives me the indication that the texture pack is loading correctly. I've tried setting the key member of the button through button.key as well as the frame or frameName but none of them seem to work properly. They all just load the first texture in the atlas.
  11. I also just stumbled across this function in the Phaser Docs. http://docs.phaser.io/Phaser.Animation.html#generateFrameNames Would I just place this into the create function of my prefab and omit passing in a frame with this?
  12. So I'm used the web version of the Leshy Spritesheet Tool and got a packaged version of my assets. Currently my code for grabbing the correct image is like so var Germ = function(game, x, y, germType, frame) { Phaser.Sprite.call(this, game, x, y, germType, frame);From what I understand, in order to make this compatible with a my new packaged textures png I need to replace germType with the name of the loaded png pack and frame with the name of the asset in the pack that I want to grab? Also, in order for this method to work with sprite sheets, is it safe to assume that the sprite sheet must be split up individually and then placed in? If so, how would I go about getting an animation playing from a texture pack? All this is very new to me and I thank everyone for their help. This looks awesome and I really want to learn how to use it properly. I tried looking at the Phaser examples but they aren't the most informative for something like this.
  13. Another thing I found interesting about this was that I could run the same PNG through the site for further compression to reduce it even more. Of course the more you reduce it the less compression it does on every cycle through. Eventually you start to notice a difference in the aliasing of the object (assuming you're running vector objects through the compressor).
  14. First, I would just like to say that I ran all of our assets through TinyPNG and my god did it ever work wonders. We had assets totalling to 14.5MB and TinyPNG dropped that to a mere 4.77MB with (at least to my eye) absolutely no noticeable difference in quality! This website is awesome to say the least! Thanks a lot for showing me this. I will definitely be telling my friends about it. I'm going to try some sort of TexturePacker if I have time to hopefully help a bit more with mobile performance.
  15. Alright. So I've re-sized all my assets for different resolutions but I was wondering if there is a "right way" of packaging everything together to make for fast loading (not that it's currently slow) but also efficiency. I have heard of people doing things like making Texture Atlases for all their sprites and assets but I was wondering roughly how long it takes to learn something like that and implement it? Does a lot of the code change for the way things are loaded? Unfortunately there is only one day left on this project so I don't want to take on a task that's too large. Any help is greatly appreciated! Edit: I am using CocoonJS to package everything up and run on Android.
  16. What's interesting about the lag is that when I'm running it in Cocoon there is absolutely NO FPS drop being recorded in the top left corner. It's consistently playing at 60 - 61 FPS. However while playing the game there is a slight jitteriness to it. I will try turning off some of the assets and proceed from there. Thanks for the tips thus far.
  17. Thanks, looking back I don't even know why I was looping through individual elements in a group. Thanks for pointing that out, I went ahead and changed all the collision to follow that. However the same type of lag is still present. You mentioned the most intensive part of Phaser is the rendering aspect. What can I do to look into what could be bogging it down? Should I lower the asset quality?
  18. Hey guys. A thought just came into my head. How would you go about pulling off an Isometric Perspective in Phaser? I tried looking up some examples but many of them are using older versions of Phasers. I was wondering if anyone has a demo or example of a more recent game made in Iso using Phaser. Also some general information about how to achieve Isometric Perspective in Phaser would be greatly appreciated.
  19. So I'm working on a game that is just about complete and I'm using CocoonJS to wrap it up for Android. I noticed that when putting it on a Samsung Galaxy S4 that it does lag a bit. It's not too troublesome but I would like to remove this lag if at all possible. I have a strong feeling that it's coming from my physics calls because of the way my game is set up, so hopefully I can get some tips on how to better set things up. Currently my game has a character the rides along a set of teeth. As the character touches each tooth it becomes clean thus playing an animation. This continues indefinitely as per design of the game. Currently in the main update function there is this piece of code for handling the collision. for (var i = 0, length = this.teethGroup.length; i < length; i++) { this.game.physics.arcade.collide(this.bactoSurfer, this.teethGroup.getAt(i), this.cleanToothHandler, null, this);}The callback function simply plays an animation and updates the score. The tooth's body property is set to immovable and velocity to -350. However in order to stop the player from being pushed back I had to set it's velocity to 350. Is there a better way to handle this kind of collision? Also is there a way to have the player's character just sit on the moving teeth and still have the collision callback function go off without having to counter the teeth's velocity? My final question is what sort of performance issues should I look for in the physics portion of the game? Thanks in advance.
  20. Thanks Lewster! I actually already went a head and did that with one of the other effects that I have. I figured this was one way, just wanted to see if there was any other ways as well.
  21. Edricus

    Spine support

    I'll definitely take a look at DragonBones. Come to think of it, a friend of mine just showed me that a few days ago. Although it may be to early to ask, what's the timeline looking like for DragonBones support if you don't mind me asking?
  22. Edricus

    Spine support

    I too would love to know the current status of this. I was hoping to incorporate Spine into my next project. Also if someone has another bone based animation tool that works with Phaser that would great as well!
  23. So I have a quick question about full screen power up effects. Currently, I have a full screen effect of splashing water when a player picks up a power up. However the sprite sheet for this power up has the potential to be massive depending on the device screen size. With just a couple frames in the splash animation, we're already talking about exceeding 4096 in the width which CocoonJS is not particularly happy about when attempting to put this on mobile. Also, when a player initially picks up the power up for the first time there is a hard lag that stops the game in its tracks for about a second or two before playing the animation. From then on, picking up the power up causes no similar blips at all. What's a good way of handling full screen power up effects or power up effects that either take the full game width/height?
  24. Edricus

    Sprite Gap

    So... Thanks for all the replies but... it turns out it was something ridiculously simple... as usual. Original code var Tooth = function(game, x, y, frame, rotation) { Phaser.Sprite.call(this, game, x, y, 'tooth', frame);... this.xRespawnPos = this.game.width + this.width * 0.5;...};Updated and fixed code Tooth.prototype.resetTooth = function(){ this.x += this.xRespawnPos;...};The difference is the plus equals. Previously I was just hard setting the X but because the update N times per second then there was also probably a frame where it would just move a pixel. That just added up over time and made the gaps bigger and bigger.