This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from random import uniform | |
from pyglet import clock, font, image, window | |
from pyglet.gl import * | |
class Entity(object): | |
def __init__(self, id, size, x, y, rot): | |
self.id = id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This doesn't really do anything outside of post a text label at the lower left hand corner of #the screen right now. | |
from pyglet import window | |
from pyglet import font | |
#We has a hundred Eych Peeez | |
hp = 100 | |
class GameWindow (window.Window): | |
def __init__(self, *args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Here's something by Mark Mruss demonstrating a basic Python game using Pyglet. I figure this | |
# might be a good place to start as a reference, since there's already a main loop and several | |
# classes set up. Quick warning: need to provide images for the program to work properly. | |
# If something other than that doesn't work, or doesn't make sense, let me know. | |
# PyGletSpace - An Example game using PyGlet | |
# Copyright (C) 2007 Mark Mruss <[email protected]> | |
# http://www.learningpython.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
"""Here's the test harness. | |
@TODO: Figure out collision events for jumps, etc. | |
""" | |
try: | |
import os | |
import sys | |
import math | |
import random | |
import pymunk |