Skip to content

Instantly share code, notes, and snippets.

View VeggieVampire's full-sized avatar

Nick Farrow VeggieVampire

  • n-i-c-k.com
  • The edge of space
View GitHub Profile
@VeggieVampire
VeggieVampire / Makefile
Last active July 9, 2018 07:54
Basic Perfect Makefile for compiling target .cpp files using g++.
Basic Perfect Makefile for compiling target .cpp files with SDL2 libraries using g++.
#USEAGE: copy Makefile to folder with .cpp files then type "make"
#OBJS specifies which files to compile as part of the project
OBJS = $(wildcard *.cpp)
#CC specifies which compiler we're using
CC = g++
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
@VeggieVampire
VeggieVampire / game.py
Last active June 13, 2018 07:33
just something I have been playing with in python3. Note add your own images and only setup for a gamepad. Also I only tested on a Pi3 (non windows)
import pygame,sys,glob
pygame.init()
#from pygame import *
try:
j = pygame.joystick.Joystick(0) # create a joystick instance
j.init() # init instance
print ("Enabled joystick: {0} with {1} buttons".format( j.get_name(),j.get_numbuttons()))