This 2014/2015 school year’s first term is about to expire. After approximately 8 lessons of coding (less than 8 hours of work), and one week for project development (homework time) the final results are really awesome, taking in count that:
- Students didn’t have any previous knowledge about coding.
- They didn’t know anything about game strategies.
As a picture’s worth a thousand words, have a look at this video to see some examples:
Here you have some of my first conclusions about this exciting project called Gamecodization (more at gamecodization.com):
- Different levels of students: superb (20%), average (70%), poor (10%).
- I divided coding exercises in stages, so all students could catch up eventually.
- I had to consider repeating 1 session for the lost ones.
- Student types:
- Engaged: they know what they’re doing. They use pseudocode wisely. They understand and solve. They want to learn deeper.
- Robotic: they translate pseudocode without much understanding. They don’t really know where to place code (inside loops, conditions…).
- Lazy: they need to have most of the pieces in place to start understanding things.
- Pseudocode:
- It’s key to help students in the beginning.
- It can be a problem when students just do things robotically, translating from pseudocode to code without further understanding.
- Debugging.
- Students don’t read compiler’s messages, they prefer to ask the teacher.
- There are plenty of problems with variable names due to case sensitiveness.
- I instructed my students to use PRINT sparingly to know variables’ states.
- Exercise phases: a single exercise can have many stages (increasing complexity). Start really simple and build on them more layers. Examples:
- Guess the number. Stages:
- Calculate a random number and print it properly (no decimals).
- Read a number from the console and print it.
- Now compare both numbers, for higher than and lower than.
- Loop everything until the win state is reached.
- Include other elements: messages, points, leaderboards, preferences.
- Avoid long, tedious exercises to avoid students getting stuck.
- Homework:
- Aside of coding games, basic exercises are of help to clarify some concepts:
- Basic operations: use of the console, file I/O.
- Arranging of elements.
- Dynamic data structures.
- Etc.
- I gathered my students in groups and gave them flipped resources so they could group in teams at home.
- Assessment:
- Projects in pairs (in three people groups one of the participants tends not to work as hard as the rest).
- Ask for pseudocode and code: the last one could not execute in the last time. And as a teacher you can always check the pseudocode to tutor them better.
- Some interesting and easy games to develop.
- Escape the maze.
- Arkanoid.
- Asteroids.
- Snake.
- Frogger.
- Space invaders.
- Other of their choice.
- Test exam:
- This will make them memorize better basic instructions (LET, PRINT…). Otherwise they’ll feel they don’t have to bear anything in mind, and they’ll waste lots of time checking compiler’s help all the time.
- Anyway, I made it easy, in the end you want to keep fun in your classes.
- Grade: you have three elements for grading.
- Theory: test.
- Practice: pseudocode and code (if code works well pseudocode shouldn’t grade anymore).
- Attitude, interest, behaviour.
- Game structure for arcades: for this first stage all the game developed have been based in the following algorithm.
- Initialization.
- Main loop
- Movement.
- Laser
- Enemies.
- Collisions.
- Items (keys…).
- Win-state check.
- End of game
- Leaderboard.
The main strategy for teaching coding through games has been:
- The idea is not to teach the coding language used (in this case Basic256), but to teach coding basis (sequences, conditions and loops) and strategies to build games.
- As lessons went ahead, I maintained a document (a sort of a cheat sheet), so they could know what instructions and concepts had been worked with, so they didn’t need to check the official documentation over and over.
- It’s key to start teaching very basic things through a simple game, in this case “Guess the number”.
- Print on the text console.
- Read a number from the console.
- Calculate a random number.
- Compare both numbers.
- Repeat the operation until the number is guessed.
- With the previous game you’ve covered the three structures and some instructions, as PRINT, READ, RAND, LET; WHILE, IF THEN.
- The students shouldn’t be breaking their heads trying to figure out complex things. For example, I gave them enough information to calculate a random number, as INT(RAND*10). The same goes for spaceship movement, collisions, point scoring and so on. It’s like giving them basic pieces so they can combine them in different ways to create a wide range of outcomes.
- I passed rapidly to graphic based games. Visuals are key for students. For the second exercise we developed a rebounding point:
- Concepts of x,y positioning (plot).
- Variable for controlling the direction of the point (NE, NW, SE, SW).
- Out-of-bounds control, to make the point move properly.
- For the third exercise we started developing the Asteroids game (reduced version). In it I introduced the concepts of game structure (main loop), etc. Challenges took the form of:
- How to move several elements at the same time: they tried using FORs, popping up the concept of time slicing.
- How to set an element’s life-cycle in the main loop (as a laser), also popping the concept of flags.
- One of the topmost curious things was the fact that some students had the tendency to include code out of the main loop, revealing they hadn’t understood correctly previous concepts.
- Other aspects, as sprite collision, were easier to solve, as basic256 includes several ad-hoc functions. It is so easy to manage you don’t even need arrays to structure your sprites, as you can use expressions like SPRITEPLACE 1, SPRITEX(1)+5, SPRITEY(1) to move the sprite #1 to the right 5 positions.
- After finishing the basic version of asteroids we started including other elements: explosions, animations, points, leaderboards...
- As a final project my students had the opportunity to choose a game and develop it in groups (check the video).