Christian2147/Laser-Fighter

Support for computers running Linux

開放

#4 建立於 2024年7月22日

 (4 則留言) (0 個反應) (0 位負責人)Python (0 個分叉)auto 404
featuregood first issue

倉庫指標

星標
 (3 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I can see in the README that there are plans to port the game to Linux. That's awesome! I'm opening this issue to highlight the things that need to be done to port the game.

Laser Fighter currently makes some system calls to the Windows API. The head culprit is ScreenSetup.py which manages screen initialization. This file imports win32api and win32con to achieve this. While this approach works on Windows, it means other operating systems cannot run this game natively. This is the main reason the game will not run outside of a Windows environment. A possible solution is to use a more OS-agnostic approach to these windowing functions, like getting the monitor dimensions. I'm not aware of anything of this nature for Python at the moment, I'd have to look more into this.

Another thing to notice is this game also imports the font "Courier" from the system, which is not commonly found on OSes other than Windows. This can result in fallback to some really awful-looking default system font. We can see this in effect when running the game in WINE on Linux, which does not have the Courier font installed by default. A solution is to just include the font file with the game, but it's possible that the Courier font has a proprietary license, causing trouble with redistribution.

Aside from these two points, there shouldn't be much else that needs to be changed to port the game. I'd be interested in opening a pull request to work on this.

貢獻者指南