Programming Game


  • Posts: 275
Lately I have been drawn to programming type games, specifically hacking games (like hacknet).  Most likely due to the fact I'm learning different programming languages in college right now, so being able to learn a programming language while also playing a game is great.

Therefore I thought I would make my own version, mostly just playing around with some mechanics right now but I think I'm leaning towards a puzzle like game.  So far the coding most closely relates to structures in C.

So how the game would work is that there are blocks that you must move, in order to reach a specified tile.  Sounds simple, however all blocks move when you type a command, so it becomes more tricky when there are multiple blocks on the screen.  You will need to spawn the blocks at certain times in order to have the blocks land on all specified tiles simultaneously.  As well as using some things like "firewalls" to prevent movement, and other things to make the puzzle that much more challenging.

Attached is a video just showing the mechanics/typing the code to move and spawn blocks.


  • *
  • Posts: 2278
Interesting. I could see this being something big if you can combine puzzle design with coding education.


  • Posts: 78
This is a great concept i really dig it. Teaching people programming through a game is awesome i think many people will enjoy the concept. i myself would love to play it as a novice programmer. I look forward to seeing the progress you make


  • Posts: 275
So it's now in a playable state, you must try to cover all the red tiles with your green tiles.  The gray tile signifies the spawn location.

I wanted to give the player the option to name the "object" (player) so that they can customize it how they want, as well as being able to decrease the amount of typing needed for each action.

For example: to change the X position normally you would have to type "player.x=player.x+____;"
                              however you could change the player name to be "box" meaning you would now need to type
                              "box.x=box.x+____;" to change the X position.

To do this you would have to change the name of the object by typing:       player="box"; (or whatever you want to name it in the quotations)

I realized that it was impossible to cover all the tiles in certain situations therefore I added the option to change the spawn location.          setspawn(player.x,player.y);

Then to spawn new players you would use:        spawn.newplayer();

Just remember when you have more than one player they will all move together with the commands (you cannot move each one individually).  The bottom right indicates the coordinates where your mouse is, so that you don't have to count how many blocks are inbetween the tiles.  I'm debating whether to add the shortcut features that you can use in programs such as (++ and --) to quickly increment values as well as the (+= and -=).

Last little note, once you change the name of the "player" you would now substitute your new name into all functions:


  • Posts: 275
I've added the shortcuts to make testing easier (++, --, +=, -=).  Currently I'm adding a firewall, basically its a wall around the red tiles that will kill players on contact.  My idea is to "hack" the firewall to break it in order to allow access to the red tile location.

Right now I'm leaning towards a "hacking system" that requires basic algebra skills or syntax checking (making sure the code doesn't have any violations).  For example:

Algebra - ((X+2)^2-4)=12            ANS: X=2;   (Still checks to see if the player remembers to add the semicolon
                                                                                                and also brushes up on their math skills, which programmers
                                                                                                use frequently)
Syntax- PLAYER+=12;                   ANS: FALSE/ERROR  (This does not signify what variable the object is changing
                                                                                                                      by 12, player is an object/structure.  The ".x" or ".y"
                                                                                                                       signifies a variable)

Obviously this is just scratching the surface and a tutorial is needed for the player to have any idea how it works, but this actually would bring in more education in math and programming syntax.

Also if anyone could explain to me how to include GIFs on here that would be great, or how to change a video file to a GIF.

« Last Edit: December 13, 2016, 10:59:32 pm by xplosion28 »