Remember that one of my XP machines didn't run Musuu? Guess I missed the log the first time but anyway here it is:
After a little searching I found out that sdl_image might be missing. I downloaded it and moved all dll files to my Musuu folder. After that, Musuu was up and running
Good to know.
Just a bit of progress for now ...
- Code to automatically load standard images when starting a script (right now just the point item image)
- Function to unload all loaded images for a script (currently not used, but will be used to unload everything between scripts)
- Fixed a slight error in the mdBase parsing that ate extra args when you forgot a comma (instead of failing)
- Infinite protection should now work through function calls
I got a bunch of thinking done about a couple things, though:
For the player miss animation, I think it should be part of the player's scripts. Specifically, as its own script, which will most likely start a task or set a variable to animate the player's death. Something like this:
.
.
.
miss
{
// run death animation task
death_anim();
}
task death_anim()
{
while (!death_animation_complete)
{
// disable player motion/shooting
...
// check for deathbomb, revert miss if it comes
...
// anime the player character going boom
...
if (death_animation_complete)
{
// reset player's location & stock
}
// resume processing on the next frame
wait(1);
}
}
.
.
.
(remember - sample of what it could look like. some syntactic liberties. might be different. etc etc etc)
Here, the
death_anim task would do whatever miss effect we decide to throw down. The
miss event script would be called, obviously, when the player gets hit.
Furthermore, specific character scripts could override this default if, for instance, you want your character to just blow up with no deathbomb chance.
Only real downside here is that you can't really enforce a specific death animation style for your game script (unless you enforce only specific player scripts).
Another idea I just had while doing stuff:
Instead of (or in addition to) having functions to access object information (like
ObjGetX), allow a special syntax in
mdScript to access object properties directly. I had a couple ideas:
(
id in all examples is an ID number for the object to reference)
id->xSimple and straightforward; I kinda like this one a lot.
object[id].xMakes it much like an array. Might confuse people if they don't know that
object is special, but that's a minor issue IMO.
With this in place, you could make some code a bit neater, such as (using the first syntax):
pid = GetPlayerID();
angle = arctan2(pid->y - y, pid->x - x);Yet another idea I've been tossing about mentally is the idea of "messages" that can be sent to another object. Effectively, this would be functions on one object that can be called from another object.
Basically, it would work in two parts.
1) In an object's scripts, a "message" is defined. This would be a simlpe function definition, basically.
.
.
.
message ChangeAngle(new_angle)
{
SetAngle(new_angle);
}
.
.
.
2) In another object's script, the message can be referenced. Syntax tbd at the moment, but it would probably be best to give a syntax similar to the above property access syntax. For example (using the first syntax):
.
.
.
shotid->ChangeAngle(angle_to_player);
.
.
.
There are many advantages this could bring, such as ...
- Adding ChangeSpeed and ChangeAngle messages to the default bullet definition could simplify (or at least provide an alternative method for) creating complex bullet behaviors without even defining a custom Enemy_Shot object type, allowing them to instead be controlled by the boss itself.
- You could use a message to pass starting parameters to an object that was just spawned.
Also looking at some font stuff, and I noticed that the Tao framework includes bindings for FreeType. I'm considering giving this a try, since it's probably a lot better than my previous idea (get SDL to render the font, then copy it to a texture). Any opinions?
Also, we'll need to decide on a font to use. Preferably one that includes both Japanese and English symbols, at least. We might want to use a public domain one, too, so it can be included with the program itself (meaning it'll be in the same directory so we always know where it is, and we can be reasonable sure it'll always be there).
I saw the
Mona font, but I'm no expert in this area so I'll let you guys talk over this item.
I might get some more code later, but for now it's zombie killing time.