Jump to content

CrabBoy

Members
  • Content Count

    6
  • Joined

  • Last visited

About CrabBoy

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for your insight! Your comment made me add some log to my Spawn function with Sprite.revive() and it indeed looks like that the item is revived right after it is killed. There is some problem with my item spawning logic, I need to debug more. Thanks!
  2. Hi! character in my game is this cat: The cat is class extending group and contains torso and head, both are sprites with arcade physics enable on it. In the game, the cat is pushed up by applying velocity on it and it collects certain items (gameplay is similar to Flip the Gun game, check it out for better understanding). THE PROBLEM: In update method, I am constantly checking for collisionse between cat and the items: this.game.physics.arcade.overlap(this._cat, this._sceneObjectsLayer, this.onObjectCollision, null, this); My onObjectCollision method looks li
  3. If I call this this from update method, that basically means I want to rotate my head by the current angle of the torso. You call this 60times within a second and the only thing you see is the head rotating around the body as crazy. Better approach would be getting angle difference since last update call and rotate the head by this difference. Anyway I tried this approach and it did not work for some reasons... In the end I was able to achieve the behaviour I wanted by calling my code above (the one with sin and cos) from the postUpdate method instead of update. The problem was that physi
  4. Thanks for the hint, but I don´t think this is the right way to do it, or at least I don´t know how to use it properly - can you provide some code snippet if you still think this is the right way to go? In the meantime, I discovered this article and I implemented it as follows: //in the constructor: this._catHeadDist = this.game.physics.arcade.distanceBetween(this._catHead, this._torso, false, false); //in the update method: this._catHead.x = Math.cos((this._torso.angle) * Math.PI / 180) * this._catHeadDist + this._torso.x; this._catHead.y = Math.sin((this._torso.angle) * Math.PI /
  5. Hi guys! Main character in my game is this cat: Cat is composed from two parts - the torso and the head - and for each part I want to have physics body enabled, therefore I decided all parts will be inside a group. During the gameplay, I apply certain amount of velocity to the cat torso and cat then should rotate around its own axis, clock-wise and counter clockwise. I chose the approach to apply velocity to the torso and I want to position the head according the torso in the update method. Basically I want to achieve the same behaviour as Sprite.addChild() (add head as a
  6. Hi guys, I´m working on simple Connect-the-dots game (there are dots on the screen and you have to join them with mouse in order to get some image) and I´m trying to implement pencil, which will draw on canvas. I also need functionality where all what I´ve previously drawn will change the color when the image is complete, that means I need to preserve created data somehow. I´ve already tried multiple solutions I found here and around the internet, but nothing seems to work as I need. I´ve tried this: 1) Drawing with bitmapdata Basically this solution: http://phaser.io/examples/v
×
×
  • Create New...