Python is a dynamically and strongly typed programming language that encourages readability.
0
votes
1answer
44 views
Breakout angle calculation
I am making my first game in python and I am really stuck at with a physics problem. The game I am trying to make is a copy of the game Breakout. In Breakout, the player controls a "paddle" at the ...
1
vote
1answer
106 views
Pygame Collide Rect
Currently making a maze game. Maze is drawn, everything is drawn with pygame.draw.rect.
I have tried using pygame.coliderect() to check for colisions, but it isn't working. The current error message ...
0
votes
0answers
31 views
Zebra puzzle generator algorithm
I made an open source zebra puzzle generator, also known as an Einstein puzzle.
When I generate a table, I have to obfuscate (make obscure) it, and make some letters hidden with the good indication ...
1
vote
1answer
51 views
Pygame, how can I move a rect/sprite from point A to B smoothly?
As the title suggests, i want to move a rect/sprite from point A to point B in a smooth manner. What I mean more specifically is that the speed of the movement should change throughout the course. So ...
0
votes
1answer
37 views
Creating a 3rd Person Flying Camera for 3D asteroids game
In order to learn PyOpenGL and test out an engine I am developing, I am trying to write a 3D asteroids flying space shooter game. Currently, I am implementing the camera using a "look at" function ...
-1
votes
1answer
40 views
How to update everything but 1 thing in pygame and python
What I'm doing
So I'm developing a game for my Computer Science final with python & pygame. It's done other then I have to make a main menu. I've been developing it over the last 2 weeks because ...
0
votes
1answer
53 views
How do I create a maze without drawing each individual line or using sprites?
I am currently trying to create a maze game by following some online tutorials, and putting my own spin on them. I found a pretty good tutorial at pythonspot.com, but I am not sure what some of the ...
0
votes
1answer
48 views
glViewport() Win10 doesn't draw new parts
I've been steadily working through building a basic 2D tile framework in python.
I'm trying to use modern openGL so I have a simple shader and some vertex buffers and it's mostly doing what I want so ...
0
votes
1answer
59 views
Please help me find the error in a pygame code for Tetris?
I am creating a Tetris game using Pygame. However, instead of calling a single shape, but code calls all the functions for the shapes randomly one after the other. I tried called the NewShape at ...
0
votes
0answers
30 views
How would I use Await/Async to create a pygame network game
What I have Tried
Hello, I have tried to create a asynchronous network for a special game project I am making. I have tried using plain old sockets but what I discovered is that they would block each ...
1
vote
1answer
77 views
Getting draw/depth order right in OpenGL tile engine
UPDATED:
So I've continued hacking away at this and I've gotten a little further by modifying my shader:
fragment_shader = shaders.compileShader("""
uniform sampler2D u_image;
varying vec2 ...
0
votes
0answers
52 views
python 2d tileset rendering optimization
I've started testing a 2d isometric rpg I'm developing and find the frames per second to average 3.25 >. <
I'm currently rendering a 4 layer (ground, object, sprite, item) 128x128 tileset.
In the ...
1
vote
1answer
39 views
How should I implement a dialogue box in Pygame?
I'm working on a small RPG with Pygame, using Python 3.5.1. I've spent a week trying to find a decent tutorial or example for a dialogue box implementation that would pull dialogue from a source file (...
5
votes
1answer
95 views
pyOpenGL draw loop - slow with just 1500 items to draw
I've been trying to build myself a simple little game API using pyOpenGL (previously I tried using just Tkinter, but I keep hitting the same wall whatever I do!)
I rewrote everything using my very ...
1
vote
0answers
33 views
Collision for array of pathfinding zombies to array of blocks
Relevant Background Information
I'm an eleventh grade high school computer science student in Canada. I'm doing pretty well in the course currently, I have a 96 in the course currently. We're working ...
1
vote
1answer
67 views
Performance drawing in Pygame
Relevant background information
I'm developing a game for a high school computer science performance task in python & pygame. I'm using objects and all the code is working well for me.
The game ...
1
vote
2answers
80 views
Using sprites in pygame without classes and objects
Relevant information
I'm in a grade 11 computer science class that uses Python & Pygame. We're aloud to use sprites and images though we're never taught it, just drawing graphics like squares and ...
0
votes
1answer
30 views
How to rotate a surface in pygame, without changing its shape
I'm writing a class in pygame to create a sprite object, and I'd like to be able to rotate it. It works fine with an image, and rotates without issue. But when rotating a surface with a plain colour, ...
0
votes
0answers
25 views
Can I map uniform variables?
I'm literally just starting with GLSL, I'm using python and I actually can't run 330 (intel hd3000 on Debian) so I'm using 130, so far is ok.
I started using in first and didn't know about uniform ...
0
votes
0answers
74 views
Entities and Components of Battleship (Entity Component System)?
I started to interest myself for entity component systems. I wanted to start softly with creating Battleship in python using an entity component system. At the beginning, everything I was doing made ...
0
votes
1answer
38 views
pygame scrolling: target moves faster than the camera
I know many questions have already been asked on this same topic, but I can't figure out from those how to solve my problem (possibly due to a different approach to achieve the same goal: scrolling my ...
0
votes
1answer
35 views
Bounding box collision handling makes player glitch to the other side of the wall
The way I handle simple collision detection causes a really frequent and easy to reproduce glitch, which affects gameplay severely. Here's my code (Python 3.5):
def move(self, _map):
self.col = ...
4
votes
1answer
82 views
Programming with Python in a recent version of Minecraft
I've been teaching Python programming to a friend's son using the book Adventures in Minecraft. This book comes with a starter kit that contains a pre-configured Bukkit (v.1.6.4) server, and targets ...
0
votes
2answers
73 views
How can I make the player “look” to the mouse direction? (Pygame / 2D)
Here's my code:
import sys
import pygame
pygame.init()
screen_width = 640
screen_height = 480
screen = pygame.display.set_mode((screen_width, screen_height))
running = True
class Actor:
def ...
0
votes
1answer
53 views
How would I make my Python game Moddable?
before you mark it as duplicate, I want to say I have read this: I want to make a moddable game. How does this affect my programming language choice?
And it did not help me. Just for proof of concept,...
0
votes
1answer
120 views
How to display text for 3 seconds in pygame
I am trying to print "You Crashed" when car hits wall(or blocks) for 3 seconds and then again start game loop.
I tried using time.sleep(3) but it's not working.
def crash():
crash_font = ...
1
vote
2answers
51 views
Can't move rectangle constantly with key down
I can only move the rectangle every time I push a key down. How would I continuously move my shape when the key is down?
Here's my code:
for event in pygame.event.get():
if event.type == ...
1
vote
0answers
60 views
Batch z-ordering problem in Cocos2d (Python)
I have a weird problem with my hexmap drawing code.
My code uses "squished" hexagons to achieve a pseudo-isometric view. Because of that, the order of drawing them on screen matters a lot.
...
0
votes
0answers
20 views
Blit an image that follows another image in pygame
I'm trying reproduce the game "Snake" in pygame, using the pygame.blit function, instead of pygame.draw. My question is how to make an image follow another image. I mean, make the snake's body photo ...
0
votes
1answer
67 views
Python collision left works, but not right
I am continuing to work on collision detection. It appears for the most part, everything I have implemented is working. When the game starts, the character is on the left side of the screen (plus a ...
0
votes
1answer
40 views
Python collision problem
I have a hero character with jumping physics that I am trying to figure out the collision detection for. Right now, the problem that I am running into is as soon as the character hits the floor (while ...
1
vote
0answers
23 views
SGC toolkit for PyGame and resizeable windows
Can I create a resizeable main window if I use the SGC GUI toolkit for PyGame? If so, how?
0
votes
0answers
54 views
Cross-platform framework supporting gamepad and GUI building
I want to write a small cross-platform (Windows, Linux, Mac, maybe Android) program (on Python or C++, Python is preferred) that should use gamepads.
Which frameworks that are cross-platform, ...
0
votes
0answers
69 views
Use a pygame surface as an openGL texture?
I've been trying to get a 2D image to draw on an OpenGL surface, and I've run in to similar questions answered with "Create an OpenGL quadrilateral and give it the image as a texture" but I can't find ...
0
votes
2answers
73 views
How should I make a jump-timing game's character static on screen?
I decided to learn Pygame and try to make a simple game inspired by Google's T-rex jump game. However, I stumbled upon a problem that I can not seem to figure out: How can I implement a scroller/...
1
vote
1answer
97 views
Can OpenAL be used with Python?
I'm from a background of using OpenAL with other languages; and I'm on a project that benefits very much from Python. I remember PyAL, but it hasn't been updated since 2013 and my computer can't even ...
-1
votes
2answers
141 views
2d MMO world generation? [closed]
I am developing a MMO, and i'll describe it as a 2d mine craft (it's a lot more complicated than that). There will be a multitude of blocks that will be in a world. I need them to be randomly placed. ...
1
vote
0answers
52 views
How to initialize OpenGL context with PyGame instead of GLUT
I'm trying to start with OpenGL, using Python and PyGame.
I'm going to use PyGame instead of GLUT to do all the initializing, windows opening, input handling, etc.
However, my shaders are failing to ...
0
votes
0answers
33 views
Pygame Vertical movement of a comet
I try to make a platform game where comets will collide as the character,this comet must fall from a vertical angle
This is my code:
# coding=utf-8
import sys
import pygame
import random
pygame....
3
votes
1answer
202 views
How to make a moving background with PyGame?
I'd like to create a moving background in my Python game, with an image, that moves up until it reaches the end, then it goes back to its first position. I'm still in my learning process and this is ...
-1
votes
1answer
181 views
How to make a Infinite Verticle Scrolling Background in Pygame
Is there anyone who knows how to create an infinite verticle scrolling background in pygame?
Your help would be much appreciated, thanks in advance!
3
votes
2answers
96 views
Preparing a 2D character to export from Blender to Unity?
I'm an animator for a game currently, and I don't have Unity (can't download due to too much gigs coupled with slow internet,) but the game designer told me I can use Blender to export animations into ...
0
votes
2answers
197 views
How to set widget size that is independent of screen resolution/density in kivy
I had coded a simple click game with Python-kivy to android.
You should click dots which are popping out randomly at screen. I set their size 20px to 60px as your level. But it seems when I try on ...
2
votes
2answers
125 views
Pygame: Collision detection
i've been adding some extra stuff like Gravity and a table to a simple pong game made with Pygame and Python, the problem is that i dont know how to add collision detection, so when the ball hits the ...
-2
votes
3answers
2k views
A python script controlling a Unity game
I wish to build a simple game in Unity such that the objects in the game can be controlled via a Python script (or a code in any other programming language). Is this possible? If yes then how? If no ...
1
vote
0answers
280 views
Rendering thousands of circles in pyopengl
I am interested in rendering animated 2D vector graphics in python using PyOpenGL. As an initial test, I am trying to render thousands of pixel-perfect circles drawn using shaders. Here is the current ...
0
votes
0answers
34 views
How To Point An Object At Cursor? [duplicate]
I'm trying to make a Nuclear Throne like game in python 3 and pygame, but I got stuck at how to make the gun point at the cursor. If someone could show me how, that would be great. :D
I looked at the ...
-2
votes
1answer
41 views
How To Extract A File In A Relative Location With Python? [closed]
I'm trying to extract a file with python 3(for my game launcher), and this is the code I'm using:
import zipfile
f = open('filenamehere.zip', 'rb')
z = zipfile.ZipFile(f)
for name in z.namelist():
...
0
votes
4answers
156 views
PYGAME: When I release two directional keys together the player keep moving
I did the code this way to avoid the player to stop if a press two directional keys together making the movement more smooth. It works well but when I release two keys or more together the player keep ...
4
votes
2answers
185 views
Line Collision In Pygame?
I am working on a game(a platformer) that is physics and momentum based. I want to make it so that the player(a single dot) can bounce off of the lines with correct physics, but to do that, I need to ...