01 July 2007

Opioid2D Code Snippets Library

Another thing I'm starting from alpha 6 onwards, is to compile a collection of useful example snippets, that show the idiomatic way to do certain things in Opioid2D. They will be smaller than actual example games, but a bit larger and better written than the short test scripts in the distribution so far: things like HealthMeter, ParallaxScrolling, ObjectPicking etc. The idea is that you can study those snippets and paste them into your own code when learning O2D. They should give a better starting point until I can finalize all documentation.

So, if you have any suggestions for useful snippets you'd like to see, please list them in comments for this entry.

3 Comments:

Anonymous Anonymous said...

First of all, thanks for developing on of the cleanest and most beautiful game API's I've ever seen. Opioid is a work of art. As an AI programmer who has struggled with nasty OpenGL tweaks to get a simple 2D game to work, I truly appreciate what you have done and hope you keep it up.

As for suggestions for example snippets, how about an example of hiding a sprite? I know we can set the alpha value to zero, but what if I want to completely remove a set of sprites from the rendering process? My original thought was that if a sprite is not a member of any layers, it will not be rendered. However
sample_sprite.set(layer="")
or
sample_sprite.set(layer=None)
don't seem to work.

Anyway, thanks again for a wonderful library.

02 July, 2007 12:22  
Blogger vonWolfehaus said...

Fantastic idea. I have a few things I'd like help with: tiling textures, making 'closed' levels (as it is, I put invisible blocks all around the level so that the player can't get out--is there a better way?), and some examples of resolution-independent and resizable windows.

For that last one: I've been having trouble figuring out how to make the window resizable without changing the o2d public files, and just figuring out resolution-independent stuff in general. I understand the basic idea (thanks to the test file), I think, it's just that I don't know how o2d paints windows.

For example, I tried making the screen resizable with pygame code, but when I resized it, o2d didn't update the background. I'm hoping I can use tilable textures to fix this (ie give o2d something to render past the level's edges), but all I've been able to do is load one huge image as a static background... and it looks ugly.

Amazing work so far Shang, thanks!

04 July, 2007 00:46  
Blogger Chaz said...

A camera demo would be awesome. Camera is important in strategy games and platforming games (the two types of games I plan to make the most, aside from shoot-em-ups).

Also, flashy particle effects and the like are a must for a Super Robot Wars clone. ;)


I can't wait to start using this! In fact, I think I'll start... tomorrow. :P

11 July, 2007 04:44  

Post a Comment

<< Home