You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Mariya, thank you for writing the article at freecodecamp. I found it from the Latest Tutorials list on phaser.io. At the end of the article you mention any feedback is highly appreciated and this is the only place I could find to give feedback so here's mine.
The code formatting in the article text itself needs some fixing. I type everything in by hand when learning/practicing to better retain what I'm doing and it's quite difficult to do that with the way the code is formatted in the article now.
In GameScene's onClick and onFall functions a function is returned that's then registered as an event handler. I'd wrap the onClick and onFall calls in functions when registering the event handler rather than in the onClick or onFall calls themselves in case there are other times you need to invoke them in the future that you don't want wrapped.
Ex:
In GameScene's onFall when the star is destroyed, after 100 ms it checks if more than two stars have been destroyed and ends the game. I converted that to a lambda function and it wasn't ending the game so there might be some this problems there (I haven't looked into it, probably shouldn't have made it a lambda function though). I moved the game ending check to the update() function to be closer to the rest of the game update operations, it's easier for me to reason about the class if the game ending check isn't stuck away in some event handler somewhere.
Again, thanks for the time you took to write the article. It's a good introduction to setting up a Phaser project with Typescript.
The text was updated successfully, but these errors were encountered:
Hi Mariya, thank you for writing the article at freecodecamp. I found it from the Latest Tutorials list on phaser.io. At the end of the article you mention any feedback is highly appreciated and this is the only place I could find to give feedback so here's mine.
The code formatting in the article text itself needs some fixing. I type everything in by hand when learning/practicing to better retain what I'm doing and it's quite difficult to do that with the way the code is formatted in the article now.
In
GameScene
'sonClick
andonFall
functions a function is returned that's then registered as an event handler. I'd wrap theonClick
andonFall
calls in functions when registering the event handler rather than in theonClick
oronFall
calls themselves in case there are other times you need to invoke them in the future that you don't want wrapped.Ex:
In
GameScene
'sonFall
when the star is destroyed, after 100 ms it checks if more than two stars have been destroyed and ends the game. I converted that to a lambda function and it wasn't ending the game so there might be somethis
problems there (I haven't looked into it, probably shouldn't have made it a lambda function though). I moved the game ending check to theupdate()
function to be closer to the rest of the game update operations, it's easier for me to reason about the class if the game ending check isn't stuck away in some event handler somewhere.Again, thanks for the time you took to write the article. It's a good introduction to setting up a Phaser project with Typescript.
The text was updated successfully, but these errors were encountered: