Making a game in only 10 lines of code [Challenge]

Hey everyone!

I recently stumbled across a challenge going around online where people made a game with only 10 lines of code. I decided to try my hand at it to see what was possible with Defold.

For the game I ended up remaking (and greatly simplifying) my entry for the Yandex x Defold game jam that happened last November. I was able to recycle all of the art which greatly helped to save time.

I also made a video documenting my process. I originally planned for it to be a much longer video but decided to try my hand at creating a Youtube short (60 second time limit and vertical display). I’m not sure if I’m a fan of it or not. Let me know what you think!

(The short link is having trouble displaying on my end, here’s a different link to the video: Making a Video Game in Only 10 Lines of Code (Challenge) #shorts - YouTube)

One of the more tricky parts of the challenge was determining how to define a line of code. Lua doesn’t have endline syntax so I had to get creative. Here’s what I came up with:

  1. All lines must be coded as a line, no normal coding then collapsing into one line
  2. The build in function headers and enders don’t count as ‘lines of code’
  3. Changing settings within game.project doesn’t count as a line of code
  4. Engine code like the render script doesn’t count, only the code written for the challenge counts
  5. Loops, If Statements, etc can exist together on one line and be nested
  6. To separate statements cannot exist on the same line unless it is within a loop or if / elseif statement

Let me know if you end up trying something like this!

9 Likes