This has been a huge help in the mouse events for coding Duck Hunt! Thank you so much!
@divine_beam2 жыл бұрын
which IDE are you using, do you have a video for setup to get all the nice autocomplete that you have?
@WClarkson2 жыл бұрын
I was using Sublime in this video, but I have now switched to Visual Studio Code. There are extensions that will help with auto-complete. I've also started using typeScript which has an amazing auto-complete feature.
@divine_beam2 жыл бұрын
@@WClarkson thanks for the detailed answer!
@bruceonder31174 жыл бұрын
Nice game parts! :) Isn't there a property to kill sprites once they are off world bounds?
@WClarkson4 жыл бұрын
There may be. I tend to use maths whenever possible, because it is easier to transport that knowledge between languages. In this case it is a simple matter to check the y position.
@brunagobi73933 жыл бұрын
Bruce I guess you can use something called 'frustum culling' ?
@BruceOnder3 жыл бұрын
@@brunagobi7393 That's a bit advanced for what I'm asking about. :). In Phaser 2 there was a method on sprites called .outOfBoundsKill() and if the sprite went beyond the world bounds, it would be destroyed. This was removed in Phaser 3 since destroying sprites completely is not very environmentally friendly, and it would be better to just deactivate them, hide them, and maybe even put them in a group to pull from later. I found this SO article related to this: stackoverflow.com/questions/53091837/outofboundskill-equivalent-in-phaser-3
@sicoles112 жыл бұрын
At 5:49 why do you need .bind(this) on the callback function?
@WClarkson2 жыл бұрын
Sorry for the late reply. .bind(this) means that the 'this' keyword will refer to the class. Without using bind the keyword will refer to the scope of the function.
@brunagobi73933 жыл бұрын
nice tutorial, but for me appears " Uncaught TypeError: can't access property "emit", " and I already imported
@WClarkson3 жыл бұрын
you can send me your code through the dropbox link on the contact page of PhaserGames.com and I'll have a look