Wednesday, June 23, 2010

A beginning. Delicious.

So this post on the minecraft forums got me itching to code again, and Andrew Nare's blog seemed like a fun thing to do, so here's my take on things.

First, though, a little on me. I've been self-teaching myself, (as opposed to self-teaching Buddha), Python for just over a year now, I'd say, (preceded by a little VB.NET, ugh). I've decided that working up a portfolio would be a good idea, so today, I'm starting small.

After wrestling with GTK+ for about half an hour, I decided to give up on it, and use PyGame for the visual bits. Makes more sense anyway, I suppose; I believe it's easier to find the mouse, etc.

Sadly, my notes on what I should do are somewhat... Lacking.

import pygame
import Image as img

#pygame 2 bits; upper = image, full size scrollable, middleclick+drag for
# movement, lower = instructions.

#type path, list of files, strip any not images

#click top-left, grab co-ords, click bottom-right, grab co-ords


Still, better than nothing, I suppose, so, first thing I'll do, is figure out how to make a simple window, with an entrybox on it, where the user can specify the path. Then some simple ifexists, etc.


Ok, so, played with PyGame for a bit, and did all the flippy goodness, etc., and didn't realise the default background colour for my screen was (0,0,0), and predictably, I rendered my text in black; so I dunno if it worked or not.

On the other hand, I got my head around events, so that was nice.


Ooh, interesting, when you backspace a character, it doesn't clear it visually, so if you type something, backspace it, type something else, backspace that, rinse repeat, it gets wery messy. Same sort of thing happens with anti-aliasing, (so characters get very chubby.) Fixed both with liberal application of surface.fill()

More to come.


Andrew Nare said...

Hey, thanks for the mention in your blog. Really appreciate it!

I've been looking at Python as a potential new language to toy with, so I'll be following your blog to see what you come up with.

Thanks again! And good luck!

Asday said...

No worries, was just a copypaste; not too much effort. :3

Anyway, I'm starting small with this, so I won't be doing anything breathtaking in Python any time soon.

Unless, I'm awesome.

yourmomsucksballs said...

but ur not, u suck ass big time n00b