Export to GitHub

google-highly-open-participation-psf - issue #332

Create sprite editor for Game Baker.


Posted on Jan 17, 2008 by Helpful Giraffe

Game Baker is a graphical game development system in python:

http://code.google.com/p/game-baker/

We would like you to create a simple gui sprite editor for Game Baker.

Sprites (animations) are saved in Game Baker as instances of game.Sprite.

Frames of the animation are often held in a single sprite sheet (image), one frame next to another. These frames are saved in the list Sprite.imagefiles.

(example of creating a sprite from the platform demo) {{{ sprite = game.Sprite() # The images are in one file, going downwards sprite.imagefiles.append({"filename":"images/flag_sprite.bmp", "topleft":(4,4), "bottomright":(37,41)}) sprite.imagefiles.append({"filename":"images/flag_sprite.bmp", "topleft":(4,52), "bottomright":(37,89)}) sprite.imagefiles.append({"filename":"images/flag_sprite.bmp", "topleft":(4,100), "bottomright":(37,137)})

# update the sprite frame every two game frames
sprite.framerate = 2

# Set the Alpha (transparent) colour to Red (255,0,0)
sprite.alphakey = (255,0,0)

}}}

You should use glade (glade.gnome.org), gtk or pygame. It will require some experience with whichever you use.

The application should be able to:

-open a pickled instance of game.Sprite with pickle.load() -create a new instance of game.Sprite -open images -allow the user to select/modify frame areas and alpha colour -save the Sprite instance using pickle.dump()

Completion criteria: - uses glade / gtk / pygame - can create a new Sprite() instance - can load images and modify frame regions - can modify alpha colour - can save the instance to disk with pickle - give game-baker permission to release your code under both the GPL and LGPL.

(it is highly recommended that only people with some basic experience of glade / gtk / pygame attempt this task)

Task duration: please complete this task within 5 days (120 hours) of claiming it.

Comment #1

Posted on Jan 22, 2008 by Swift Monkey

I´ve never created any useful application in GTK, but I think I know how these GUI toolkits work and I can use them, so

I claim this task!

Comment #2

Posted on Jan 22, 2008 by Happy Bear

Claimed!

Comment #3

Posted on Jan 22, 2008 by Helpful Lion

Good Luck, looking forward to seeing what you come up with.

Comment #4

Posted on Jan 23, 2008 by Swift Monkey

So I´ve refreshed my knowledge of basics of GTK and I´ve thought about the GUI of my future program:

I want to do something similar to MS Paint, but without some "advanced" functions at first. The only diference is I have to allow easy swapping between the frames of an animation so I´m going to use TreeWiew or list with previews of amimation frames.

Comment #5

Posted on Jan 23, 2008 by Helpful Lion

Just to clarify, the sprite object does not store the pixeldata, it still requires the underlying images to exist. The main problem is selecting where the frames are in the image.

I would focus on making an "area select" tool (for selecting frames from one or more large sprite sheet), or something similar.

I like the idea of a list with icons of the animated frames (a lot), but make sure you can also view the main (flat) image(s) so you can change where the frames are on an existing sprite sheet.

The specific painting features, though a future task, aren't specifically required for completion of this task (although you're free to add them as part of the task or if you want to carry on improving it afterwards).

Comment #6

Posted on Jan 25, 2008 by Swift Monkey

My progress report:

I've designed something like the folowing ASCII drawing and now I'm adding Python code which will be able to load it and handle callbacks.

+-----------+----------------------------------------------+ | File Edit View Tools Help | +-----------+----------------------------------------------+ | Painting | +--------------+ | | Tool box| | | | +-----------+ | First frame | | | | | | | | List of | | | | | frames | +--------------+ | | | +--------------+ | | | | | | | | | Second | | | | | | | |sprite.png +-----------+----------------------------------+ | -1. |Alpha rel- | Color box | | -2. |ated stuff | |
+-------------+---------+----------------------------------+

1) The frame list allows you to navigate to certan frame and with dragging and dropping there you can change their order.

2) Drawing area - frames are in ordered how they follow in animation. Each frame has it's own drawingArea

Comment #7

Posted on Jan 26, 2008 by Helpful Lion

Looks really great. Make sure that you can import an existing image (without frame information, so a flat image with four frames on it, but nothing to say which one is where), and select the frames.

I expect that you will miss the original deadline (unless you know your Gtk far better than I do), if this was a standard (non-GHOP) task we would have to make a decision over completion deadlines and features as this is more advanced than I had originally expected. Both where I work, and in Game Baker, we use an Agile-like system for development, so you would be able to argue that taking the time now to develop this is worth it (looking at your plan I think it is).

On the other hand, if you find there are too many callback functions to write by the end of the deadline then you should try to focus your time on the ones required for completion of the task, I'd be more than happy for you to continue work on it after GHOP.

Comment #8

Posted on Feb 2, 2008 by Swift Lion

Two days until final closure, have you had any success?

Again, if you will not complete it in time, feel free to continue after the end of the contest.

Comment #9

Posted on Feb 6, 2008 by Helpful Giraffe

Way overdue...

Status: Deleted

Labels:
gui gtk games sprite ClaimedBy-juraad Due-20080127.0730