Skip to content

Latest commit

 

History

History

class_02

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Class 2

In this class, we'll go over making the game Pong in Kivy, and we'll practice using the KV language for putting objects on the screen.

Pong

Before going through the code, create a new run configuration (see steps 5 through 11 in "Our First Kivy Program") to run pong.py and see how the game plays. Mentally note each part of the game, the rules each part follows, and what sort of logic you think might go into making things behave the ways they do.

This is based directly on Kivy's Pong Game Tutorial.

My recommendation is to go through the pong.py and pong.kv files here that have my comments and the tutorial on the Kivy site. We have different manners of explaining things. What's most important is that you understand what's going on, so spend more time with whichever version helps you understand things better. If you do end up preferring the way the Kivy site explains things, do tell me how it makes things clearer, so I can improve my way of teaching :)

KV Practice

KV files are used to define how things should visually appear. While this can be done in purely Python code, it's much easier to do it with KV files. In kvpractice.py and kvpractice.kv, we'll go over in more detail how to do some fancy kv things.