Skip to content

Instantly share code, notes, and snippets.

from scene import *
class MyScene (Scene):
def setup(self):
self.lines = []
def touch_began(self, touch):
x = touch.location.x
y = touch.location.y
self.xybegin = Point(x,y)
from scene import *
from random import randint, choice
from math import cos, sin
screen_size = Size(768, 1024)
score = 0
def update_score(n=1):
global score
if n == 'reset':
@SebastianJarsve
SebastianJarsve / TicTacToe.py
Created November 4, 2014 05:31
TicTacToe.py
# coding: utf-8
import ui, console
class Grid (object):
def __init__(self):
self.cells = [0 for i in range(9)]
self.current_player = 1
def add_brick(self, pos):
@SebastianJarsve
SebastianJarsve / MazeCreator.py
Last active August 29, 2015 13:56
Maze Creator
from scene import *
from random import choice
def opposite(d):
return (d[0]*-1, d[1]*-1)
def sub_tuples(a, b):
return (a[0]-b[0], a[1]-b[1])
def add_tuples(a, b):