Catchup: Code

4 May 2011

I mentioned in the last post there were 2 large things I’d been working on recently. Since February I’ve been busy trying to get my life back on track; I’ve felt a bit lost since leaving uni, struggling to find work and I kind of gave up on myself for a while. But I can’t live with that outcome. Specifically I’d like to get back into software development. I’ve dabbled with various languages and bit of web dev stuff on and off over the past few years since graduation, but this time I’m taking a visit back to where it all started; Java.

I’ve been working through the exercises in a textbook I found online, Introduction to Programming Using Java . It’s probably the equivalent of 1st/2nd year stuff but I feel that’s what I need right now. I need to stop taking the skills I have for granted, it’s one thing to always look for new things to learn but I have a tendancy to become overwhelmed by the volume of stuff I don’t know while thinking the things I do are insignificant and not worth taking credit for. Somewhere wrapped up in the last 10 years I picked that thought up and I haven’t been able to shake it since.

So back to basics. Some of the excercises I found really easy, so that’s reassuring. Not that I want to develop an ego either, there are others that I’ve struggled with. The Gomoku game in chapter 7 took me a whole day to figure out, and they provided the win-checking algorithm in the question so it really was just GUI layout and program flow stuff. I got there in the end, amidst much swearing and blank looks of confusion when I tried to handle too much of the problem at once instead of breaking it down.

But I guess this is that thing that we call “practice”. I can tell to myself you should know this stuff by now, 3 year course, yaddayadda but at the end of the day who learned anything by telling themselves off for not remembering it? I’ve started to forgive myself a little. It’s a habit that’ll take a while to shake, but it’s a start.

My biggest enemy is time, it’s taking a while to get through fitting this in around a day job . I’m on chapter 8 now but I imagine it’ll be a few more months before I see the back of the book.

In other java-related news, in March Brickfall got a Prehistoric makeover

Prehistoric Brickfall - WIP Screenshot

Yes I know I just made it look pretty, but it was a fun train journey home sketching that lot out. Not that it’s finished yet, it must’ve been a late night when I last put it down as there’s no way I’d let an ugly white pixel cutout mistake like that get past me usually. I’ll stick it up in an applet when I get it running properly. With 6 chapters of exercises to work through it might be a while though…

Why dinosaurs? Well it dates back to another code project I was working on in a few years back that never saw the light of day. I had a go at developing for the Nintendo DS, using the DevKitPro/libnds toolkit libraries that some bright sparks built so they could make their favourite toys do things they usually wouldn’t. And that game was Prehistoric Rebound

Prehistoric Rebound - WIP Screenshot

Or it would’ve been, if I’d ever finished it. For me, the lure of completing a project usually lies in its end use, and the thought of building a game which (let’s be honest) no one will ever play kind of made me lose interest and turn my attention to other web development things. Rebound is built in C, while it tastes like Java it isn’t all that familiar to me so it took a lot of work to get it into the state it’s in now.

I got the ball bouncing around and the bats colliding and then lost it somewhere around getting the ball to travel across both screens. I eventually found out the answer. The DS handles the contents of both screens separately so has a separate memory bank of sprite data for each. It’s impossible to pass one sprite between the two screens; instead it has to be stored in memory twice, once in each bank, and its’ visibility toggled as necessary to make it look like the sprite is passing from one screen to the other. But I never went in to finish that part or the scoring display, and it has gathered dust ever since.

That still didn’t answer the question “why dinosaurs?”. Easy. Because dinosaurs are just awesome.

Aside from continuing with the Java stuff, my next code adventure will be overhauling the image gallery into something that properly handles noscript, rather than the hack I chucked in at the last minute which looks like a total mess when the page is running slow. Maybe something like Lightbox.

Comments

  1. I have the same issue regarding offline stuff vs web stuff — the fact that people are going to see and use web things makes them much more appealing to create!

    How hard is it to develop for the DS, incidentally? From your description it sounds annoying and low-level (probably to be expected for games with strictly limited ROM space)?

    If you’re going for Lightboxy goodness btw, I recommend Fancybox.

    • thefairiesdemandtea

      It’s not too bad; the libnds library covers the worst of the low level stuff so it’s mostly calling the right function with the right constant and it does the rest. As for what to call when, fortunately there’s some brilliant tutorials out there for how to use it, give http://www.patater.com/manual a look if you’re interested :)

  2. For what it’s worth, I’m fairly sure Joseph would welcome an easy dinosaur related game…

Leave a Reply

Your email address will not be published. Required fields are marked *