Snake game in Python: use Pygame to build your game

от партнера
Coursera Project Network
В этом Проект с консультациями вы:

Learn pygame library and its different modules and functions.

Apply programming techniques in game development.

Clock1 hour 40 minutes
IntermediateУчащийся среднего уровня
CloudЗагрузка не требуется
VideoВидео на разделенном экране
Comment DotsАнглийский
LaptopТолько для ПК

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.

Навыки, которые вы получите

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

Будете учиться пошагово

На видео, которое откроется рядом с рабочей областью, преподаватель объяснит эти шаги:

  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.

Как устроены проекты с консультациями

Ваше рабочее пространство — это облачный рабочий стол в браузере. Ничего не нужно загружать.

На разделенном экране видео преподаватель предоставляет пошаговые

Часто задаваемые вопросы

Часто задаваемые вопросы

Остались вопросы? Посетите Центр поддержки учащихся.