Skip to content

Instantly share code, notes, and snippets.

@redawgts
redawgts / test_controller.py
Created September 9, 2022 07:32 — forked from sturdy-robot/test_controller.py
Testing pygame controllers using Pygame._SDL2 controller API
import sys
import pygame
import pygame._sdl2
from pygame._sdl2.controller import Controller
pygame.init()
window = pygame.display.set_mode((1200, 800))
pygame.display.set_caption("Testing controllers")
@redawgts
redawgts / state_engine.py
Last active September 1, 2022 23:28 — forked from iminurnamez/state_engine.py
Simple state engine example
#This code is licensed as CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/legalcode).
import sys
import pygame as pg
class Game(object):
"""
A single instance of this class is responsible for
managing which individual game state is active
@redawgts
redawgts / VideoBox.cs
Last active February 25, 2022 14:36 — forked from ArXen42/VideoBox.cs
VideoBox.cs
/// <inheritdoc />
/// <summary>
/// Wrapper control around VlcControl. Provides basic UI for video playback.
/// </summary>
public partial class VideoBox : UserControl
{
private static readonly String[] MediaOptions = {":avcodec-hw=dxva2"}; //Should enable GPU acceleration
private readonly Dispatcher _dispatcher;
private Boolean _isChangingPosition; //Prevents (sometimes) unwanted feedback
private Video3D _video;