Snake game in Python: use Pygame to build your game

ofrecido por
Coursera Project Network
En este proyecto guiado, tú:

Learn pygame library and its different modules and functions.

Apply programming techniques in game development.

Clock1 hour 40 minutes
IntermediateIntermedio
CloudNo se necesita descarga
VideoVideo de pantalla dividida
Comment DotsInglés (English)
LaptopSolo escritorio

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 desarrollarás

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

Aprende paso a paso

En un video que se reproduce en una pantalla dividida con tu área de trabajo, tu instructor te guiará en cada paso:

  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.

Cómo funcionan los proyectos guiados

Tu espacio de trabajo es un escritorio virtual directamente en tu navegador, no requiere descarga.

En un video de pantalla dividida, tu instructor te guía paso a paso

Preguntas Frecuentes

Preguntas Frecuentes

¿Tienes más preguntas? Visita el Centro de Ayuda al Alumno.