• Content Count

  • Joined

  • Last visited

  • Days Won


Noid last won the day on May 6 2014

Noid had the most liked content!

About Noid

  • Rank
    Advanced Member
  • Birthday 09/23/1985

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1371 profile views
  1. @John Ng for any function that processes some data and where you can check whether it's returning what it should you can use your favorite test framework. However, if you plan to use TDD for the whole game, I'm not sure it's feasible. You cannot run your game for say 10 seconds, capture a screenshot and expect it to be always the same.
  2. Create if for what you need to get ready for the update loop. There is no need to create all the sprites you are ever gonna need there. You can use the update loop just fine.
  3. Maybe debug.text should output some warning to the console since it severely affects performance and people new to phaser have no way of knowing
  4. It'd be better if you explained what you're trying to accomplish with the code so we can help you. The obj1 at the end is undefined and even if it were, you would end up adding an obj1 property to it that contains { enterMonsterMenu: function() { return console.log('enterMonsterMenu'); } } . It seems that you wanted to call a function instead.
  5. The problem seems to be that the empty space is being trimmed but the engine is not loading the metadata properly. This is part of my atlas.json file {"filename":"Pichon_Vuela00.png", "frame": {"x":865, "y":391, "w":58, "h":58}, "spriteSourceSize": {"x":8,"y":1,"w":77,"h":66}, "sourceSize": {"w":77,"h":66} }, {"filename":"Pichon_Vuela01.png", "frame": {"x":550, "y":411, "w":65, "h":57}, "spriteSourceSize": {"x":5,"y":1,"w":77,"h":66}, "sourceSize": {"w":77,"h":66} }, {"filename":"Pichon_Vuela02.png", "frame": {"x":616, "y":411, "w":64, "h":56}, "spriteSourceSize": {"x":6,"y":0,"w":77,"h":66}, "sourceSize": {"w":77,"h":66} }, If I console.log sprite.width while the animation is running I get the following values: 58, 65, 64. Those are the widths on the atlas image, were the sprites are tightly packed ignoring transparent pixels. However, when extracted from the atlas they should all be 77x66 as defined in sourceSize and spriteSourceSize. Maybe the atlas format changed and my .json file is no longer up to spec, but I can't find the specs anywhere on the repo. UPDATE: I couldn't find the specs but I could find some examples on the examples repo and it seems my json is no longer up to spec. It now needs a "trimmed" : true property in each frame that has been trimmed. Sorry, must've missed the update where that was added. Thanks for all the help, Tom! I think everything's working fine now.
  6. So, for anyone using sprite.anchor.setTo(0.5,0.5) and a body of width A and height B and who was using sprite.body.setSize(A,B,0,0) to get the body centered, they now have to do sprite.body.setSize(A,B,0.5*(sprite.width-A),0.5*(sprite.height-B)). That is, offset to half the width of the sprite minus half the width of the body and half the height of the sprite minus half the height of the body. That works fine now, even with negative values for scale. However, something else must have broken now, cause when I set the anchor to anything other than 0,0 it's starts vibrating. If I set the anchor to 1,1 the vibration is really noticeable and I can notice the character bumping against the wall. I'm adding a gif to demonstrate. I'm using debug.body with sprite.renderable = false so it's easier to see. Notice the erratic movement in the first half of the video(anchor set to 0.5, 0.5) and the smooth movement in the second half(anchor set to 0,0). Setting it to higher values makes the movement even more erratic, even if they're integers. Setting it hi negative values produces the same result. I started noticing this with 2.4.8 but I'm not sure if it's related to fixing #2470 or not so I'm gonna do some bisecting to find out where it started happening. Update: I can confirm the wobbling was introduced in commit f9994fac75c8ed4bf0b84751a1058de1b35e86f4 which is related to fixing #2470
  7. Any migration guide for how the new body anchoring works? I have a prite with anchor set to 0.5,0.5 and size set to (20,30,0,0) With 2.4.7 I could just do sprite.scale.x *= 1 to flip the sprite, now it displaces the body a lot. I'm not really sure how to fix it.
  8. Try the older docs. Get the phaser repo from github and run <repofolder>/docs/index.html
  9. Since you say you're lerning JS, I want to let you know that nothing will have perfect autocomplete for javascript due to the way the language works. Since it's a weakly typed language sometimes there's no way to know what's inside an object until runtime(and that may even change serveral times during execution). Some editors include ternjs which tries to get as much autocomplete info as possible but I'm using sublime 3 with no autocomplete plugin and open on a browser tab and I've managed just fine.
  10. I published a game just like the one your're making ( last year so I can tell you how I ended up solving the same problems. All I say implies I'm using arcade physics though in retrospect maybe I should've used P2. You should test both now to see which one you find more suitable before it's too late. Regarding bounce, I have a variable that holds the jump speed and apply that whenever body.onFloor() is true. Using onFloor you avoid having it bounce when it touches the sides or bottom of a tile. Regarding pass through blocks, I didn't use any of those but collide() allows you to define a callback so you can do additional checks before returning true or false. you can check that the player is falling and colliding with the top of the pass-through tile or return false otherwise. When you collide a tilemap with a sprite you can also decide what to do besides separation in a collision callback. The callback will provide a reference to the sprite and the tile that are colliding, so you can check the tile index and decide what to to in each case. Is is a spring? Let's make the player jump higher and faster. Is it a spike? Let's kill the player. Is it the exit door? Let's exit the level. You can have collision callbacks assigned to a tileindex with setTileIndexCallback() but if every tile in the map is gonna have a callback then I think it's better to just add a callback to collide() and check the tile index yourself
  11. EXACT_FIT will stretch/squash the image if you scale to a different aspect ratio. You could also implement your own "fit best" scaling function that scales the image uniformly until it fits the width or height of the screen(whichever generates less cropping).
  12. Noid


    There was an early alpha with placeholder art I uploaded to Newgrounds to get feeback.
  13. Noid


    Pichón is a puzzle platformer where you play as a chubby bird that's constantly bouncing. Fast reflex and good timing will allow you to sort obstacles, activate secret passages and collect the necessary gems to be able to open the door at the end of each level. This is my first Phaser Game and it's available right now on Google Play. Trailer: Store URL: Press Kit:
  14. Cool! I've played some of the early versions of AO. Unfortunately I think Phaser doesn't support animated tiles. You can probably use an instance of Phaser.BitmapData as a tileset image and then use BitmapData.copyRect() to paste the required frames at regular intervals. I don't know how fast it'd be but it'd probably be faster than using Phaser.Tilemap.replace(). Since this might be useful for my game too, I'll try to make it work and post the code as soon as possible.
  15. The emulator in IntelXDK doesn't play mp3s. If it doesn't properly inform what is capable of playing, phaser will just pick the first option. This happens with Opera to. Just put the ogg files first in the array. Going from 44100 to 8000 will noticeable degrade sound quality.