Skip to content
Home » Kivy Part 1 – Introduction to the Kivy Python Project

Kivy Part 1 – Introduction to the Kivy Python Project

Spread the love

Before we start working on the Slugrace Kivy Python project, let’s have a look at what it’s all about.

But before we delve into the topic, here’s some info for you.

*****

Book Info

I just published my Kivy book, GUI Programming with Python and Kivy. It’s pretty long (over 800 pages) and comprehensive. And, which also counts, easy to read. The book contains lots of illustrations.

This book covers all the basics that you need to know to start programming GUI applications with Python and Kivy. Throughout the book we are building a GUI application from scratch, a fully functional game using all kinds of tools that Kivy has to offer. It’s our Slugrace project, but covered in a much more in-depth manner.

Each part of the book starts with a theoretical introduction of a topic or idea that we then implement in the project. I assume you have no prior knowledge of the Kivy library, but you should have at least some basic knowledge of the Python programming language, including the object-oriented programming paradigm as this is what we will be using a lot in this book.

Kivy book

The book covers all the basic elements of Kivy that you have to know, like widgets, layouts, Kivy ids and properties, graphics, screens, animation, sound. Finally we’ll deploy the app to Windows. It is pretty comprehensive and after you finish it, I’m sure you’ll be able to create your own awesome GUI apps of any kind, not just games.

I hope you will have at least as much fun reading the book as I had writing it.

As far as this Kivy series is concerned, the following parts will contain the most important elements covered in the book. However, some elements will be presented in a simplified way here on my blog or omitted completely.

____________

If you are interested, you can purchase the book in four versions. Here are the links:

1) ebook – pdf version on my website – in full color

Here you can see the description of the book, sample graphics from the book and the full table of contents.

2) ebook – Kindle version on Amazon – in full color

3) paperback version on Amazon – in black and white

4) paperback version on Amazon – in full color

*****

And Now Let’s Move On…

Slugrace is a game that combines a typical GUI application with animated graphics. This is a game for 1-4 players who put their bets on 4 slugs.

Settings Screen

When you start the game you first see the Settings screen:

settings screen

Here you can set the following:

– the number of players (1-4)

– the names of the players

– the initial money each player has when the game begins

– the ending conditions (when the game should end)

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

Main Screen of the Kivy Python Project

When you press the Ready button, you move on to the main screen of the game:

Main Screen of the Kivy Python Project

This screen is divided into several panels :

– the Game Info panel where you can see the number of the race, the time of the game, etc.

– the Slugs’ Stats panel where you can see the names of the slugs and their wins

– the Players’ Stats panel where you can see the names of the players and their current amount of money

– the main game panel in the middle with the racetrack where the slugs run

– the Bets panel where you can place your bets

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

Bets and Results

The Bets panel is actually a separate screen. When you press the Go button and when the race is over, this panel changes to the Results panel where you can see the Results:

bets and results

When you press the Next Race button in the Results panel, it’ll change back to the Bets panel.

In the upper right corner there are three buttons :

– End Game – this lets you end the game at any time and takes you to the Game Over screen

– Instructions – this takes you to the Instructions screen

– Sound – it turns the sound on or off

So, this is the application we’re going to create using Kivy with Python. But before we start working on our project, in the next couple posts we’ll have a look at the basics of Kivy. We’re going to start the project as soon as possible, but first we have to learn what a basic Kivy program looks like. But even before that we have to set up our environment, so in the next article I’ll show you how to install Kivy (or rather where to find information on how to do it on different systems) and how to use Visual Studio Code with the Python and Kivy extensions. This is my code editor of choice. If you have other preferences, you can use any editor or IDE you like.

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.


Spread the love

Leave a Reply