Tag Info

New answers tagged

1

Seeing as your music is meant to loop indefinitely you could just assume the music is still playing after having started it once, something along the lines of: need_music = true def musica(): if need_music: pygame.mixer.music.load( something ) pygame.mixer.music.play(-1) need_music = false From the look of your code your problem might be ...


1

It seems your player coordinates are in integers, in python integer division gives you a float as answer which explains why your player moves mostly in the right direction, but then when you store the new position you drop the decimal point so each frame your losing a bit more precision. You either need to store the target location instead of a vector so ...


0

Use pygame.key.set_repeat. It looks like this: delay = 100 interval = 50 pygame.key.set_repeat(delay, interval) Putting this the while loop should work. delay is the amount of milliseconds before continuing to do the key events. interval is how many seconds between each key event. So for example, putting delay at 100 and interval at 50 will do this: ...


0

I would prefer to make this as a comment, but I don't have the rep yet. While what you have isn't the easiest or most recommended way to go about that, it theoretically could work. You probably have a bug, my guess is that the cross product is trying to cross a line with itself on your more complicated shapes and returning a normal of length 0. Also, if ...


3

My question is -- do I have to establish faces/sides/etc in order for this to "just work", or is there a way to suss out which pairings should not be considered, without just excluding certain shapes from being rendered at all? Yes. The problem is that its completely ambiguous what a face even is in your formulation. Right now, you're implicitly ...



Top 50 recent answers are included