We will build a platformer game using cloud platforms, with JavaScript GitHub repo github.com/fah... Patreon / gamecodebites
Пікірлер: 4
@gopalmandloi63744 жыл бұрын
Thanks Fahad. This is Great. waiting for next one.
@gamecodebites46724 жыл бұрын
You are welcome Gopal, thanks!
@agent-332 жыл бұрын
What is the use of beginPath and closePath in renderQuad function? Can't it achieve the same thing without those? Why store functions in a variable? Can't it achieve the same by declaring function?
@gamecodebites46722 жыл бұрын
Briefly speaking, beginPath will start a new path and remove the list of paths. closePath, will connect the current path, with the first point. It's confusing, but sometimes you'll get weird results without them. For the second question, the difference is in the hosting, but my personal reason is to distinguish between a function that will be treated like a class (instantiate an instance out of it), but with const/let, I use them as real functions. Note that, when using direct function declaration (without const, let, or var) you'll be able to call that function event if the declaration was after the location of calling.