Search the Community
Showing results for tags 'phaser.arcade'.
-
Hi all! I just read a ton of posts/google finds but still no answer to me. My problem is this: I have an image, with arcade physics on it. On my update I'm checking overlap, since I'm dragging the image. If it touches the right obstacle, it should disappear, if it's the wrong one, it should go back to the previous place (origin). Everything works fine except the "disappearing act": - If I use: this.image.visible = false;// reposition imagethis.image.x = this.image.originX;this.image.y = this.image.originY;I keep hearing the sound fx of the correct answer, until I press the next button (by the way, I know I can delay the sound or use some kind of trigger to avoid it playing over and over, I just would want it to allow the image to re-position itself) but the next button sometimes but fails to address the following line of code: this.image.visible = true;And that makes it jump over one image from a set of images (when I press next I also increment by one the a value that I use to loop through an array). This behavior happens a lot of times... more than 6 in a set of 20! If I use kill, everything works fine: - image will disappear; - sound will play only once; - next image will appear where it is supposed to appear; HOWEVER... the image now generated doesn't overlap. If I run the render function / debug, I can see that the green collision square is still in the same place where it successfully collided the 1st time. I tried reset(ting), re-enabling, re-creating... best I could achieve was the green collision square going to the right place but not following the drag... :S Destroy is imilar or worse even, in my case... Any hints, tips, ideas? Thanks for your time! Cheers!
- 7 replies
-
- phaser.arcade
- physics
-
(and 1 more)
Tagged with: