Tags » PyGame

Bubbletree

This program falls into the category ‘fancy, but not usefull’. It basically starts with one circle, which spawns in new ones. The maximum number of circles is 100, their color is a gray tone (rgb between 50 and 100). 594 more words

2015

FS Letters II

Improving my first version – FS Letters – I changed a core behavior. Instead of going thru the whole file system, saving it, interpreting it and then displaying it, I now went for a dynamic approach. 665 more words

2015

Jake

Continuing to clone famous and fairly easy games, I now made my own version of Snake.
In this version you cannot leave the screen, there are never more than three apples on the screen and there are no blocks inside the field. 990 more words

2015

PyGame Tutorial 02 - Using PyGame.draw

splat.py
import pygame

pygame.init()

clock = pygame.time.Clock()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption('Splat Game')

#colors
black = (0,0,0)
white = (255, 255, 255)
green = (100, 255, 100)

def draw_board():
    pygame.draw.line(screen, green, (250,250), (550,250), 1)
    pygame.draw.line(screen, green, (250,350), (550,350), 1)
    
    pygame.draw.line(screen, green, (350,150), (350,450), 1)
    pygame.draw.line(screen, green, (450,150), (450,450), 1)

class Rat:
    def __init__(self, pos):
        self.pos = pos
        self.r = 0
        self.g = 0
        self.b = 255
        
    def draw(self, screen):
        pygame.draw.circle(screen, (self.r, self.g, self.b), self.pos, 25)

rats = []
rats.append(Rat((400,300)))

running = True
while running:
    clock.tick(30)
    screen.fill(black)
    
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    
    draw_board()
    for rat in rats:
        rat.draw(screen)
    
    pygame.display.update()
PyGame

stopTheZombie - (Python Game)

Hello, this is my second post in this blog. Now, I wanna share about this python game, this project will be used as a Final Project in my Digital Signal Processing course. 316 more words

Python

PyGame Tutorial 01 - First things first...


splat.py
import pygame

pygame.init()

clock = pygame.time.Clock()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption('Splat Game')

#colors
black = (0,0,0)
white = (255, 255, 255)
green = (100, 255, 100)

running = True
while running:
    clock.tick(30)
    
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
PyGame

Jong

After having programmed my own Tetris clone – Jetris –, I thought of another game to clone. A really fun and fairly simple game came to my mind: Pong. 1,462 more words

2015