Screenshot from flatbot-4

Flat Bot

Entry name may have no bearing on final game

Awards

Give this entry an award

Scores

Ratings (show detail)

Overall: 2.8
Fun: 2.6
Production: 3.0
Innovation: 2.8

Respondents: 39

Files

File Uploader Date
flatbot-latest.png
Screenshot from flatbot-4
richard 2008/08/04 02:20
flatbot-4.zipfinal
final entry
richard 2008/04/06 02:03
flatbot-shot2.pngfinal
zzzap!
richard 2008/04/04 12:04
flatbot-shot1.png
flatbot with colour
richard 2008/04/03 11:34
flatbot-0.2.zip
Some junk
richard 2008/04/02 03:23
edit-shot.png
game with editor palette
richard 2008/03/31 10:48
robot3.png
and another one
richard 2008/03/30 04:09
robot2.png
a robot's friend
richard 2008/03/30 03:42
robot1.png
Initial design idea for player character
richard 2008/03/30 03:41

Diary Entries

Robots, eh?

So I sat down with Abbey, my 4-year-old daughter (my inspiration for a previous entry) and we decided that my game will involve to friend robots who live together and have a football (of the International Game).

Haven't got much else except a sketch of one of the robots. I don't think I'm quite up to making an actual football game. I guess we'll see :)

And now the nice robot has a friend

Add a comment

Basic gameplay

Brainstorming the ideas with my daughter seems to have got me further than I usually get this early in PyWeek ;)

I now have a simple "game" in which a robot may kick a ball. No animation or anything fancy.

As a treat I've included another robot image :)

Add a comment

Level editing

Now I have a level editor! The exact API needs a bit of work so it's not checked into Cocos yet. The code is below though. It's fired whenever I press "e" and saves the XML to "editor-save.xml" when I close the tile palette window.
    @director.window.event
    def on_text(s):
        global editor
        if s == 'e':
            editor = TileEditorLayer(level, 'data/level-tiles.xml',
                'level-tiles', lambda layer: scene.remove(layer))
            scene.add(editor)
            director.window.push_handlers(editor)
            return True

class TileEditorLayer(cocos.layer.Layer):
    def __init__(self, map_layer, filename, id, on_done):
        super(TileEditorLayer, self).__init__()
        self.map_layer = map_layer
        tileset = cocos.tiles.load(filename)[id]
        tilesets = [
            (filename, ''),
        ]
        self.selector = TileSetWidget(tileset)

        @self.selector.window.event
        def on_close():
            self.map_layer.save_xml(tilesets)
            director.window.pop_handlers()
            self.selector.close()
            self.selector = None
            on_done(self)
            return True

    def on_mouse_press(self, x, y, buttons, modifiers):
        x, y = self.map_layer.get_virtual_coordinates(x, y)
        cell = self.map_layer.get(x, y)
        cell.tile = self.selector.tileset[self.selector.current.tile_id]
        self.map_layer.set_dirty()

class TileSetWidget(object):
    def __init__(self, tileset):
        self.window = pyglet.window.Window(width=64,height=256,
            style=pyglet.window.Window.WINDOW_STYLE_TOOL)
        self.window.push_handlers(self)
        self.tileset = tileset
        y = 0
        self.batch = pyglet.graphics.Batch()
        self.sprites = []
        for n, k in enumerate(tileset):
            s = pyglet.sprite.Sprite(tileset[k].image, y=y, batch=self.batch)
            if not n:
                self.current = s
                s.color = (255, 200, 200)
            s.tile_id = k
            self.sprites.append(s)
            s.scale = 32. / s.width
            y += 32

    def on_mouse_press(self, x, y, buttons, modifiers):
        for s in self.sprites:
            if x < s.x or x > s.x + s.width: continue
            if y < s.y or y > s.y + s.height: continue
            self.current.color = (255, 255, 255)
            self.current = s
            s.color = (255, 200, 200)
            return True

    def on_draw(self):
        self.batch.draw()

    def close(self):
        self.window.pop_handlers()
        self.window.close()

Oh, and see that dual-window thing going on there? pyglet rocks :)

Add a comment

3 days, 20 hours, 48 minutes to go

I've been quiet, haven't I?

I'm only working on my game during my commute and after hours. And when I say "game" I mean "some toy that's not a game because I don't actually have a game idea yet" :)

I've been coming to terms with the Cocos way of doing things. This is fun, because the Cocos developers are actively developing it under me :)

5 comments

2 days, 12 hours, 18 minutes to go

Well it doesn't look like much has changed but .. well, if you said that you'd be partially correct :)

That white line in the thumbnail isn't in the original image. Hmm.

I've been bitten in the ass for choosing to use a couple of alpha libraries. They're both cool and really help out when they're working, but unfortunately when they're not I spend development time chasing down bugs. But it was my choice to use them and I'll accept that :)

And then there was losing hours last night to a total public transport meltdown here in Melbourne town (we had some previously unheard-of severe weather roll through town that played merry havoc with trains, cars, trees, power lines, brick walls, ...)

The little robot now animates, including some facial expressions. You can't see those at the moment because of a depth-sorting issue ;) There's much improved interaction with the scenery and the ball. You can't see that because that's a screen shot and not one of these new-fangled video animations that all the cool kids are producing.

I even have some idea what the game might be. I believed, and it happened.

Unfortunately I might not get a chance to actually implement it. We'll see.

Add a comment

1 day, 11 hours, 54 minutes to go

I've managed to get the actual gameplay I wanted implemented (well, the basics anyway). You can "win" the game by getting the football to your friend (though there's no indication this is what you're supposed to do, and when you do there's no "end of level" just an excited friend :) and you can overcome obstacles to get there (kicking the ball over ledges, zapping walls with your laser.

Like some of my other games it's a very simple one because I want my daughter (now 4) to be able to enjoy it.

The game as it stands implements most of the important engine components (sprites, collisions, tile mapping including an editor, overlays, particle effects, lasers). It doesn't implement a bunch of animation I wanted because I can't quite wrangle Cocos (0.3alpha in SVN) to draw my sprites in the correct order, so eye irises end up behind the head (invisible) and things like that.

I've got other ideas for things to do in the level, but I won't have much time to implement them, and I'd like to get some basic game menu etc. stuff in, and some sound effects. And some level decorations.

I've uploaded a "final" game just in case I don't get any time to do any more on it, but I really do hope to put in a bunch more work.

Add a comment

Post-mortem (the brief)

Well, that was fun :)

My game:
Against it all I wrote a game. That's better than I did last PyWeek. It's not much of a game - only one short level. I don't know whether the idea has much merit for continued development either.

What I did get out of this PyWeek was good experience with and stress-testing of both pyglet and Cocos.

PyWeek in general:
And of course the pyweek.org application broke, as we've come to expect. Hopefully all those entrants with final submissions to upload will be able to.

Participation was up again this challenge, both users and entries. It remains to be seen how many final entries we get thanks to the delay with md5 uploads, so I'll post the final numbers later.

7 comments

Gamasutra: "How to Prototype a Game in Under 7 Days"

This article is chock-full of advice for everyone :)

Read it.

Bookmark it.

Return to it before the next PyWeek :)

Add a comment