can I write a game for windows on a computer running Linux?
This is probably a stupid question and I apologize if it's already been asked before, but can I write the code for a Windows game on a pc running Linux?
About this post
- Posted
- Archived
- Score
- 1 · 100% up
- Kind
- Text
- ID
- mmzps2
14 comments
Please correct me if Im wrong because I also want to know about this. I think you should separate a part (module) that is only responsible to receive and send messages to the OS from the actual application that you want to make. Then when you want it to work for windows, replace only this OS module with some other equivalent module that you should write that works for windows. In theory it should work.
My question is: is this cross plataforming? Basically putting an if else, something, in the code so it runs the proper module based on what OS its been running on without any user interaction?
Deleted before we saved it.
Oh my! I see what you did there, so my last idea does not work, unless you do some witchcraft. I think this witchcraft its actually what makes a program cross-platform.
Deleted before we saved it.
Yep totally. Just you need to use a compatible multi platform compiler, Like Unity3D standalone compiler
Game code and game packaging are separated in UE4, Unity, Godot, Cocos.
Can code a game on Linux and build Android, Windows packages (or how they call it).
But hardly possible to test windows game on a Linux emulator, need proper Windows PC.
Yes, though you'd have to test your built executable on windows of course. Code is code, it doesn't care what OS it was written on.
Every OS compiles different types of code. Even the most explicit languages like C need a compatible compiler to run on a given OS.
Yes, you're correct and I agree with you.
My point is that if you wrote a game in c++, c#, python, javascript etc, that code Is the same whether you write it on Linux or windows. Yes it will have to be compiled to your target OS. As I understood OP's question, they weren't asking whether they could run the same compiled game on Linux and windows, they were asking whether they could make a game on Linux but play that game on windows. The answer is of course yes, though the details of how this would be accomplished can vary depending upon how they're making their game.
Deleted before we saved it.
I'm not really sure what you're trying to say here but you can literally download Unity for Linux and build your game to a windows executable. It is 100% possible.