Скачать книгу

the arrow keys. Press the Spacebar to start the game or get back to the menu when it ends. Player 1 (left) uses the A and Z or Up and Down keys to move. Player 2 (right) uses the K and M keys. The computer can be your Player 2. The first player to score 10 points wins.

       Bunner: This a clone of Frogger, where your challenge is to move safely up the screen, dodging traffic and crossing rivers by leaping onto logs. Press the Spacebar to start the game and get back to the title screen at the end, and press the arrow keys to move.

       Cavern (see Figure 4-10): This game is inspired by Bubble Bobble, another classic from the ’80s. Move your monkey character with the arrow keys, avoiding the robots. Use the Spacebar to fire a bubble to entrap the robots, as you zip around collecting fruit. When you fall off the bottom of the screen, you come back at the top.

       Minecraft Pi: See Chapter 13 for information on playing and programming this game.

       Myriapod: Use the arrow keys to move and the Spacebar to fire in this Centipede clone. Your gun is at the bottom of the screen. Your aim is to shoot and destroy the centipede that crawls down the screen and to avoid getting hit by the fly, which you can also zap. Destroy rocks to make it easier to shoot the centipede. We use a screen resolution of 1,024 x 768 usually, but we had to change it to 1,152 x 864 to see the whole game arena.

       Substitute Soccer: This football game has three difficulty levels. Move using the arrow keys and Spacebar to pass or shoot. If you have a friend over, they can play using the W, A, S, and D keys to move and the left Shift key to pass/shoot. A triangle above a player shows which one is active.

      These games were coded by Raspberry Pi cofounder Eben Upton, and come from the book Code the Classics, Volume 1. Find it in the Bookshelf app.

      There is also an entry called Python Games, which gives you access to 12 further games, written by Al Sweigart. Click a game to select it. The games are as follows:

       Flippy: A version of Reversi. Click to place your counter. Any counters in a line between your new counter and any of your other counters will switch to your color. The winner is the one with the most counters in their color.

       Four in a Row: Click and drag the pieces to drop them into the frame. The winner is the first to get four pieces in a row, in any direction. The computer AI is pretty smart!Raspberry Pi FoundationFIGURE 4-10: Cavern, one of the games in Raspberry Pi OS.

       Gemgem: In this game, there’s a grid of gems. You can swap any two neighboring gems to make a row of three, which then disappear. Use the mouse to click the two gems you want to swap. It’s against the clock. Achieving a row of three extends your time.

       Inkspill: This is a favorite of Sean’s. You have a grid of colored squares. Starting at the top left, you change the color of the ink. Any squares of the same color that are touching the square join your ink spill, making it bigger. The idea is to keep changing colors to try to fill the screen with a single color.

       Memory Puzzle: This is a version of Pairs or Concentration, a classic card game. You click a card to turn it over, and then click another card to see if they match. Your aim is to pair up all the cards.

       Pentomino: This version of Tetris uses the arrow keys to move the blocks and the Q key to rotate them. The aim is to stop the blocks from piling up to the top of the screen. When you complete a row, it disappears. This game has some different tile designs from the original game.

       Simulate: This game is a pattern repeating one. Click the panels to repeat the sequence that’s played to you.

       Slide Puzzle: This sliding puzzle game uses the arrow keys or mouse to move tiles. Can you unscramble the puzzle?

       Squirrel: Your aim is to eat the smaller squirrels, while avoiding the bigger ones. Each time you eat, you grow. Move using the arrow keys.

       Starpusher: This puzzle game starts easy but gets harder. The game challenges you to move stars onto the target spaces on the floor. You’ll need to think clearly to avoid getting any stuck in corners. Arrow keys move your character, and you’ll probably need to use the Backspace key to restart the level sometimes.

       Tetromino: This game is like Tetris with the original tile designs. Arrow keys move the pieces and the Q key rotates them.

       Wormy: This version of the classic mobile phone game Snake uses the arrow keys to move the snake. The aim is to eat the red blocks, without bumping into your own tail or the edge of the screen. Each time you eat, you grow, so the game gets harder and harder.

      You can discover new software to install using the command line (see Chapter 5), but there’s also a friendly tool you can use in the desktop environment. On the Applications menu, hover over the Preferences option and click Add/Remove Software to get started. You need to have an active Internet connection.

Snapshot of the Add/Remove Software menu.

      Raspberry Pi Foundation

      FIGURE 4-11: The Add/Remove Software menu.

      When you’ve finished choosing your software, click the OK button to install and remove the applications. You will be prompted to enter your password (which is raspberry if you haven’t changed it). It can take some time to download and install the software, so it’s a good idea to choose a few applications and leave them to install in one batch while you do something else.

      The menu ensures that any applications that your chosen application requires also get installed. When I installed Brain Party (see Chapter 19), for example, the menu automatically installed its separate data package for me.

      

The menu makes it easy to install software, but you might find that not all the software works well on the Raspberry Pi. It’s easy enough to try something, though, and remove it if it doesn’t do what you need. It’s all free.

      

The Recommended Software app in the Preferences part of the Applications menu is used to install or remove recommended software. If you chose to install a version of Raspberry Pi OS without these recommended applications, you can install them from here.

      If you want to back up your files, you can easily copy them to a USB key using File Manager as described earlier in this chapter, or using shell commands. (See Chapter 5 on file copying, and the Appendix for more on mounting external storage devices.) If you’ve got a lot of files on the MicroSD card, though, and you’ve spent time customizing it with your preferred settings

Скачать книгу