Days 1-2

Progress got off to a flying start and i was making excellent headway until a few uncrushable bugs started to work their way in.

Finally i got to a point where it was much easier to just ditch the offending objects and recode them. Many hours latter and i was still running into the same bugs of tiles not being rotated correctly, sometimes. Eventually the offender was tracked down, it turned out to be one of the first functions i had written, a simple little function to cycle a list forwards or backwards, and it only worked going forwards.

def cycle_list(tlist,direction):
    tlist = tlist[:]
    for x in range(abs(direction)):
        if direction > 0:
            tlist.insert(0,tlist.pop())
        else:
            tlist.append(tlist.pop(0))
    return tlist

So the tiny mistake of forgetting to pass 0 to pop cost me about 6 hours of programming time. Complaining aside it works now and can generate a full 9x9 board. I have added weighting so some tiles are more likely to be chosen than others to try and generate a less erratic board but if i have time i would like to add some heuristics to try and make it favor forming larger cities over many small ones.



By tomorrow i hope to have unused tiles sitting in a tray on the right (scaled down) and be able to drag and drop them around on the grid, and if i am going really well hopefully a good start on the scoring code too.

I have also managed to rope in a friend to attempt drawing up some nicer tiles for me.

I commend you if you have read this far though the haze of poor spelling and grammar.

(log in to comment)

Comments

Those kinds of bugs bite all of us at some point. Today I wasted a bunch of time trying to nut out why stuff wasn't being displayed. I'd forgotten to .add() it all to the scene :-)
I like to call those kinds of bugs "Spot The Fail."

This game is looking interesting. I'm looking forward to play it.