I made this game in others languages first, languages that I already knew well and was confortable with.
I found Raylib which is a nice C library which to my suprise has bindings to a lot of languages. So I proposed to myself a silly challenge: pick up a language I never used before and create something playable in the least amount of time.
The game: Word Search Shooter
Nim binding used: Raylib Forever
This took me 4 days. It was a really fun experience! From the gif you can see a little about the gameplay. You have to kill the enemy by clicking on the letters and forming the words of the list, if you misspell the word or if the timer gets to zero you get hurt, and of course if your HP gets to zero you lose.
The raylib binaries are included so if I'm not mistaken, you should be able to play on windows with nim main.nim
I started with Nim because it was the most interesting language. Also because the amazing Nim binding supports raygui, so I didn't have to make my own button (it wouldn't be very hard to implement but... I'm lazy :P) and the syntax, which is similar to python, a language I already know.
If you already know all the important concepts about programming (loops, conditionals, functions...) all you have to do is to get familiar with the syntax and that's pretty much it. That also includes the language's quircks, gotchas and limitations.
I found this page: Nim basics to be very useful. It's pretty much a must read for anyone who wants to learn Nim. I wish every language had such a simple "basics" page. The manual was useful too.
If you have any other good tutorials or "basics" let me know!
Feel free to share feedback or improvements! Keep in mind that I was learning the language on the go while making the game, so there may be a lot of things to improve.
Love to see games in Nim, it's a really good language for it and is something I've been wanting to properly do for a while.The language was lacking in beginner level tutorials for a while so it's good to know that the tutorials we have now work, and more will most likely pop up in the future. I like how the screen in your game is a grid of letters and the letters are colored differently to indicate different elements of the game.
I'll give you some feedback regarding Nim first. In your code, to differentiate between horizontal, vertical, and diagonally sequenced letters for the words, you use the strings ["hor", "ver", "dia"], and "enemy" and "player" to distinguish between who gets damaged. Instead of arbitrary strings like this you should use enums, like so:
type WordDirection = enum
wdHor, wdVer, wdDia
type EntityKind = enum
ekPlayer, ekEnemy
You can name the enums and the values however you want, it's just the convention in Nim to use Hungarian notation for enum values that aren't qualified every time (you can use Entity.Player for example).
You also use strings instead of chars to represent letters, this may seem like it makes sense because the library you're using takes a string as an argument to draw text, but the procedure for drawing text actually takes a cstring (equivalent to C char*) as an argument which is a type that strings implicitly convert to. It's not a big deal though, the string -> cstring conversion is a very cheap operation, I just want to let you know the difference.
Your README says to compile as nim main.nim, I assume you meant nim c main.nim which doesn't matter, there are some compile options that you can use for apps like this.
First is --app:gui, this gets rid of the console window that appears when you run the game. You should definitely use this if you want to share the game with other people.
Second is -d:release/-d:danger, release enables optimizations that may add a little to the compilation time but helps performance, and danger disables many runtime checks as to increase speed. danger, as its name implies, can silently error in situations where there should have been a crash, so only use when you've tested your app thoroughly.
More info about compiler options here.
I wish you good luck with more of your games in the future and I hope you consider using Nim again.
Hey! Sorry for the very late reply, I've been very busy these days.
Thank you very much for you feedback!
Yes, you're absolutely right about the enum parts, I would never have thought about that! I blame python for not having a proper, built-it enum :P
I will add all the necessary changes as soon as I can.