Snake game in Python: use Pygame to build your game

oferecido por
Coursera Project Network
Neste projeto guiado, você irá:

Learn pygame library and its different modules and functions.

Apply programming techniques in game development.

Clock1 hour 40 minutes
IntermediateIntermediário
CloudSem necessidade de download
VideoVídeo em tela dividida
Comment DotsInglês
LaptopApenas em desktop

In this 1-hour long project-based course, you will be able to create the famous snake game using Python and Pygame modules, also you will be able to identify most of the objects and functions in the pygame library that will help you to build your own game projects. This includes applying draw, time, and display modules, handling different types of events, and defining functions for completing the game logic. Python language is one of the most accessible programming languages available because of Its simplified syntax that gives emphasis on natural language. Python and Pygame are good languages and framework for rapid game prototyping or for beginners learning how to make simple games. Note: This project works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

Habilidades que você desenvolverá

  • Video Game Development
  • Pygame library
  • Python Programming
  • Pygame
  • Game Programming

Aprender passo a passo

Em um vídeo reproduzido em uma tela dividida com a área de trabalho, seu instrutor o orientará sobre esses passos:

  1. By the end of Task 1, you will be able to initiate Pygame and create the first game screen.

  2. By the end of Task 2, you will be able to create RGB colors to draw rectangles and change the desktop background color.

  3. By the end of Task 3, you will be able to handle key down events, and apply the time module for controlling the snake speed.

  4. By the end of Task 4, you will be able to use if conditions for controlling the game logic and define the game_loop function.

  5. By the end of Task 5, you will be able to use different font functions to show messages on the screen, and use the random library to create food objects.

  6. By the end of Task 6, you will be able to use lists and logics to increase the length of the snake when eating the food.

  7. By the end of Task 7, you will be able to display the score on the screen, finalize the game logic, and implement the full generic game code.

Como funcionam os projetos guiados

Sua área de trabalho é um espaço em nuvem, acessado diretamente do navegador, sem necessidade de nenhum download

Em um vídeo de tela dividida, seu instrutor te orientará passo a passo

Perguntas Frequentes – FAQ

Perguntas Frequentes – FAQ

Mais dúvidas? Visite o Central de Ajuda ao estudante.