CorpHackRyan / RP-Spaceoids

Spaceoids - asteroids game clone game. A project idea created with the intent of learning to work collaboratively on the same code base, learn and implement features of GitHub such as discussions, issues and actions, and most importantly improve problem solving and code implementation. The bulk of this code was created by Patrick Pragman (https://www.pragman.io/)
0 stars 2 forks source link

Control Loop for "Player Objects" #9

Open patpragman opened 3 years ago

patpragman commented 3 years ago

The player objects are hard coded to keyboard inputs. In single player this is fine, but in multiplayer this will result in problems. Pressing a key in single player or multiplayer should simply change a state rather than use hard coded key inputs to activate some code.

patpragman commented 3 years ago

I tinkered with this some this morning. Abstracting the controls out away from the basic pygame stuff introduces quite a bit of lag. I suspect that something in the pygame bindings is asynchronous. We may be stuck with hard coded key inputs then having a totally different way to process commands sent through the network. @CorpHackRyan, what say ye?

My instinct here is that to get something going the best solution may just be to grind out some horrifyingly verbose logic table and be done with it, as abstracting made the code less readable and slower and glitchy...

I rolled back my commits in my branch, but yeah. What do you think?