Yes, it is absolutely possible to code your own game. As a beginner, it will be easier to start with something simple like on R-o-b-l-o-x; instead of trying to write a full PC game. It runs Lua and its code is run as scripts which means you can put it anywhere.