Kivy is a free and open source Python framework for developing mobile apps and games with a natural user interface.

We just released a 5-hour Kivy course on the freeCodeCamp.org YouTube channel. In this Kivy course, you will learn to create games and applications with Python for every platform (Windows, Mac, iOS, Android).

Jonathan Roux developed this course. Jonathan has created many courses on a variety of platforms.

First you will learn how to use the Kivy library. You will create graphical user interfaces with buttons, labels, and images. You will learn how to implement many kinds of layouts to create interfaces that can adapt to every screen size from desktop to mobile.

Then you will create a full game with Kivy and Python. The GALAXY project is a perspective game where you need to keep your spaceship on the track.

Here is everything covered in this course:

Introduction

  • Introduction
  • The GUI libraries with Python (tkinter, QT, pygame...)
  • The course curriculum
  • Prerequisites
  • Setup
  • Project creation and installation of Kivy
  • Download the resources files

The Lab project | 1 - Layouts

  • Introduction
  • Button and Label
  • BoxLayout
  • Size_hint and Pos_hint
  • What can we do with Kivy ?
  • Embed a layout
  • AnchorLayout
  • GridLayout
  • StackLayout
  • ScrollView
  • PageLayout
  • Conclusion
  • Layouts : a practical example

The Lab project | 2 - Widgets

  • Introduction
  • Button click
  • Exercise : Create a counter
  • Custom font
  • Toggle Button
  • Exercise : Enable/disable the counter
  • Disabled button
  • Switch
  • Slider
  • Exercise : Display the value of the slider
  • Exercise : Enable the slider
  • Progress bar
  • TextInput
  • Images
  • Create an application with multiple screens ?

The Lab project | 3 - Canvas

  • Introduction
  • Rectangle and ellipse
  • Line
  • Exercise : Cross
  • Lines (Circle, ellipse, rectangle) and colors
  • Canvas from the code
  • Move the rectangle
  • Exercise : borders of the screen
  • Ball and animation
  • Exercise : Make the ball rebound
  • Coordinates and RelativeLayout
  • Exercise : Flag

The Galaxy project | V1

  • Introduction
  • Project creation
  • Perspective point
  • Vertical lines
  • Principle : Perspective transformation
  • Perspective transformation
  • Exercise : Re-center
  • Horizontal lines
  • Horizontal lines perspective
  • Forward movement
  • Delta time
  • Exercise : Lateral movement
  • Exercise : Key press
  • Keyboard

The Galaxy project | V2

  • Introduction
  • Structure our code
  • Tiles and lines coordinates
  • Exercise : Line Y from index
  • Display a tile
  • Move the tile
  • Display several tiles
  • Tiles : infinite generation
  • Random land generation
  • Exercise : Do not exit the land
  • Exercise : Start with a straight line
  • Exercise : Display the ship
  • Exercise : Fix the game speed
  • Collisions

The Galaxy project | V3

  • Introduction
  • « Game over » state
  • Create the menu
  • Start of the game
  • Restart the game
  • Finalise the menu
  • Exercise : Add the background image
  • Exercise : Score
  • Exercise : Add the sounds

Watch the full course below or on the freeCodeCamp.org YouTube channel (5-hour watch).