Programming Challenge: Make a game in 1 hour!
Background
There's been some talk on ~ before, and it seems like there are quite a few people who are either interested in, learning, or working in game development, so I thought this could be a fun programming challenge.
This one is fairly open-ended: make a game in 1 hour. Any game, any engine, don't worry about art or sound or anything.
Doing is the best way to learn. Most people's first project is something overly ambitious, and when they find that it's more difficult than they thought, they can get discouraged, or even give up entirely. This is why the 1 hour limit is important: it forces you to finish something, even if it's small. When you're done, you can come out of it saying you made a game, and you learned from it.
Chances are the game might not be fun, look bad, be buggy, etc. But don't worry about that, everyone's game will have problems, and if you do create something really fun or innovative, congratulations, you have a prototype that you can expand on later!
"Rules"
Like I said before, these "rules" are pretty simple: make a game in (approximately) 1 hour. You can use any tools you want. If you use external assets (art, sound), it's probably best you use something you have the rights to (see resources). If you're completely new to game development/programming, your goal could even be to finish a tutorial.
If you're the kind of person who tends to get carried away with these things, you might want to post a comment saying you're starting, then another one once you've finished your game.
Please share your finished game, I'm sure everyone would love to try them! If your game is web-based, it can be hosted for free on Github Pages or Itch.io. If downloadable, it can be hosted for free on Google Drive, Mega, Dropbox, Itch.io, etc.
Resources
Engines
If you're a beginner, a good engine to start with is LÖVE. It's very simple, and uses Lua, which is very easy to learn.
If you're familiar with another language, you could use a library to make it in that language. Some examples:
Javascript: kontra, Phaser, pixi.js
Python: pygame
If you want something more complex, consider Godot, Unity, or Unreal.
You can also try something visual like Construct, Clickteam Fusion, or GDevelop
Art
For such a short time constraint, I'd suggest you use your own "programmer art": just use some basic shapes. Your primary focus should be gameplay.
If you think you have time to find something, try looking on OpenGameArt.
Sound
You can make simple sound effects very quickly with sfxr (or in this case, a web port of sfxr called jsfxr).
Having to learn the language would be a real barrier to making a game in just one hour....
Very good point, that was aimed more at programmers who are beginner game developers.
For non-programmers, one of the visual engines (Construct, Clickteam Fusion, GDevelop) are what I would recommend.
This came at a really bad time but I figured staying up for an extra hour wouldn't do much harm.
It's playable in the browser here on itch.io with source available. Depending on your cookie settings the game may not load (seems to be an issue with itch.io) so I uploaded a download for the HTML build as well if you want to run it locally.
You won't be able to play it on a mobile device due to control scheme stuffs.
I had an issue with this bug using the latest godot build https://github.com/godotengine/godot/issues/21072 which I found out after my hour was up, so I spent some time figuring out what was wrong, reverting to 3.0 stable, and fixing the project.godot config version (just change it from 4 to 3) so that I could export it
I like it, it's feels like the beginning of a bullet hell game. Adding the score, health and difficulty makes it pretty fun to keep playing and trying to get a higher score :)
Just wondering, what exactly does difficulty do? I assume it increases enemy speed?
It's very rough, first time I ever made anything in an hour. It's quite liberating really, it gives you very little excuse to put it off.
Difficulty affects how quickly enemies spawn. At 100% it's random between 2 and 3 enemies per second I think, at 200% it would spawn between 4 and 6 enemies per second. Every 60 seconds you survive is 100% more difficulty.
You get 1 score per second and 10 score per enemy killed. My best was about 2k score at 240% difficulty by abusing the left/right warps to keep bullets circling as a shield above me.
Okay, let's do this.
Although I'm not the most experienced with p5.js, it's going to be my choice with such a short time frame.
I don't know whether to include initial thinking time within the hour, but I guess I'll decide that at the 59 minute mark.
Here it is: https://thimbleprojects.org/mallard/535395/
Instructions:
So that was a little intense. I'm really proud of it. Game design is flawed because a chain of even numbers is likely to be rather large - I'd have liked to have solved this before submitting, as well as the weird score text bug, but the time was up. I also wanted to add 'gravity' when tiles are deleted, but that quickly got cut due to time.
Took me a bit longer than expected to get setup (and I've been doing a lot of python recently so that kept creeping in), but once I was off I had good pace. I thought checking for valid chains would be rather 'heavy' to do, but it turned to be pretty simple, and I'm really happy with the implementation. (Just noticed that the logic for the chains is flawed too. Oh dear.)
Thanks for the challenge.
Gulp. Got to upload it to...somewhere.
I have to admit a bit of ignorance here. What are squares? Numbers that are the square of another number, I assume? Because I had some in my puzzle, but not enough to make a chain.
Seems like it could make a neat little mobile time-waster with a few tweaks. Why no "odds"?
Thanks for checking it out.
Squares are the square numbers: 1, 4, 9, 16 and 25.
No odds because I feel that would be too straight-forward. The primes cover a good portion of the odds and requires a touch more brain power.
Tweaks I would have liked to have is gravity, and/or pre-made levels that are completely solvable, instead of random values.
Yeah, that's what I thought. Played a few more times after that comment and found some "square" chains.
Gravity, as in the tiles slide down as you remove chains? That could lead to interesting strategies. You seriously might be on to something here. Solvable levels would become more difficult with gravity, but as long as there's one solution, it's solvable. This would (possibly) do well as a mobile game with those tweaks.
I've been trying to get more familiar with Rust, this looks like a great example to read!
That's why this is such a good challenge - you don't have time for extensive planning and organization. Your only goal is to finish something in an hour, with your sole priority being gameplay. The code will likely be ugly, buggy, and incomplete. If you want to expand on what you made later, by all means clean up your code, plan it out better, etc. But if you take a long time to plan and organize, it'll be more difficult to get started, and therefor easier to put off. By giving yourself a fairly extreme limit, you're forcing yourself to complete something.
You can think up any ideas before you start your one hour session. I went in to it at 3 am with no plans, just knew I wanted to shoot something and there should be no end. You just need to constrain your expectations and realise that in 1 hour you will have finished something that probably isn't even fun to play and that you will never look at again.
1 hour just isn't a lot of time, but the more familiar are with your tools and the more you get used to this super quick prototype development the more you can get done in that hour and the more creative you can be during that time.
That's where the challenge was for me.
I usually program in a notebook. I write out, rewrite and rewrite, and only once happy with structure and API do I begin to implement it with a machine.
With only 1 hour... You don't have time to care if it's a reprehensible mess of structure. It's write and run and hope it works.
If a potential employer saw my code in this thread, I'd be embarrassed. It's not good code. But it does work, and it did take an hour.
If you're already familiar with a framework (LOVE, Unity, etc.) then some of the organization is already decided for you so you can save a lot of start up time.
I tend to get carried away. But, I'm on a train with only a cheap phone, and only busybox (and vi) available...
So this is my intent: a simple text based game written in shell.
Start the stopwatch.
My hands are screwing up. I'll have to continue later. But, for my first 15mins:
This is great :-)
Haha reading it took me back to my high-school days writing ti-83 programs for people. The more slee.. err.., 'loading' you put in the more super-complex-computations were taking place.
Final version!
Video Demo.
Time taken: 15min on a tiny phone in termux with vi. 30min with voice control on a laptop (And no matter what the creator thinks, FreeSpeech is nowhere near as good as Dragon).
Edit: bugfix. New video demo with asciinema.
It's a tiny silly game, but fun for about 30s.
Nice, this is actually a pretty cool concept! I imagine it would work well as one of those little infinite mobile games where you see how far you can get.
Add graphics, upgrades, and more responses, and you might be able to get some people to sink some time into it.
Cool. Do you have any suggestions for text-based games?
Most of what these libraries handle is the asynchronous behavior of a GUI program, abstracting over controls and graphics APIs, and maybe providing you with some pre-written physics code. None of that is necessary in a text-base game. You should be able to write a text-based CLI game using nothing but a programming language's standard library.
Assuming you mean suggestions for engines, Twine is very popular and easy-to-use.
Ren'py is another popular one, it uses Python, although it’s more visual novel-oriented.
It's been a while since I've seriously been into IF, but I think TADS has a pretty good engine. I don't know if there's anything newer.
If you're not looking for things to be happening when the player is idle, then any language will do.
On Windows, you have ol' batch, and Powershell available without installing anything.
On MacOS, you probably have outdated Python 2, AppleScript, ol' shell (what I used), and a slight improvement on shell called Bash available without installing anything.
On Linux you have shell, probably Bash, probably a Python (2 or 3, depending on the distribution), and maybe some harder languages too. (Like Awk. You could use it, but that would require an understanding most people don't have.)
A bunch of languages can be installed on any of those, so that your game will run on all of them. Powershell and Python are examples of that, and simple languages.
The basic idea is, give some output, and then ask the player to respond, and then act on it.
Examples
Windows Batch:
Copy the below into a text file, and rename the extension to
.bat
Now, I haven't covered flow control, how you jump to different places in the program, because it is... Painful. But easy to discover.
Powershell
Copy the below into a text file, and rename the extension to
.ps
There are plenty of resources to help learning Powershell, but the above is a nice little taste.
Python:
Though there are major differences between Python 2 & 3, this should run in both. (Well, only Python 2.7 and above, but that seems good enough for this example.)
For shell, look to my 1hr game.
I knew about Twine, but AFAIK I have to use Javascript to extend it, and I have no interest in this language. I didn't know about Ren'Py, but it looks like a great platform, and I really like Python. Thanks!
how do i get LÖVE? I added the repo and did sudo apt-get update but I'm not seeing it in my list
It should just be:
thank you!
Running should then be
love FOLDER
So if you're in the folder:
love .
Or if you're not, it might look like:
love /home/me/games/livegame
You could also zip the folder, rename to .love instead of .zip, and then double-clicking will run the game.
thanks!