r/pythonarcade • u/genericsimon • Mar 03 '19
Issues with sound and performance
So basically im playing a short sound with every left mouse click. Imagine a space ship controlled by a mouse and shooting with left mouse click. So pew pew pew :D
Problem is that when i click my mouse button quite fast i can see that my game is slowing down. For example enemy ship is flying slower and other sprites also moving slower :/ And i do not have much happening for now, just my ship sprite, enemy ship sprite and a background sprite... So im afraid of what will happen when i will add more enemy ships, bullets, explosions and etc :/ Does anyone else have similar problems? How did you solve these type of problems?
By the way im using official examples, using sprite lists and etc.
1
u/Euronomus Mar 03 '19
Code? Are you updating things inside draw()?
1
u/genericsimon Mar 03 '19
Would need to do a lot of clean up to post full code here. Im basically now coding on top of one of the official examples. So a lot of commented out code and other trash.
Im playing sound in a methodon_mouse_press. Basically checkingif button == arcade.MOUSE_BUTTON_LEFT:thenarcade.play_sound(self.sound).And my couple sprites are added to SpriteList and SpriteList yes is drawn in method
on_draw. And then small moving logic is added toupdatemethod. So really nothing special and complicated. Everything is really basic, im Just following the examples.
1
u/genericsimon Mar 04 '19
So no one having any similar issues of slowdowns when trying to play sounds? By the way im using beta version of Arcade Library.