Skip to content

Instantly share code, notes, and snippets.

from dataclasses import dataclass
import numpy
import pygame
from pygame import Vector2
WINDOW_WIDTH = 500
WINDOW_HEIGHT = 400
MAX_FPS = 60
from heat2d import *
engine = Engine()
engine.window.title = "Heat2D UI Testing"
engine.window.clear_color = (255, 255, 255)
class Mario(GameObject):
def __init__(self):
super().__init__()
@kadir014
kadir014 / fadehandler.py
Created January 26, 2020 16:23
Fade effect for pygame
import pygame
display = None
fade_surface = None
tick = 0
speed = 10
anim_state = None
anim_func = None
def init():
@kadir014
kadir014 / draw_dashed.py
Last active December 17, 2019 07:46
Dashed lines in Pygame
import pygame
from math import hypot
class Point:
def __init__(self, point):
self.x = point[0]
self.y = point[1]
def __add__(self, other):