Skip to content

Instantly share code, notes, and snippets.

View spinningD20's full-sized avatar

spinningD20 spinningD20

View GitHub Profile
class Main extends luxe.Game {
override function config(config:luxe.GameConfig) {
config.preload = PreloadAssets.parcel;
return config;
}
@spinningD20
spinningD20 / menu_launcher.py
Created April 17, 2017 12:45 — forked from abishur/menu_launcher.py
A simple menu system using python for the Terminal (Framebufer)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Topmenu and the submenus are based of the example found at this location http://blog.skeltonnetworks.com/2010/03/python-curses-custom-menu/
# The rest of the work was done by Matthew Bennett and he requests you keep these two mentions when you reuse the code :-)
# Basic code refactoring by Andrew Scheller
from time import sleep
import curses, os #curses is the interface for capturing key presses on the menu, os launches the files
screen = curses.initscr() #initializes a new window for capturing key presses
curses.noecho() # Disables automatic echoing of key presses (prevents program from input each key twice)
@spinningD20
spinningD20 / AssetPaths.hx
Created April 16, 2017 01:00 — forked from kevinresol/AssetPaths.hx
Macro to read asset paths
package util;
/**
* ...
* @author Kevin
*/
@:build(util.AssetPathsMacro.build())
class AssetPaths
{
@spinningD20
spinningD20 / main.py
Created February 14, 2017 01:18
this is the example 14_tmx_loader modified to try to unload the loaded map and then loading another map (same file).
from kivy.app import App
from kivy.core.window import Window
from kivy.clock import Clock
from kivy.uix.widget import Widget
from kivy.properties import StringProperty
from kivent_core.systems.gamesystem import GameSystem
from kivent_core.managers.resource_managers import texture_manager
from os.path import dirname, join, abspath
from kivent_maps import map_utils
from kivent_maps.map_system import MapSystem
@spinningD20
spinningD20 / main.py
Created January 22, 2017 14:19
tilemap seams with camera movement and scaling
from collections import defaultdict
import tmx
from cymunk.cymunk import Vec2d
from kivent_maps.map_utils import _load_obj_models, _load_tile_map, _load_tile_properties, parse_tmx
from kivent_maps.map_utils import _load_tilesets
from kivy.app import App, platform
from kivy.core.window import Window, Keyboard
from kivy.clock import Clock
from kivy.uix.widget import Widget
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="isometric" renderorder="right-down" width="10" height="12" tilewidth="128" tileheight="64" nextobjectid="1">
<tileset firstgid="1" name="basic_ground_tiles" tilewidth="128" tileheight="128" tilecount="56" columns="8">
<image source="basic_ground_tiles.png" width="1024" height="896"/>
</tileset>
<tileset firstgid="57" name="basic_ground_tiles" tilewidth="128" tileheight="128" tilecount="56" columns="8">
<image source="basic_ground_tiles.png" width="1024" height="896"/>
</tileset>
<layer name="Tile Layer 1" width="10" height="12">
<data>
@spinningD20
spinningD20 / main.py
Last active January 20, 2017 03:49
camera_scale throws off convert_from_screen_to_world results
from collections import defaultdict
import tmx
from cymunk.cymunk import Vec2d
from kivent_maps.map_utils import _load_obj_models, _load_tile_map, _load_tile_properties
from kivent_maps.map_utils import _load_tilesets
from kivy.app import App, platform
from kivy.core.window import Window, Keyboard
from kivy.clock import Clock
from kivy.uix.widget import Widget
@spinningD20
spinningD20 / iterlete.py
Created November 14, 2016 03:08
needed something quick to go through a media collection, search on youtube if I didn't know what it was, and give the option to skip the file or delete it.
import fnmatch
import os, sys
#import pyperclip # for clipboard usage
import webbrowser
for file in os.listdir('.'):
if fnmatch.fnmatch(file, '*'+sys.argv[1]+'*'):
print "File: " + file
choice = raw_input("Delete? Y/N/L")
if choice.upper() == 'L':
#!/usr/bin/env python
from pyzmo import *
from evdev.ecodes import *
from evdev import InputDevice
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 8000
import serial
@spinningD20
spinningD20 / main.py
Created May 19, 2016 17:05
custom event binding order issue
#!/usr/bin/python3
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
class AfterSuperButton(Button):
def __init__(self, **kwargs):