Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace callbacks with assignment #36

Open
tjvr opened this issue Aug 2, 2019 · 0 comments
Open

Replace callbacks with assignment #36

tjvr opened this issue Aug 2, 2019 · 0 comments

Comments

@tjvr
Copy link
Member

tjvr commented Aug 2, 2019

We could do a few things to make you-win easier for beginners.

Replace arrow functions () => { ... } with function literals function() { ... }, to match the JS course.

Replace player.forever(function() { ... }) with player.onTick = function() { ... }, to reduce the number of brackets you need to type, and move toward things being defined in a single place. Beginners often end up with multiple forever loops and I think this is a point of confusion.

On that note: I think the distinction between initialization (at the top-level), and doing things every frame (inside a forever), is not the easiest to grasp. I wonder if it would be better to have an explicit initialisation step, something world.onBegin = function() { ... } , or uw.onBegin = function .... This would roughly match Scratch's "when green flag clicked".

I worry that our current style relies far too much on scope, e.g. creating a makeBullet() function. I wonder if it would be better to move towards a more class-based/OOP approach, like we did in the old Python Games course...

As a minor point, if it's possible to configure the editor we use to auto-indent / pretty-print on save, that would reduce a major proportion of the errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant