[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Firing bullets
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Firing bullets
- From: "Charles Christie" <sonicbhoc@xxxxxxxxx>
- Date: Mon, 26 Mar 2007 09:37:53 -0400
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 26 Mar 2007 09:38:11 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=gVRK46vG8WbZsvDwh7Mv0RgGbAM7O12/KFCEOT937vd8Xp4qRMgEydNvPMsv2x6P9j0dMLk5t+VBt4cWk0Q+sqkJUwlVYi6kkktCk5PVTJxDq5U2KMYne9a6A/I6DLWiftIZm7hdToJj/010XT8mqIcU2qTuR2t70YwF7bovyOc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=jOrViv0c5FNALIQTENtVbwnI/iKBltrzr4B/nbZN+M5HILVW5LRIqlJTcj1i60Xls4mPSoALracyH0MWhWp59qNwv0+P8+mOjhCuznC21RQTqWSHpWcedpbz4zQReaG462vfbsyNGFrbs91VpWZ2IPqMEWe8Rxx0vXrWRkA8ekw=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Well, I'm trying to get my program to fire bullets now. Isn't that great?
I think I'm doing it all wrong though...
My problem has been that I don't know how to make the program fire bullets. But then I thought, "shouldn't the character be firing the bullets, not the program?" and it's then that I realized why I couldn't do anything. My logic has been completely wrong. Again. Go figure <_<
Well, I still don't have images for characters yet and I still have no movement code (I should probably work on that, huh?) but everything else aside from the characters and bullets is done.
Once I finish these, I'll be able to probably try to work on a title screen and put a crappy proof-of-concept idea out there (which is pretty much all I need to finish my senior project - a proof-of-concept with a demo that is playable).
My question is: Is it possible to use bulletml to make bullet patterns for this game? I've seen a C++ wrapper for it called
libbulletml but nothing much else.
So. I made a thread asking for help at the Game Programmer's Wiki Forums. Could you also look at that too?
I tried to fix his syntax (a class without an __init__ function? Don't you need those?) and this is what I have so far:
class Bullet:
def __init__(self, position=(0,0), velocity=(0,0)):
self.position = position
self.velocity = velocity
self.ttd = 5
def fire(self):
self.position
= self.position
self.velocity = self.velocity
def update(self):
position += velocity
class Big_Bullet(Bullet, pygame.sprite.Sprite):
def __init__(self):
Bullet.__init__(self)
pygame.sprite.Sprite.__init__(self)
def update(self):
Bullet.update(self)
class Small_Bullet(Bullet):
def __init__(self):
Bullet.__init__(self)
def update(self):
Bullet.update(self)
Also, it's been kinda quiet lately, hasn't it?