Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Raspberry Pi Embedded Projects Hotshot
  • Toc
  • feedback
Raspberry Pi Embedded Projects Hotshot

Raspberry Pi Embedded Projects Hotshot

By : Sai Yamanoor, Srihari Yamanoor
close
Raspberry Pi Embedded Projects Hotshot

Raspberry Pi Embedded Projects Hotshot

By: Sai Yamanoor, Srihari Yamanoor

Overview of this book

This book is targeted towards beginners and intermediate designers of mechatronic systems and embedded system design. Some familiarity with the Raspberry Pi and Python programming is preferred but not required.
Table of Contents (15 chapters)
close
14
Index

A brief description of the Connect Four Game AI


In this task, we will discuss the general mechanism of the game. We will discuss the function calls used, game flow, and a general idea of the game mechanism. It would be a good idea to follow this code review along with the game code available in this project.

Prepare for lift off

We are building this arcade game based on the code from Making Games with Python & Pygame by Al Sweigart (http://inventwithpython.com/makinggames.pdf). This book is an interesting read and it should enable us to build our own arcade game (not necessarily the Connect Four game).

Engage thrusters

  1. Let's get started with reviewing the general structure of the game using the flowchart shown in the following diagram:

  2. The first step is to import the modules required to launch and play the game. This includes the pygame, pygame.mixer, piface, and serial modules.

  3. After importing the requisite modules, game parameters such as game difficulty, board size in terms of width and...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete