Friday, December 14, 2007

Sweaters

Thomas: class Vector(object):
def __init__(self, a=0, b=0 ):
if _is_numeric(a):
self.x = a
self.y = b
else:
self.x = b[0] - a[0]
self.y = b[1] - a[1]
def __getitem__(self, index):
if index == 0:
return self.x
elif index == 1:
return self.y
else:
raise IndexError
def __add__(self, other):
return Vector(self.x + other.x, self.y + other.y)
def __sub__(self, other):
return Vector(self.x - other.x, self.y - other.y)
def __mul__(self, other):
try:
other = other - 0
except:
raise TypeError, "Only scalar multiplication is supported."
return Vector( other * self.x, other * self.y )
def __rmul__(self, other):
return self.__mul__(other)
def __div__(self, other):
return Vector( self.x / other, self.y / other )
def __neg__(self):
return Vector(-self.x, -self.y)
def __abs__(self):
return self.length()
def __repr__(self):
return '(%s, %s)' % (self.x, self.y)
def __str__(self):
return '(%s, %s)' % (self.x, self.y)
def dot(self, vector):
return self.x * vector.x + self.y * vector.y
def cross(self, vector):
return self.x * vector.y - self.y * vector.x
def length(self):
return math.sqrt( self.dot(self) )
def perpindicular(self):
return Vector(-self.y, self.x)
def unit(self):
return self / self.length()
def projection(self, vector):
k = (self.dot(vector)) / vector.length()
return k * vector.unit()
def angle(self, vector=None):
if vector == None:
vector = Vector(1,0)
return math.acos((self.dot(vector))/(self.length() * vector.length()))
def angle_in_degrees(self, vector=None):
return (self.angle(vector) * 180) /math.pi
def re
that helps
i googled that!
alright, time to knit some sweaters
later
me: laters

Tuesday, December 11, 2007

Dragon Starver: The Beginning of Starvation



import sys, os
import pygame
from pygame.locals import *
from cgkit.cgtypes import vec3

def load_image(name, colorkey=None):

fullname = os.path.dirname(sys.argv[0])
fullname = os.path.join(fullname, 'data')
fullname = os.path.join(fullname, name)
try:
image = pygame.image.load(fullname)
except pygame.error, message:
print 'Cannot load image:', fullname
raise SystemExit, message
image = image.convert()
if colorkey is not None:
if colorkey is -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey, RLEACCEL)
return image

class Spritesheet:
def __init__(self, filename):
self.sheet = pygame.image.load(filename).convert()
def imgat(self, rect, colorkey = None):
rect = Rect(rect)
image = pygame.Surface(rect.size).convert()
image.blit(self.sheet, (0, 0), rect)
if colorkey is not None:
if colorkey is -1:
colorkey = image.get_at((0, 0))
image.set_colorkey(colorkey, RLEACCEL)
return image
def imgsat(self, rects, colorkey = None):
imgs = []
for rect in rects:
imgs.append(self.imgat(rect, colorkey))
return imgs

class AnimatedSprite:
def __init__(self, images, rect):
self.images = images

class Dragon:
def __init__(self):
self.surface = load_image("Dragon.bmp", (255,255,255))
self.pos = vec3(0,0,0)

def main():
pygame.init()

screen = pygame.display.set_mode((1024, 768),1)
pygame.display.set_caption('Dragon Starver')

fnt = pygame.font.Font(pygame.font.get_default_font(),18)

back = pygame.Surface((1024,768),1)
back = back.convert()
back.fill((200,200,200))

keys = {K_a:False,K_d:False,K_w:False,K_s:False}

dragon = Dragon();

while True:
for event in pygame.event.get():
if event.type == QUIT:
sys.exit(0)
elif event.type == KEYDOWN:
keys[event.key] = True
elif event.type == KEYUP:
keys[event.key] = False

if keys[K_a]:
dragon.pos.x -= 1
if keys[K_d]:
dragon.pos.x += 1
if keys[K_w]:
dragon.pos.y -= 1
if keys[K_s]
code to load images, and pull images off of a sprite sheet
and it moves a dragon around on the screen
Sent at 4:58 PM on Tuesday
me: sweet
haha
Sent at 5:15 PM on Tuesday
me: meh
took me a while because i haven't actually opened Flash before
but i have a little placeholder
do you need transparency in the image?
it's a bmp right now
Sent at 5:30 PM on Tuesday
Thomas's new status message - I'm not here right now 5:36 PM
Thomas: I can do transparency on bitmaps now
didnt you read the code!
Sent at 5:55 PM on Tuesday
me: nope
haha
sorry
i will now
though
hang on

Thursday, December 6, 2007

Dragon Starver, Chain Combo System


Thomas: simple to program that!
i donno about graphics
me: so the other thing i was thinking of
is, what if, instead of adding +1 ricochet ability, the critters in your belly were your ammo?
or both?
Thomas: I would say there is no point in eating them then
just kick them
me: the aiming and firing could work like yoshi's island- a toggle that brought up a little timing minigame
no i mean, no kicking- just firing
Thomas: eating should be different from kick to enforce the player doing both
oh
me: just an idea
Thomas: well, thats not a bad idea
maybe you have to aim at the villi!
meh
me: or maybe kicking never ricochets, but firing does!!!
OO
Thomas: nice
but random
me: how so>
Thomas: why wont kicking ricochet? not that it won't work for a game.
me: oh i see
well, i guess maybe the juices in your belly make the things bouncy
you coat them with slime specially-adapted for this purpose
haha
but then there's the "getting fat as a level goal" thing- it would have to change probably
because you'd have to use the ammo for firing (and we would want to encourage it anyway)
eh FUCK IT
too complex
kicking is good
i think the chain combo system should have a bonus system attached- like if you get a certain number of chains, you get a cake!
which makes you fatter faster?
or maybe it's just a bonus item
that can be the scoring system
Thomas: ueaj
guh
me: number of cakes
and size of cakes! haha
Thomas: typing is hard while masturbating!
haha
me: yeah it sure is
i'm pretty good at it though
Thomas: foosho
me: i can switch hands and gain a stroke
like george carlin
Thomas: NICE
me: anyway- cakes?
Thomas: so when are you going to have all the game art done by!?
me: good/bad? i think cakes are better than points
Thomas: tomorrow!
cakes are great
me: no, i think i'll probably start the art once my finals are done, depending on when my art history final turns out to be
next week is critiques and study time, so i'm in crunch time right now
my shit's due tuesday
i've got to get some big ass things printed tomorrow morning and mounted in the afternoon
Thomas: sounds fun
im going to calculate some taylor series
yay
me: nioce
i'm going to shower and go to class i think
got my first final ceramics crit this evening

Dragon Starver, Further Explained


me: i think it would be really cool if the character is just this blobby circle kinda thing, with a tiny head,
and a see through belly
whenever a powerup creature is eaten, it would drop in the belly
you'd just have to make it draw a circle around this collection of sprites- possible?
Thomas: because that would be simple to program...
me: no oh well
haha
i always do that
Thomas: I need to keep ideas simple
me: yeah, i suppose
Thomas: which makes game dev boring
me: well, how about making the character grow bigger? possible?
Thomas: sure
thats not hard
I just dont want to model a stomach digesting food
me: maybe need to make diff. sprites though,
hm?
model a stomach digesting food?
which do you mean-
the level or the character
Thomas: I thought you said something about seeing the food in his stomach
me: yeah, but not anything particularly complicated- well maybe
basically all that needs to happen is for the food to stick together underneath the head sprite,
and then have a line drawn around the food-ball
that would be the hard part
but whatever, minor detail
Thomas: that would be cool
Actually, it might be do-able.
I have a algorithm written for convex hall which is exactly that.
Sent at 4:04 PM on Thursday
me: well shit son
SHIT
that sounds like a good use for it
"hey look at this algorithm i can make it appear to be a see through belly"
haha
aw, this is gonna be fun
drawing little critters is awesome
Thomas: haha
me: and the other parts are easy- just need to make a couple of different wall sprites (which will stack together- basically it's the same mechanic we were thinking of using for Necro., but it actually makes sense and is on its side)
and those are just fleshy blobs, basically
then the character- basically its head, unless you don't want to do the belly thing, in which case it'll just be a series of progressively larger sprites
and the background,
and the creatures
Thomas: Okay
me: and the acid, i guess- however you want to do that (animated sprite at the bottom, i'm thinking? doesn't need to be too fancy, but i think some green bubblings would be nice)
oh and explosions i guess
EXPLOSIONS
Thomas: Cool
me: maybe some sort of graphic to represent the chains that form?
like a shiny blue line that connects the things that get hit?
i donno
Thomas: Shit, I'm confused.
me: and there should be some text that tells the size of the chains as they develop
man, i really just need to draw some pictures of it
so you can see what i mean?
i'm just thinking of the graphics, what all would need to be done
Thomas: Yeah, I havent read the text on necro
me: which is why it sounds more complex than it is
oh okay
you should... check it out?
Thomas: Okay
me: the working name i came up for is "dragon starver!"
it's about this:
you are a critter that has adapted to eat your prey directly from the bellies of these giant dragon things
so you go down in there,
and it's just a box, with acid on the bottom, and contracting stomach walls
critters fall from the sky,
and you need to eat enough of your preferred critters to grow fat and fly back out of the dragon's mouth
Thomas: cool
me: but the walls are constantly closing in on you, so you need to keep em at bay
Thomas: thats my favorite word! COOL!
me: and you do this by kicking non-eatable critters into the walls, to make them explode
whenever you eat an edible critter, it goes in your belly and you get more powerful- which means you are able to kick things and have them ricochet off whatever they hit one more time (per edible)
Sent at 4:16 PM on Thursday
me: so if you have a lot of edibles in your belly, you can kick the other critters around and have them bounce off one another (all this has to happen in midair, before they fall in the acid) and explode multiple stomach walls at once
the only point of contention is the acid thing: should it kill you to fall in it? i think maybe yes, but that means there has to be some sort of system to keep you from falling
which means either you can just fly around, or you can jump around and there are platforms...
hm.
Thomas: platforms would be weird
me: that would be an easy way to make new levels
Thomas: yeah
me: just make new platforms
Thomas: true
me: reuse the same level, add new furniture
level design at its finest! haha
Thomas: by gum!
me: actually, since the walls are just made of multiple sprites, it would be really easy to reshape those for the levels too
Thomas: how the F are you going to draw intestines
me: i'll show you
um
hang on
Thomas: AIGHT
me: can i send you a quick sketch?
Thomas: sure
Sent at 4:20 PM on Thursday
me: sent
wow that took me a long time
Thomas: Im doing calc, so its fine
Sent at 4:33 PM on Thursday
Thomas is typing…

Wednesday, December 5, 2007

Dragon Starver?

me: oy
so
here's what i came up with while i was in the shower:
you are a critter
in this other critter's stomach
(represented by a box with acid at the bottom and slowly-contracting walls)
in order to avoid being digested, you need to fight back against the walls.
to do this, you utilize the creatures that are constantly falling down into the box (stomach)
you kick the things that are falling, and when they hit a wall segment, they explode and destroy it
however, you can also kick the creatures into other creatures, to build up chains and destroy more of the wall segments at once.
also, you can collect certain creatures falling from the mouth to make yourself bigger (and therefore have more powerful kicks)
the power of your kicks determines how many times the things you kick ricochet before they themselves explode
so with a more powerful kick, you could hit a bunch of critters at once, which would all hit wall segments and destroy them.
Sent at 3:53 PM on Wednesday
me: your objective is to 1. not get digested and 2. get fat off of your falling prey (that is why you are there- you are a specialized creature that eats a certain type of animal, and the easiest place to obtain it is in the bellies of these giant beasts)
when you are fat enough, you can fly out of the stomach.
also, you have to hit the critters/eat the prey in midair, otherwise they are dissolved by the stomach acid at the bottom of the stomach-box
you are not dissolved by it, because you have specially adapted to eat from this larger creature's stomach?
(?!)
or maybe you are dissolved by it, but there is a series of platforms to hop around on. what do you think?
Thomas is offline. Messages you send will be delivered when Thomas comes online.