Menu
  • HOME
  • TAGS

Python Game Libraries

python,pygame,pyglet,cocos2d-python

After working with Pygame, Cocos2d, and Pyglet to create a series of games, I would have to recommend Pyglet. Cocos2d and Pygame were very unwieldy. On the other hand, pyglet has a very neat API, enjoyable to work with, and very 'clean'. It also has no external dependencies, and is...

Why is my Pyglet draw event handler not drawing? (The secret of on_resize)

python,debugging,pyglet

Well, I didn't figure out how to get more debugging info out of pyglet, but I did figure out why I was getting nothing from my draw code. This is not thoroughly flagged n the documentation, but unlike your on_draw event handler, after you handle the on_resize event you have...

Need help Converting a pixel, into a OpenGL coordanite

python,opengl,3d,pyglet

The information you provided is not enough to really help you and to be honest most people can't be bothered engaging in a conversation trying to figure out what you're looking for either. However, I'm assuming you're looking for vertex_lists. If not, you're probably looking for pure GL functions which...

Pyglet: 'str' object has no attribute 'audio_format' (python)

python,multithreading,audio,pyglet

This should work: player.queue(src) ...

Installing Pyglet in mac

python,osx,python-2.7,pyglet,pyobjc

I don't understand the point of your pyobjc install ? The issue with Pyglet on osX is 64-bit architecture, so just try this to force python to go 32bit by typing this in your console: defaults write com.apple.versioner.python Prefer-32-Bit -bool yes ...

How to make a sprite jump in Pyglet?

python,pyglet

Try to create gravity on your code. First, create a class for your Mario. Set up their positions and speed. Put up method jump on your Mario. #put this in your init self.time = 0 #put this in your condition if keymap[pyglet.window.key.RIGHT]: self.mario.time = time.time() self.mario.jump() def jump(self): print time.time()-self.time...

Pyglet unstable frame rate

python,opengl,animation,pyglet

I'd use something like this instead: import pyglet from pyglet.gl import * from collections import OrderedDict from time import time from os.path import abspath class GUI(pyglet.window.Window): def __init__(self): super(GUI, self).__init__(640,340, caption='Test') pyglet.gl.glClearColor(1, 1, 1, 1) self.alive = True self.batches = OrderedDict() self.batches['apples'] = pyglet.graphics.Batch() self.framerate = 0, time() self.count =...

AVBin in cxfreeze

python,executable,cx-freeze,pyglet

Since this was my first time on Stack Exchange, I couldn't really describe the question as good as it should be. But, I researched for a few hours, and got it working! I had to upload the Pyglet library with the executable the cx_Freeze made, and also include the AVBin...

Pyglet running multiple windows

python,unit-testing,pyglet

import pyglet class Test(object): def setUp(self): self.window = pyglet.window.Window() def tearDown(self): self.window.close() del self.window def wtf(self): self.setUp() self.tearDown() self.setUp() pyglet.app.run() test = Test() test.wtf() You can also use set_visible in order to hide it as a temporary thing if you want to show it later....

Cocos2d and Pyglet installation non-functional

python,pyglet,cocos2d-python

You are using Python 3, but attempting to use Python 2's print statement. In Python 3 the print statement was changed to a print function. Try: print('[%d] %s%s %s' % (thread, indent, name, location)) You can also use a newer way to format strings in Python 3: print('{:0d} {}{} {}'.format(thread,...

Incorrectly drawn octagon (random) - NEW TEST ADDED

python,opengl,graphics,polygon,pyglet

Your index list is incorrect: i = list(chain.from_iterable( (0, x+1, x+2) for x in range(8) ) ) [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 6, 7, 0, 7, 8, 0, 8, 9, 0, 1, 8] Should be range(7)....

Key polling with cocos2d-python and pyglet

python,sprite,pyglet,cocos2d-python

From pyglet guide: The Window.on_key_press and Window.on_key_release events are fired when any key on the keyboard is pressed or released, respectively. These events are not affected by "key repeat" -- once a key is pressed there are no more events for that key until it is released. This means that...

Add a python flag cx_freeze to executable

python,optimization,distribution,cx-freeze,pyglet

You can use the same -O flag when you run cx_freeze to generate your final build, meaning that the cx_freeze generated bytecode will already be optimized. From the cxfreeze docs: cxfreeze hello.py --target-dir dist Further customization can be done using the following options: ... -O optimize generated bytecode as per...

Drawing a circle with a triangle fan

python,opengl,geometry,trigonometry,pyglet

You need to change the degree to radian... (Degree/180)*pi is what you need

OpenGL (pyglet) issue with glTexImage2D (striped texture)

python,opengl,fragment-shader,vertex-shader,pyglet

That striping you are experiencing is due to incorrectly sizing the data in your pix array. GL_LUMINANCE is a single component image format and the size of your component here is 1-byte (GL_UNSIGNED_BYTE in glTexImage2D (...)). You are effectively only giving color to one out of every 4 of your...