To create a slave, pass ENEMY_IMMUNE for hp in create_enemy(). tip: create_enemyg(...) is an abbreviation for create_enemy(&global.enemies, ...).
There is something like a super fancy event system for Enemies' logic rules now: logic_rule will be called with t = negative special values like EVENT_BIRTH or EVENT_DEATH on corresponding events. cool, isn't it? well those values have to be filtered out (like if(t < 0) return;) if you don't use them so they don't do strange things with your locus.
Another Sarrg commit implementing score, different items and alternative player shot modes. Some things need improvements, some don't. But this commit fixes a bug with bomb counting, which is I think enough reason to push it now.
improvements on the slave system. it's player dependent and unglobalized. slaves are controlled by two different kinds of rules: a draw rule and a logic rule. this is necessary because some slaves need special appearances like Myon and drawing is only possible in stage_draw(). this also makes them configurable enough for different shot types and stuff.
Another Sarrg commit implementing score, different items and alternative player shot modes. Some things need improvements, some don't. But this commit fixes a bug with bomb counting, which is I think enough reason to push it now.
load_textures() was changed to load_resources() and will now load all sounds in sfx/. playing via play_sound(char *name) (or the pointer variant). positional audio is not implemented yet.
and some other changes.
The static texture loading was replaced by a dynamic loader. Every png file in gfx/ is (recursively) loaded at the beginning and accessed via get_tex(name) or get_ani(name).name for "gfx/stage1/border.png" would be "stage1/border".
Sprite information is to be specified in the filename in the pattern: ani_${row count}_${col count}_${animation frequency}_${name}.png
Ever thought about abusing C1 as R2? I tried and it turned out to be very comfortable, especially when you realize that you can use massive imaginary power to move your rice. I also fixed various things on the way which I forgot. hm.
The gap problem is solved for now, by abandonning the frame limiter and setting simple delay plus using a higher framerate (100 FPS). but i had to regress to frame-dependent movement, because things were buggy.
After this short break, I have to announce that this project is no longer called openth. The name was stereotypical and conflicted with Open Theme Hospital. Thus, gentlemen, we are now working on Seiyou (西洋). Thanks to lachs0r for this wonderful suggestion.
Also the lincense has changed. Farewell, gnutardedness, hello MIT. I feel somehow relieved now after freeing the project of nearly one thousand lines.
I built some font support (new dependency: SDL_ttf). The Biolinum font of the Libertine project was included as the new ingame font.
Shot at fairies and you will get power. The system is pretty dumb currently, i guess i'll improve it somwhen. If you get a power level >= 2 you get a better shot. anyway, just testing. the player projectiles are somewhat uncomfortable to look at. to do.
yay. look, i cut some of that annoying list code repetitions you always have with linked lists in C. let's just pretend C had templates, put some void-pointers in, add the necessary (void *) casts to show that you are really serious about this and wazaah, you created another funny piece of (C++)--
- order of create_projectile() arguments changed to enable stating a variable amount of parameters depending on the movement rule. movement rules were generalized and could be used for fairies also in the future.
- drawing should be faster now. we have a frame limiter and clearer drawing code now (except of draw_projectiles() which was victim to an optimizing frenzy)
- added reimplementation of texture-projectiles (drawing them with opengl primitives wasn't a good idea after all).
Note: projectile graphics now contain two versions of the projectile, look at gfx/projectiles/ball.png for example. the left version is the uncolored part and the right one is the colored part. I added a shell script building these projectile textures from the B and G channels of an image to make storing the sources in one piece easier (reference: gfx/projectiles/{render.sh,ball.svg}).
- some improvements on texture loading/drawing + a fancy error message, so it won't segault silently at that place again.