Skip to content

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?

1 points9 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Text
ID
mmzps2

Author

1
posts
0
comments
0
media
View profile

14 comments

unknown author4 hidden

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?

1 points
unknown author3 hidden

Deleted before we saved it.

2 points
unknown author2 hidden

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.

1 points
unknown author

Deleted before we saved it.

1 points
unknown author

Yep totally. Just you need to use a compatible multi platform compiler, Like Unity3D standalone compiler

1 points

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.

1 points

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.

0 points
unknown author1 hidden

Every OS compiles different types of code. Even the most explicit languages like C need a compatible compiler to run on a given OS.

2 points

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.

2 points
unknown author2 hidden

Deleted before we saved it.

1 points

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.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.