Jump to content


  • Content Count

  • Joined

  • Last visited

About Zaidar

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

1416 profile views
  • Tef

  1. Hi, I finally decided to give a try to P2 after using Arcade a lot. So I started my project with Phaser 2.0.7, and was trying to build a really simple test with just 1 box falling on top of another one. But it appears in all the examples that without configuration the world should automatically have bounds, which is not the case in the 2.0.7 build. However, when I passed to 2.0.6, just by changing the phaser version, with the same code, the world has bounds. my code : //create functiongame.stage.backgroundColor = '#00ffff';game.physics.startSystem(Phaser.Physics.P2JS);this.ball1 = game.a
  2. Zaidar

    Draw an Arc

    create: function(){ this.circle = this.add.bitmapData(resolutionGame[0], resolutionGame[1]); this.circleSprite = this.add.sprite(0, 0, this.circle); }, update: function(){ this.circle.ctx.beginPath(); this.circle.ctx.arc(x, y, radius, angleStart, angle); this.circle.ctx.strokeStyle = '#000000'; this.circle.ctx.stroke(); this.circle.ctx.closePath(); },Something like this should work. I haven't done game dev for few of weeks, so can't remember
  3. I bought the whole thing 100€, but I think it's more interesting for really beginners. If you've already been developing 2 or 3 games with Phaser, I don't think you'll actually learn a lot. I really appreciate the idea of the book, it's just me who had put too much expectation on it. If you're a beginner in phaser I recommend it though. Thx to the author for the time and even if it's not what I was looking for I think you did well (better than I would do, so good job)
  4. You need to put a background, otherwise Cocoonjs just try to fill with the sprite.
  5. PhoneGap isn't great for performance for canvas games. I think it uses the webView from Android, which has quite bad performance. You said you tried Cocoonjs, but did you try on WebView or Canvas+ because Canvas+ is way faster with games using canvas?
  6. Well, since it works and the plugin is part of the game.plugins array, I think that's the good solution.I have an example working for you. Let me put this online. Here is the game, the only part I use the Juicy plugin is for the screenShake effect (I know, but it was just for testing at first, so I just left it here) http://jeandaviddaviet.fr/games/Bombomb/ This is the source on Github : https://github.com/JeanDavidDaviet/Bomb-omb/blob/master/script.js Basically if you look at line 57, I'm adding the plugin into the Phaser pluginManager. And lines 157 and 169 I use the shake() func
  7. Yeah, I wasn't sure so I retested, but I confirm it doesn't work if you just do this.juicy = new Phaser.Plugin.Juicy(this);
  8. I don't really understand the problem, but the site is planned to be redesigned soon, so...
  9. I have no idea if it can help you or not, but I know gamedevtuts made a tuto about water couple in January. It's in Unity, but I hope you maybe take some of the concepts here. No idea. I just know that recreating water behavior can be really intense in ressource if you want some level of reality. But the solution brought in the tutorial seems interesting, even if I didn't give it more than a look to the final result, it seemed quite good. TL;DR : Here is the link http://gamedevelopment.tutsplus.com/tutorials/creating-dynamic-2d-water-effects-in-unity--gamedev-14143 If you have any new
  10. After 20 squares that's normal that you get an error because you use the creatMultiple() function which create a limited number of square. Phaser only create 20 squares, and you're using only these. I recommand you to just create this square one by one. It won't kill the perfs as you're destroying them when they get out of the world. function create() { squares = game.add.group();// NO MORE CREATEMULTIPLE WE CREATE IN THE ADD_ONE_SQUARE FUNCTION ball = game.add.sprite(365, 470, 'ball'); game.physics.arcade.enable(ball, Phaser.Physics.ARCADE); timer = this.game.time.events.loop
  11. Hi, I hesitated to create the same post couple of days ago. I was also sad that there isn't so much doc about plugins in Phaser. I was trying to use the Juicy plugin from the Phaser plugin repository. (https://github.com/photonstorm/phaser-plugins/tree/master/Juicy) So i did like this : var GameState = { create: function(){ // rest of the code this.juicy = this.game.plugins.add(new Phaser.Plugin.Juicy(this)); }, gameOver: function(bomb){ // when I need to call my plugin this.juicy.shake(); }}; PS: Pro tip : Don't forget to add the plugin script <script src="
  12. I already had this issue. The way I do is I just multiply the physics calculation by the same scale factor. I know it's not the best way, but the only one I could think about. I have a scaleFactor variable, which depends on differents variables from the device, and just call multiply this variable when needed. I don't think it make too much loss of performance.
  13. I hope it's going to explain more in detail how to use the physics system, because for now I think it's still quite blurry in my head. Like : When should I declare game.physics.startSystem() ? I've used body and velocity without need for it. When should I declare a enableBody = true and physicsBodyType = Phaser.Physics.ARCADE, cause sometimes, it's working, sometimes, it's useless. Maybe it's just me but I found / still find this part of Phaser quite "difficult" to grasp in his whole. Thx anyway for the book.
  14. Hi, I think I got your problem, you need to enable the physics arcade system in order to use the velocity. Also, Game.physics.moveToObject, doesn't work, you need to explicitely say game.physics.arcade.moveToObject() Here is the code I have working : function create() { squares = game.add.group(); squares.createMultiple(20, 'square'); ball = game.add.sprite(365, 470, 'ball'); // ADDED PHYSICS HERE TO THE SPRITE game.physics.arcade.enable(ball, Phaser.Physics.ARCADE); timer = this.game.time.events.loop(500, add_squares); side = "right"; game.stage.backgroundColor
  • Create New...