Skip to content

Instantly share code, notes, and snippets.

#: kivy 1.9.1
<Main>:
HUD:
size_hint: 1., 1.
pos: 0,0
<HUD>:
spacing: 10
Button:
#!/usr/bin/python3
import kivy
kivy.require("1.9.0")
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.image import Image
from kivy.graphics import Rectangle
from kivy.clock import Clock
from kivy.properties import ObjectProperty
<Main>
size: 400, 400
canvas:
Rectangle:
pos: self.pos1
size: 30, 30
<Main>
size: 400, 400
canvas:
Line:
points: root.line1
width: 1.0
Rectangle:
pos: self.pos1
size: 30, 30
import os
def set_dir(file_path):
here = os.path.dirname(file_path)
os.chdir(here)
if __name__ == "__main__":
set_dir(__file__)
#!/usr/bin/env python2
"""
This is a program to sort downloaded series files into individual folders.
This program does in no way condone illegal file downloading.
Downloading files illegally is immoral and WRONG, and can be punished by up to life in prison or the death penalty (depending on your state or country).
Illegal downloads steals the hard earned money of not only starving artists but most importantly hard working executive producers, who desire nothing but the well being of their audience, but thanks to illegal downloading, can barely survive in todays economy living only by sleeping on their friends couches and hitchhiking to work.
Use this program at your own discretion, I am in no way responsible for what you do with it, or how you chose to live your life, but call your mom dude... seriously.
@Exodus111
Exodus111 / gist:5423533
Created April 19, 2013 22:02
New bolt class
class Bolt(pygame.sprite.DirtySprite):
def __init__(self, player):
self.player = player
self.image = pygame.image.load("bolt.png").convert_alpha()
self.rect = self.image.get_rect()
self.pos = vec2d(player.rect.center)
self.dirty = 1
self.lvl = 1
self.dmg = int((player.lvl * 0.5) + (self.lvl * 0.5) + 25)
self.speed = 25 + self.lvl
@Exodus111
Exodus111 / gist:4484734
Created January 8, 2013 15:37
Pygame gist for dirty sprites.
chimp = Chimp()
fist = Fist()
allsprites = pygame.sprite.LayeredDirty((chimp, fist))
allsprites.clear(screen, background)
# mainloop
rects = allsprites.draw(screen)
pygame.display.update(rects)
import numpy as np
from PIL import Image, ImageDraw
from vec2d import vec2d
from random import randint as rai
class Poly(object):
"""This generates a polygon in a numpy Array"""
from kivy.config import Config
xwidth, xheight = 1024, 960
Config.set("graphics", "width", xwidth)
Config.set("graphics", "height", xheight)
Config.write()
from kivy.app import App
from kivy.core.window import Window