Skip to content

Instantly share code, notes, and snippets.

@demodude4u
demodude4u / GamePrototypeTemplate.java
Last active February 9, 2018 18:54
Bare bones game prototype essentials to make a simple test game in Java2D
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferStrategy;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;
import javax.swing.JFrame;
public class Java2DGameTemplate {
public static void main(String[] args) throws InterruptedException {
import java.awt.Point;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import praw
from psaw import PushshiftAPI
import re
reddit = praw.Reddit(client_id="CLIENT_ID",client_secret="CLIENT_SECRET",user_agent="USER_AGENT",username="USERNAME",password="PASSWORD")
api = PushshiftAPI(reddit)
for comment in api.search_comments(author="BlueprintBot"):
for line in comment.body.splitlines():
if "bundly.io" in line:
from sys import path as syspath
syspath.insert(0, '/Games/RocketCup')
import time
import math
import thumbyGrayscale as thumby
#import thumby
import thumbyAudio
import random
from thumbySaves import saveData
@demodude4u
demodude4u / SimpleLink.py
Created March 1, 2023 16:44
SimpleLink - Thumby Library to quickly setup link cable and swap byte values every frame for button inputs, etc.
from sys import path as syspath # NOQA
syspath.insert(0, '/Games/FileExplore') # NOQA
from time import sleep_ms
from os import ilistdir
from thumbyGraphics import display
from thumbyButton import buttonA, buttonB, buttonU, buttonD, buttonL, buttonR
MASK_U = 0x1