• Content Count

  • Joined

  • Last visited

About Qqwy

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Interests
    Music, Games, Originality, Nice&Happy people.
  1. In your code, you specify the tilemap as using 16x16 tiles, but you're actually using 20x20 tiles. This makes the code cut your tilemap up the wrong way, resulting in distorted tiles. Also, I'm not sure if the tilemap uses (0) as the first tile, or automatically as an empty tile. If above code is not enough to fix it, try to add another 20x20 tile that is transparent to the left of the blue tile.
  2. I don't know if there is a better way, but what I usually do is to have a predefined speed, then look at the angle of the object, and apply something like: object.velocity.x += speed * Math.sin(object.angle); object.velocity.y += speed * Math.cos(object.angle); There also seems to be (at least in Arcade physics) a body.velocityFromAngle() method, which seems to more or less do something similar. and might be what you need.
  3. In my game, I want to have a simple screen size rectangular area filled with a gradient(the start and stop color change per room) as a background. In the canvas renderer, this is quite straightforward by using canvasContext.createLinearGradient However, there are ways to do this in WebGL as well. I know how to write a shader for it, but not how to implement such a shader. Also, as this is not text and just a simple rectangle, maybe there already exists some kind of function for it in Phaser? Any help would be appreciated. ~Qqwy
  4. Thanks a lot for your reply! When I browsed the documentation and looked more into Ninja, I started drooling once I saw the Phaser.Physics.Ninja.Tile class... awesome =3. Now only to find out how amend to the code in Phaser.Physics.Ninja.AABB.js I can make 4x1 (and 1x4) tile slopes as well. Thanks
  5. Hello there, I'm teaching myself Phaser while working on a small platformer. What I'm wondering about: Say I use a tileset such as this one: Simple AABB collision using Arcade on the tile map is shown in this example: http://examples.phaser.io/_site/view_full.html?d=tilemaps&f=map+collide.js&t=map%20collide However, as in this tile map there are many slanted/sloped tiles. This is where using just Arcade falls apart. What is the proper way to let the player collide with these slanted tiles in Phaser? I'm not scared to get my hands dirty with writing some custom code, but if there's a way to do it already, I'd like to know. Thank you, Qqwy
  6. Calling a function through the prototype is the same as calling any normal(e.g. not bound to an object) function. In other words, your assumption is correct: -In the button.onmousedown handler, the 'this' object refers to the button. -When the Board.prototype.nextColor() is called inside there, the 'this' object still refers to the button. Passing values to handlers is one of the things that JavaScript is not very good at (and one of the things they try to fix in ECMAScript 6). The solution suggested by many developers is to create a second reference to the Board object, e.g: var thisBoard = this;button.mousedown = button.touchstart = function(data) { thisBoard.nextColor(this.color);};I hope this helps. ~Qqwy
  7. I am trying to create a simple game using PIXI.js for mobile devices. While testing it on my HTC Desire 500 Android (4.1.2) phone, I found out that at maximum, only 2 multitouch-points are registered at one time. This happens both for touchstart/touchend and for the tap function. (tapping two objects at the same time works, but three or more does not). As my game depends on people being able to tap many objects in quick succession, I would like to know what the issue is here: Is this a problem that PIXI has? Or is it something that happens in the browser? Or is it only my specific phone model that has this problem? Thank you, ~Qqwy
  8. Great article! Thanks for sharing. Good to know how much the different browsers and devices can take.
  9. Since most of the time, you dont need to track collisions between ALL objects (depending on your game, collision between two different enemies might be unimportant, for example), it is the easiest to put all objects of one kind in one array. Then simply check for each of these objects if they collide with another object (for instance the player, or each of the objects in a second array). By using multiple lists the impact on the performance can be kept low. If you check collision between ALL objects every time, the execution time will effectively DOUBLE for each new object you add to the game.
  10. Qqwy

    Ground like FF

    Most games, especially RPG games like Final Fantasy, include a camera system that follows the player, which basically means: When the player moves, you move all objects except the player in the opposite direction and keep the player in the middle of the screen. At some point you will then be able to see an object placed outside of the screen.
  11. Qqwy

    Pixi text

    Of course, a font is only useful as a bitmap font if you use it in one or two fixed sizes, and if the font does not have too many glyphs (i.e. unicode). For other cases, there are multiple great online tools that generate font files for the different browsers and a nice piece of CSS code you can put in your site to load them. I've had good experiences with FontSquirrel myself.
  12. I went through the source of PIXI, and to my understanding the JSON code gets passed as a property of the this object that is sent to the callback. You should be able to access it using this.json . At least that's what I think right now. But it might also an illusion coming from sleep-deprivation.
  13. I think this is a great opportunity for a recursive function: function update(object, key, value){ var nestedarr = String.split(key, "."); nestedUpdate(object, nestedarr, value);}function nestedUpdate(object, nestedarr, value){ if(nestedarr.length > 1){ nestedUpdate(object[nestedarr[0]], nestedarr.shift()) //Pop first element off array }else{ object[nestedarr[0]] = value; }}Note that this specific example is untested, the naming is horrible and might have bugs, but you get the general idea.
  14. I have started to use Howler for sounds in my game. However, Chrome does not like to look up sounds on the computer, saying that 'XMLHTTPrequests are only supported for the http protocol'. Thus I started to upload my code to an FTP server each time I made a change. Of course this is quite inefficient because of all the waiting time and the easy confusion between files(local copy vs. remote copy) so I was wondering: How do you cope with this problem?
  15. Very nice article. Really opened my eyes as to how much integration can and should be possible by fully utilizing HTML5.