This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import pygame as pg | |
CAPTION = "Collisions" | |
SCREEN_SIZE = (500, 500) | |
BACKGROUND_COLOR = (30, 20, 30) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import math | |
import pygame as pg | |
class Block(pg.sprite.Sprite): | |
def __init__(self, pos, speed, next_move): | |
super(Block, self).__init__() | |
self.image = pg.Surface((50,50)).convert() | |
self.image.fill(pg.Color("red")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import pygame as pg | |
from string import ascii_uppercase | |
SCREEN_SIZE = (500, 500) | |
CAPTION = "Letter Tiles" | |
BACKGROUND_COLOR = pg.Color("darkslategray") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
A very simple example showing how to drag an item with the mouse. | |
Dragging in this example uses relative mouse movement. | |
-Written by Sean J. McKiernan 'Mekire' | |
""" | |
from __future__ import division |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import time | |
from player import * | |
from constant import * | |
from spritesheet_functions import SpriteSheet | |
import sys | |
import math | |
pygame.init() | |
pygame.mixer.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import os | |
import sys | |
import math | |
import pygame as pg | |
CAPTION = "Move me with the Arrow Keys" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame, sys, random | |
from pygame.locals import * | |
#set up pygame | |
pygame.init() | |
mainClock = pygame.time.Clock() | |
#set up the window | |
WINDOWIDTH = 600 | |
height = 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import os | |
import sys | |
import pygame as pg | |
CAPTION = "Flashing Screen" | |
SCREEN_SIZE = (500, 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import os | |
import sys | |
import pygame as pg | |
CAPTION = "Flashing Screen" | |
SCREEN_SIZE = (500, 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import pygame as pg | |
MAP_SIZE = 20, 10 | |
TILE_SIZE = 50, 50 | |
CHANCE_OF_SAME = 0.75 | |
TEXTURES = ["water", "dirt", "grass", "coal"] |
OlderNewer