Showing posts with label space invaders. Show all posts
Showing posts with label space invaders. Show all posts

Monday, January 23, 2012

Functional Programming, Scala, LWJGL, Space Invader (note the lack of plural) and Programmers Exchange...

I've been mulling on the problem of how one might go about writing a simple video game, like Space Invaders, in Scala (using LWJGL) in as pure a functional programming design approach as possible. I'd planned to write my post shortly after Thanksgiving. However, I let the merrymaking of the holidays get the better of me and postponed writing the post.

Finally, on the way home this evening, I decided to spend at least 5 minutes writing up a question to post on Stack Overflow. Then, when I went to go about generating the post, I realized that Stack Exchange (the parent site of Stack Overflow and many other sites analogous to Stack Overflow) had a site more suited to my general question, Programmers Exchange. I then spent the five minutes writing the start of a post. And now, +2 hours later, I finally hit the submit button.

You can find the resulting post here. I'm looking forward to all the learnin' headed my way. I have the uncomfortable feeling I am going to feel a whole lot stupider around functional programming and Scala before I begin to grow the feeling of confidence emerging from nurturing my growing competence confidence. Or something like that, anyway. {smirk}

Sunday, November 6, 2011

I'm back from my gaming hiatus...

I've been away enjoying my personal time. I have not done anything related to coding other than my standard JavaEE stuff at work. I've kept studying all the Scala blogs and have been following the Scala tag on StackOverflow and CodeReview sites. I've continued to want to dive right in and just start coding. It is so obvious to me that I would find designing and writing code very enjoyable in Scala. And I am slowly finding it more and more laborious to produce all the boilerplate necessary when I coding in Java, even with the assistance of code completion and code generation tools in Eclipse.

As I am returning to creating time to play directly with Scala again, I am not finding myself all that motivated to continue on the Life project. I don't want to code a little and then blog alot. It just feels too much like doing Java boilerplate; a huge amount of writing with a very small portion that actually does the interesting work. So, for now I am postponing my Scala Life project. I will very likely return to it.

I am finding myself interested in playing around with Scala and creating a simple retro style video game (from the early 80s); Asteroids, Space Invaders, PacMan Missile Command, Defender, etc. These are the games I initially reproduced when I started learning to program on the TI99/4a 30 years ago. And I don't care that there are hundreds of variations of these games. I am not writing it to be consumed by anyone else. I am writing it to feel the delight of achievement, the thrill of viceral learning, the joy of being playful yet inquisitive while minimize the occurrences of and duration of breakdowns, frustrations (configuration challenges, deployment errors, etc.) and technical challenges.

I have spent about 8 hours researching how to go about writing an OpenGL game using Scala. I looked at a number of possible game engines. And it turns out there is an interesting project called LWJGL (LightWeight Java Game Library) which ties together all sorts of C++/C libraries and APIs such that Java programs can utilize them. And anything Java can utilize, Scala can also. So, I am going to do a Scala + LWJGL project. And for now, I am planning to write a very simple version of Space Invaders. Whoohoo!