Do people share their codes from games openly here? i would like 2 read them all 2 improve my skills!
Is that a serious question?
What use is the source code to a normal user? They do not have the knowledge, nor the tools to create the game from the source code. And even if they have some of it, chances are the game might not work, because of slight oversights or technicalities.
Users are here for the game, not the source code.
And this is not even considering that some developers might not want to share their code.
It is also kinda the name giver for open source. Everything not open source could be called closed source. And you do not share code from closed source in general. So it is unusual to see source code outside of open source projects.
Well, my answer was of course just my take on why source code is not typically released. It makes no sense for a typical user computer. The necessary development tools to compile the code are missing.
It is a bit different on Linux. There you could have dependencies and all and a makefile to actually distribute your game as source code. And there were times when this actually made a lot of sense, since there are different architectures and such, so you would have had to compile for each target architecture - or just distribute the source code.
It also depends on the type of source code you are interested in. Unless you code your basic stuff yourself, you will probably use an engine or another.
In response to your reply to the other commenter, I think it's unusual to share source code ( anywhere in tech, not just here ), for two reasons:
1. Exporting all that code would be difficult
2.Some people spend years learning their craft, and how to program functions, they might not see it as fair to give it away for free.
3. Beginner programmers ( especially self-taught ones ), probably don't have to best code to begin with.
If you want to learn to code, I recommend purchasing a book that will teach you your game engine, and/or watch some YouTube tutorials.
Follow Me , please btw. Trying to build a following! :)
I can't vouch for if it actually works or not, but apparently there are some "decompilers" that exist. Depending on what engine you used to make the game initially, it might exist.
I came across a decompiler that takes the Exe from GameMaker 8.1 files and can apparently decompile that Exe back into a GM8.1 file or something like that.
No idea if they work, no idea if you should trust them (I have not used anything like that), I would run it in a sandbox environment or a hardened VM if you really wanted to try something like that.
Decompilers usually output massively unreadable code that needs a lot of decyphering and manual cleanup in order to be workable again.
Then again, some game engines do not even compile the game code to begin with.
We'd need more detail on how the game was made to give helpful answers - although I am reluctant to help here because tomas1235 does not have games on his account so I am immediately suspicious if he actually wants to recover his own game or steal / rip off someone else's.