Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to play games in ScottFree-like split-screen mode #30

Open
MikeTaylor opened this issue Oct 27, 2017 · 3 comments
Open

Provide a way to play games in ScottFree-like split-screen mode #30

MikeTaylor opened this issue Oct 27, 2017 · 3 comments

Comments

@MikeTaylor
Copy link
Owner

Either using the broken-apart play method that @drewish created in PR #16, or by introducing the notion of a driver which provides input and output methods for some specific device.

@drewish
Copy link
Contributor

drewish commented Oct 29, 2017

I think one thing that would be worth examining as part of this is separating out the play functionality into its own object. Right now it’s nice having it in its file but since it’s mixed into the game class it doesn’t have a clear boundary between the two pieces of functionality. I got tripped up by this trying to extract some of the input output because the compiling and decompiling are all sharing the same object with the play methods.

My gut instinct would be to get a data structure for the game, and one for the save state, then have functions that return modified copies of those structures. But that idea exists on a continuum so we could have more of an object oriented approach.

@drewish
Copy link
Contributor

drewish commented Nov 2, 2017

If you do go down the driver route I think you'd want to make a sleep method part of that interface. It would give a the driver a clear spot to flush any output before sleeping.

@MikeTaylor
Copy link
Owner Author

Good idea on the sleep method.

I am less attracted to the idea of a Play object. I'm not seeing that it brings us much, and it materially increases the complexity of the code. The Game object represents a game (duh), and play seems a perfectly reasonable method on it.

More generally, I am more inclined to invest time in fixing bugs and adding functionality than in restructuring already-existing working code. Of course, when we need to do the latter in order to achieve the former, that's great -- as with your separating play out into sub-methods that it calls. But restructuring for its own sake is not exciting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants