5 – Say Elo to Chess


🎯 Learning Objectives

After this lesson you should be able to:

  • Know how chess pieces move
  • See chess as a game made up of objects and the position of those objects as the game’s state
  • Get the first chess pieces moving
💬 Key Vocabulary

  • Chess
  • Object
  • State
  • Transition
  • Pawn
  • Valid move
  • Capture
  • Assets
  • Iterative development
  • Sprint
Last lesson, you…

  • Built your first proper game
Today, you will…

  • Learn the basics of chess
  • Build the first stages of a chess game
  • Consider the first steps of iterative development

📝 Starter Activity – Chess

https://s.yimg.com/ny/api/res/1.2/m2RcqBf7gSggb3AiEUnVmg--/YXBwaWQ9aGlnaGxhbmRlcjt3PTk2MDtoPTQ4MC42NjY2NjY2NjY2NjY3/https://s.yimg.com/uu/api/res/1.2/gnjXfQwaRGOODGUd2TVaeA--~B/aD03MjE7dz0xNDQwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/hearst_mens_health_171/b4db864d88a143fae9173183bfc55b29
The Queen’s Gambit (Netflix, 2020), has made chess popular again.
  • Let’s see what you know already about chess.
  • Click the link below to go to chess.com, and play a short game.
  • If you’ve played before, you can choose a more challenging opponent on the right hand side – each has a difficulty measured using the standard Elo Rating System for chess.
  • You start with a rating of 1000 and gain or lose points as you win or lose games. A beginner might have an Elo rating of a few hundred (more losses than wins), a good amateur player between 1000 and 2000, and a chess master a score above 2000.

📝 Learn it – Chess

Answer the following questions based on what you know and what you’ve found out from playing chess.

  1. How does chess work?
  2. How many different pieces are there in chess?
  3. How are the pieces different? What does each do?
  4. How is a game of chess won?
  5. What would a state in chess be?

Think about these questions, write down your answers, then have a look at the answer below.

Click here for the answer

📝 Activity 1 – Game State

The code below includes a lot of the work needed to make a chess game. Most of it is hidden away. However, the previous developer gave up before it was completely finished, and quite a lot is still missing or broken. This is real code, the basis of which you can find released online, and it really is broken! Your job over the next few lessons will be to finish this game. Today’s task, though, is just to get the pawns moving.

You’ll recognise a lot of code, like the use of a game loop. You’ll also see that the chess board, and all the pieces, are objects. You might also recognise that the sprites are indeed being blitted onto the screen.

You need to complete the following tasks today:

  • Make the game draw the white pawns
  • Make the game draw the black pawns
  • Make the pawns able to move

💬 Summary

In this lesson, you…

  • Learned the basics of chess
  • Built the first stages of a chess game
  • Considered the first steps of iterative development

In the next lesson, you will…

  • Produce an iteration of your game which adds more features and improves the game.

🏅 Badge it

🥈 Silver Badge

  • Upload your findings and knowledge about chess.
🥇 Gold Badge

  • Upload your code with some of the tasks completed.
🥉 Platinum Badge

  • Upload your code with the pawns fully implemented and working.