plicatibu Posted May 8, 2016 Share Posted May 8, 2016 Can you guys that read book "Interphase 1" help me understanding how one can determine that emitter will generate particles in V format (in really a symbol like an "<") that give us the impression of waves behind the boat. I read and re-read that part of code but I failed to figure it out. Thank you all. Note: I don't publish the source code of the game so anyone could answer because I don't think I am allowed to. Link to comment Share on other sites More sharing options...
rich Posted May 8, 2016 Share Posted May 8, 2016 The cause of the < shape is because of these 3 lines: this.emitter.gravity = 0; this.emitter.setXSpeed(-100, -250); this.emitter.setYSpeed(-100, 100); Gravity 0 stops the particles from falling. X speed is basically "move left (because the values are negative) at a random speed between 100 and 250". If you remove the minus signs they'll move to the right instead. Y speed is similar - basically "have a Y velocity between -100 (up) and 100 (down)". The limit on those values, combined with the X speed, is what causes it to emit in a fan shape. Try changing the Y values from +-100 to +-50 and notice the effect - a much narrower fan. Or try +-200 for a wider one. Or try -100, -50, and they'll only move up. plicatibu 1 Link to comment Share on other sites More sharing options...
plicatibu Posted May 11, 2016 Author Share Posted May 11, 2016 Thank you. It's clear now. I like book Interphase 1. It is very instructive with good explanation. By the way, when will you release book Interphase 2? Regards. Link to comment Share on other sites More sharing options...
rich Posted May 11, 2016 Share Posted May 11, 2016 Soon, I promise. I've been literally snowed under with other tasks, and it took a bit of a back seat. But I've been cranking out the chapters again recently, so am happy with how it's shaping up. Subscribe to the Phaser World newsletter (if you don't already) as I'll announce updates in there. Link to comment Share on other sites More sharing options...
Recommended Posts