teach scripting with construct

  • remark: I initially wrote this from the perspective of a teacher however, it might be interesting for all users who want to learn scripting in construct 3.

    As a science teacher (who might have to teach computer science one day) I was very happy to hear that I am now able to use JavaScript (more readily) in construct. However I am very confused, how I could teach with construct computer science.

    right know my naively approach would be something like this (assuming students learned scratch before):

    - week 1-10) Learn Programming Principles with the event system - The event system is a great tool and the best reason to use construct in classroom. It is enough for many of my struggling students, who should get at least a basic understanding how computer science problems are solved... and also it helps even the most struggling students to create a decent game at the end of the course.

    - week 11-20) learn JavaScript somewhere else (for example codecombat...) - that is from a teaching perspective a tough part (but manageable)

    - week 20-25) come back to construct and learn to use basic knowledge in JS in actions (alert("something") for debugging, read variables...)

    - week 26-30) scripts to create more complex games (probably just the most advanced students)

    - week 30-40) students project

    Am I getting this basically right? Is this how it is meant to be? Did you discuss other ideas?

    If so: I have some suggestions to ease learning in week 25.

    Firstly you could start more slowly and create a ghost shooter tutorial with events and JS actions

    Secondly I think it is a great idea to use the same space shooter example to learn JS with which you have started. And I like the idea to give the explanation in comments like professional developer do. What I am missing is a direct comparison between these two space shooter tutorials

    - For students it would be very helpful to understand what the event system originally did for them (in JS terms) --> A tutorial, which directly compares event system with JS would be very helpful.

    - students need to know, what they can do now with JS, what they could not do with the event system. It would immensely help, when this new feature they could program with JS would be super fancy.

    - give teachers a reference in which you explain how the event system compares to JS (and I think this has to be written from one of the construct creators, since no one else ever thought about how to simplify JS with an event system).

    As mentioned above I think this would also help regular users, who want to learn scripting in construct. Obviously, there is always more that one could do to help struggling students. But I think these are the most critical points. What do you think?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't have teaching experience myself, but I imagined that the best way to move from blocks to scripting would be to use scripts in actions. This lets you start with blocks, and then add just a single line of code, e.g. alert("Hello world!");. Using these you could then expand out to variables, loops and so on. However as I said I've not tested that in a classroom, so I think it's up to you as the teacher how to best approach it.

    Regarding comparing events to JS, it seems difficult and potentially more confusing, because the way blocks work is very high level and quite far removed from the type of idiomatic code you'd write in JS. Just off the top of my head, one example of that is how "On collision" in the event sheet runs upon two objects colliding, but in scripting you'd instead have a "tick" callback (equivalent to "Every tick"), two nested for loops iterating all the instances (equivalent to the internal picking of conditions), an overlap test (to identify collision), and then some kind of memory to discard repeat overlaps so it only runs code upon the first overlap (equivalent to the internal memory that "On collision" uses to make sure it only runs upon the first overlap, and not repeatedly afterwards). Explaining all of this seems pretty complicated, and I'd have imagined an easier approach would simply be to explain what the "On collision" event does (rather like outlining a specification), how to replicate that in JavaScript, and then just finish with "and that's what the "On collision" block does internally". What do you think?

  • I think you are perfectly right about the "best way to move from blocks to scripting would be to use scripts in actions. [...] Using these you could then expand out to variables, loops and so on."

    However, I also think that the smaller comparison you did made

    - have a "tick" callback (equivalent to "Every tick")

    - nested for loops iterating all the instances (equivalent to the internal picking of conditions)

    are necessary to integrate the knowledge students gained in the beginning of class into the new concept of JS.

    Finally you might not have intended it, but you gave - with the on collision event - a good example why teachers need a fairly complete list of comparison between events and JS. Assume that a student wants to script an "on collision" event by him/herself and asks the teacher if he thinks this would be a good idea. The teacher would have to decide quite fast if the student is up to this challenge or if he/she should just use the "on collision" event as it is. A clear list of concepts the student would need to know, would be necessary to the teacher.

    Again you are right about that a good way "to explain what the "On collision" event does (rather like outlining a specification), how to replicate that in JavaScript, and then just finish with "and that's what the "On collision" block does internally". This is the kind of list, which would be very helpful for teachers.

  • rikkichinna

    I also see much potential for learning with Construct in general. What I like most about construct is that students can learn and be successful at very different levels

    a) students with less scripting/math skills can work with the event system

    b) and better students can move to scripting in actions.

    c) real coding in scripts

    At the end of the course everybody in class has a good chance to show off a decent game (while simultaneously the students who learned JS with construct had profited most from the course for life). So during the course everybody sees a way how to make their game according to their skill level, everybody keeps engaged to learn more and nobody has to be ashamed. (Additionally Laura from Scirra produces these excellent videos and blog, which show that girls/woman/everybody can become good a computer science even if it is sometimes a bit painful)

    However, as a public schools teacher one has to try to lift most students to level c (because society does not want pupils to be good game developers but people who can code anything) and I think teachers would need more information how to achieve this - or at least I would need a bit more guidance.

  • Just from my previous CS classroom experience, the first things you should teach are the very basics. Learning the difference between a byte, integer, float, boolean, array, etc. is essential to understanding every computer language. Teach for loops, while statements, if/then conditions.

    I'm reasonably fluent in several languages and variables and structures like those are core to every language including Construct. Once they get the basics of those, it's just a matter of syntax. While Construct is mostly in a language I have issues with (JS), the core concepts of how languages work allows me to code with ease.

    If your intent is to teach the basics of how programming languages solve problems and to create a working game, I'm not so sure I'd delve too deep into actual JS coding. C3 can do all that without writing code. Getting structure and syntax down in a coding IDE can be pretty intimidating. While JS is a very useful language I believe I'd leave the writing code part to more advanced courses like C++, Python or C#. Those that want to learn higher level languages will take that plunge into writing actual code. Those that do not, will still have the basic concepts and could still create in C3. Besides, writing code in Construct can be fun as you usually get instant gratification and see the results. In other languages, it's mostly a thankless grind with only crunched numbers to show for it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)