Skip to content

Instantly share code, notes, and snippets.

View ectrimble20's full-sized avatar

Eric ectrimble20

  • USA
View GitHub Profile
@ectrimble20
ectrimble20 / entities.py
Created May 24, 2020 02:13
alient_invasion_revision
class Entity(object):
def __init__(self, game_ref):
self.game = game_ref
def update(self, dt):
raise NotImplemented
class Ship(Entity):
@ectrimble20
ectrimble20 / alien_invasion.py
Created May 22, 2020 22:32
Space Invaders Clone - helping a reddit user fix some drawing issues.
""" create an empty pygame window by creating a class to represent the game"""
import sys
import pygame
from settings import Settings
from ship import Ship
class AlienInvasion:
import pygame
from pygame.locals import *
class EventSubscriber(object):
def process_event(self, event: pygame.event.EventType):
pass
@ectrimble20
ectrimble20 / sprites.py
Created August 15, 2018 06:15
Animation example for adding a Zelda like fall animation using a new state.
import pygame as pg
import pickle
from os import path
import traceback
from random import choice
import functions as fn
import settings as st
#import rooms as rm
@ectrimble20
ectrimble20 / pygame-fix.py
Created August 8, 2018 05:50
Pygame Loop fix
import pygame
from pygame.locals import *
import sys
pygame.init()
pygame.display.set_caption('Test')
mouse = pygame.mouse
fps_clock = pygame.time.Clock()
@ectrimble20
ectrimble20 / example.html
Created May 12, 2018 23:56
Multiple Checkboxes using Flask WTForms
{% extends "layout_new.html" %}
{% block content_main %}
<div class="content-section">
<form method="POST" action="">
{{ form.hidden_tag() }}
<fieldset class="form-group">
<legend class="border-bottom mb-4">User Choices</legend>
{% if form.choices.errors %}
<div class="invalid-feedback">
{% for error in form.choices.errors %}