pygame is
Simple DirectMedia Layer is
Site Swing

Stardog - 0.2011.02.16.0

Shanti Pothapragada (rgbdreamer)



A 2D space shooter RPG in the similar to Star Control 2, Escape Velocity, or Star Wolves 3.  Still unfinished and interested in collaboration.

features [status]:

  • Huge universe with sandbox non-linear game flow. [currently working on construction tools]
  • Completely modular ship design: add and remove parts to your ship to make it as big or small as you want. [implemented]
  • Parts can be blown off enemies, collected and equipped, all during battle [working]
  • Enemy ships spawn with Diablo-style random part generation [implemented 10-29-10, needs much more content]
  • Realistic 2D physics [working]
  • A Dozen alien races to explore [some content, no implementation] 
  • Scores of types of enemy ships, each with their own ship design, tactics, and type of parts. [currently 2 with random design variants]
  • Take hyperspace tunnels between solar systems [under construction]

Write me if you are interested in collaborating in any way- coding, graphics, art, ai, plot, etc- . Bugs can be reported here.


  • Enter: menu
  • Tab: radar
  • Del: self-destruct
  • wasd/arrows: thrust and turn
  • q/e: strafe
  • ctrl: shoot
  • space: launch missiles (if equipped)
  • Mouse: move to turn, left click to shoot, right click to thrust

Keys can be changed in the menu.



  • Adds stores to planets. When landed on a planet, you can trade with it. Each planet starts with a few random parts, and keeps any parts that fall into it from space. Currently, there is no money, so "trading" is more like giving and taking. 
  • Fixes several Parts Menu errors. 
  • Parts menu layout changed. Parts now drag and drop onto the selected part, like you would expect. 
  • Destroyer is longer. 
  • Left or Right parts can now be flipped. 
  • Adds background image. 
  • Adds message system. 
  • Adds trigger-based scripting system.


Home Page:


click to view original size


Stardog - 0.2011.02.16.0 - Feb 16, 2011
Stardog - 0.2011.01.18.0 - Jan 18, 2011
Stardog - 0.2010.11.30.1 - Nov 30, 2010
Stardog - 0.2010.11.20.0 - Nov 20, 2010
Stardog - 0.2010.11.07.0 - Nov 8, 2010
Stardog - pre-alpha 10-31-10 - Nov 1, 2010
Stardog - pre-alpha 10-29-10 - Oct 29, 2010
Stardog - pre-alpha 10-27-10 - Oct 27, 2010
Stardog - prealpha 10-25-10 - Oct 25, 2010 account Comments

If you wish to leave a comment with your account, please sign in first.

January 31, 2011 4:37am - Shanti Pothapragada - nickname: (rgbdreamer)
Thanks Mieze! Very thorough. I'll have them fixed in a release this week.
January 29, 2011 1:20pm - miezebieze - nickname: (mieze) - 5/5
Some (critical) bugs:

I wrote some stuff here, but pygame logged me out, so meh.
January 19, 2011 1:58pm - Shanti Pothapragada - nickname: (rgbdreamer)
Stardog - 0.2011.01.18.1 available at same link. Fixes a glich where scripts tried to affect player ships after they died and had restarted, causing the game to crash. Fixes a glich that caused a crash when looking at FlakCannons in the menu. Thanks to shundread on #pygame IRC for feedback.
January 18, 2011 6:58pm - Shanti Pothapragada - nickname: (rgbdreamer)
Big update! Hopefully you will find the gameplay actually fun now (at least for a little while). There should be updates frequently now.
November 22, 2010 5:37pm - Shanti Pothapragada - nickname: (rgbdreamer)
I was using 1.9.1 in Windows. I have 1.8.1 on a virtual Ubuntu machine, and it gets the same error (and it's Rect has no copy()). I made a note in the docs and I'm putting up a version that uses Rect(rectToCopy) instead.

I really thought .copy() would not be a new feature.
November 22, 2010 3:56pm - Carsten Eggers - nickname: (masterlee)
Everytime i tried the game. I have python 2.6 and pygame 1.8.1 which version do you use?
November 22, 2010 8:38am - Shanti Pothapragada - nickname: (rgbdreamer)
masterlee: I am not able to reproduce this crash, and the error does not make sense: a pygame.Rect object should have a .copy() method. Did you get the error more than once?
November 21, 2010 8:33am - Carsten Eggers - nickname: (masterlee) - 5/5
I shot down a small ship tried to collect the loot but the game crashe:

lee@leenux:~/Downloads/stardog0.2010.11.20.0$ python
/usr/lib/python2.6/dist-packages/pygame/ DeprecationWarning: os.popen3 is deprecated. Use the subprocess module.
flin, flout, flerr = os.popen3('fc-list : file family style')
this game may run faster if you install psyco.
Traceback (most recent call last):
File "", line 180, in <module>
File "", line 148, in run
File "/home/lee/Downloads/stardog0.2010.11.20.0/", line 92, in update
File "/home/lee/Downloads/stardog0.2010.11.20.0/", line 34, in update
collide(floaters[i], floaters[j])
File "/home/lee/Downloads/stardog0.2010.11.20.0/", line 179, in collide
ship_freePart_collision(a, b)
File "/home/lee/Downloads/stardog0.2010.11.20.0/", line 243, in ship_freePart_collision #TODO: make not suck
File "/home/lee/Downloads/stardog0.2010.11.20.0/", line 272, in reset
Rect(0,0,PartTile.width, PartTile.height)))
File "/home/lee/Downloads/stardog0.2010.11.20.0/", line 218, in __init__
rect = rect.copy()
AttributeError: 'pygame.Rect' object has no attribute 'copy'
November 20, 2010 2:25pm - Donpachi - nickname: (donpachi)
Now that I built a prototype of such a parser, I realized that it doesn't work just by using + on methods, but they can be assigned with = or setattr() (which is what I used).
November 20, 2010 5:13am - Donpachi - nickname: (donpachi)
It's certainly possible. I don't know if I can give any help that's anywhere near optimal coding, but the technique I'm thinking about involves OOP and Python's nifty feature of using + and - operators on classes to change their methods. So you could define functions for all the basic behavior blocks of every possible actor in the game and the .cfg file would act as a guideline (or list) on which of those to add into the custom game element class that's needed for whatever is going on. They'll fit right into any of the classes if they have self as the first call argument. Well, that's only if you decide to go with that route.

I'm not sure if that came out very clearly, so just an example that could be used in a similar game: .cfg file has the line "ENGINE:Ion Thrust Engine;BASEHEALTH:100;SLOTS:4;ATTACH:PART:Ion Thruster:PART:Shielding"

Then it's only a question of building a parser that can step through that line, with "".split(';') and such. Save that info to a dictionary and run it through a classgenerator method that returns the proper class, of course recursively running itself for whatever parts it needs to create. If it gets really complicated, you could just use a master parts dictionary where generated parts are saved and checked against before running generation.

That kind of parser takes quite a bit of work to create (and manage when extended with new stuff), but it'll be worth every moment of its development if find your part files being bloated to several hundred kilobytes and up. Plus it'd be easier to develop an independent parts database manipulation program.

However, if the game will present only a hundred or so parts, this would probably involve a lot more effort than it gives in return.
November 11, 2010 2:21pm - Shanti Pothapragada - nickname: (rgbdreamer)
Donpachi- Ghosting: it looks like the ghosting is caused by something like an integer overflow in pygame. I could make the sun ghost reliably if I was at about (6200,0), (0, -6200), (6200,-6200), etc. pixels of it. It is fixed when I fixed my code to only draw sprites that should be on the screen (also a small speed up!) thanks!
Dynamic content creation: There are two cases: parts that require different functions (gun vs. engine) and parts that just have different variables/images (big gun vs. little gun). I'm not sure if the first case is possible, and I haven't figured out a good way to do the second case. Maybe you'd be willing to help me?
November 9, 2010 9:06am - Donpachi - nickname: (donpachi) - 4/5
Works in Ubuntu without critical problems. The only annoying thing in the game was that I found a lot of planets and ships that were 'ghosts' - You could float over them as much as you wanted but no collision could be made with them either by ramming or shooting. You could consider moving the parts stuff and all the other data used in dynamic content creation into separate .txt or .cfg or some such files. It's easier to do now rather than 20 versions further down the road, but on the other hand it's not exactly critical either.
November 3, 2010 3:51am - Shanti Pothapragada - nickname: (rgbdreamer)
Thanks! I'm excited to get such technical feedback.
The framerate should be self-regulating (the constant does almost nothing). Did it create problems for you? (I agree that over 60 does not matter).

The display mode was sloppy on my part; I'll fix it.

Hardware surfaces - I'm in Windows, and now I can't see any difference in performance with or without this flag. I'll test it on OSX and Ubuntu when I get the chance. Maybe this is why it flickers so bad fullscreen on OSX?

I think that dirty rect animation will have little effect since my background is animated. Do you mean Surface.convert? I do that most places, but I'll look through and see if I can improve. I think I was not doing it for surfaces that are only drawn once- is that good?

Sound- Thank you! Not my field at all; I think it sounds better now, but am not sure I can tell. I know other people will notice.

Next update (maybe later tonight) should implement these.
November 2, 2010 3:54pm - Josef Polak - nickname: (hardsphere) - 3/5
I'm interested in seeing how this will evolve. A few tips for you though:

First, the you've got an FPS setting in there and you have it set at 200. There's no reason to run a game like this that fast... it looks fine at 20 (which is what it does on my machine, more on that in a minute) and you probably don't need more than 60.

Second, your set the default resolution by running pygame.display.list_modes() and picking value 6. The output of that function is very different on different platforms; on mine your code picks 640x512, which I doubt you intended.

I notice you use a lot of hardware surfaces. They don't always work on all platforms (I've heard pretty much that they work nowhere but Windows). So there are a few other things you can do to speed things up, like dirty rect animation and converting your images to the display pixel format. (There are tutorials about this in the Pygame documentation).

Finally, I've noticed your sounds are sampled at 44100 Hz. Pygame's mixer defaults to 22050. So... if you want the sound to sound less scratchy (at least it sounds scratchy to me) change line 79 of from "pygame.mixer.init()" to "pygame.mixer.init(44100)"
November 1, 2010 10:50am - Shanti Pothapragada - nickname: (rgbdreamer)
Frapa - what do you think of the health bars now? They only show up when a part has under 80% life, and they are dim circles instead of bright lines.

Gogoplex - if you are interested, I'm sure you could help. Start by criticizing, maybe.
October 30, 2010 3:16am - Francesco Pasa - nickname: (frapa) - 3/5
Nice idea!!

I think you should reduce the number of health bars, maybe you can move them in a corner of the window.
October 26, 2010 7:00pm - Gogopex - nickname: (gogopex) - 4/5
Neat. I had great fun modifying the spaceship, and experimenting with all the pieces.

I'm not sure I can do anything to help with my actual level though.
October 25, 2010 9:14pm - Shanti Pothapragada - nickname: (rgbdreamer)
Controls are in the readme:
enter: pause/menu (the Parts and Keys menues are implemented!)
delete: self-destruct, restarting the game
esc: quit

Default ship controls:
w/up: thrust forward
s/down: thrust backward
a/left, d/right: turn
q, e: thrust sideways
ctrl: shoot all guns

These can be changed in the 'keys' menu.
October 25, 2010 8:14pm - Shanti Pothapragada - nickname: (rgbdreamer)
Oops. Enter opens the game menu. The error is from a debug statement I left in. Fixed it in the version up now, or you can delete lines 395 and 396 from .
October 25, 2010 5:00pm - Hewitt Squared Labs - nickname: (hewitt2labs) - 3/5
looks good from a start off, you may want to add the controls though. I also got this traceback when I clicked on parts after I pressed enter:

Traceback (most recent call last):
File "", line 183, in <module>
File "", line 164, in run
File "/home/timothy/Desktop/stardog prealpha 10-25-10/", line 89, in draw
panel.draw(self.image, rect)
File "/home/timothy/Desktop/stardog prealpha 10-25-10/", line 55, in draw
panel.draw(surface, rect)
File "/home/timothy/Desktop/stardog prealpha 10-25-10/", line 115, in draw
Selecter.draw(self, surface, rect)
File "/home/timothy/Desktop/stardog prealpha 10-25-10/", line 395, in draw
if stardog.debug:
NameError: global name 'stardog' is not defined

Not sure what exactly what it was, I'll take a look.

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 7, 2016

Feb 4, 2016

Jan 30, 2016

Jan 24, 2016

Jan 23, 2016

Jan 18, 2016

Jan 5, 2016

Dec 27, 2015

Dec 12, 2015

Dec 11, 2015

Dec 7, 2015

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)