Hey guys, hope you're all having fun.
Did some work today. Mainly adding in new functions:
- GetX, GetY, SetX, SetY
- GetAngle, GetSpeed, SetAngle, SetSpeed
- ObjGetX, ObjGetY - pass it the ID of an object to get the X/Y.
- GetPlayerID - gets the player object's ID (returns -1 if no player is spawned)
Just some simple stuff, but this allows some cool things like shots aimed at the player.
I also updated the enemy in the main testing script:
Musuu
Script[mdScript]
// TheEnemy
// Enemy boss that makes some fucking danmaku.
Boss "TheEnemy"
{
define count;
define move;
initialize
{
SetImage("reimu1.png", false, 30);
SetSize(24, 30);
count = 60;
move = 0.5;
UseRadians(true);
}
tick
{
SetX(GetX() + move);
if (GetX() > 350)
{
move = -0.5;
}
if (GetX() < 76)
{
move = 0.5;
}
count = count - 1;
// When count reaches zero, we fire a spread of bullets, and spawn a point item.
if (count <= 0)
{
// Adjust the "30" here to change the frequency of firing spreads.
count = count + 30;
bullets = 11;
increment = 1.5707963267948966192313216916398 / (bullets - 1);
angle = 3.1415926535897932384626;
player_id = GetPlayerID();
if (player_id > -1)
{
ydiff = ObjGetY(player_id) - GetY();
xdiff = ObjGetX(player_id) - GetX();
if (xdiff == 0 && ydiff == 0)
{
// Just in case ...
ydiff = 1;
}
angle = arctan2(ydiff, xdiff);
}
angle = angle - (increment * ((bullets - 1) / 2));
while (bullets > 0)
{
FireShot01(GetX(), GetY(), angle, 2.5, "shot1.png");
angle = angle + increment;
bullets = bullets - 1;
};
CreateObject("EvilShot", GetX(), GetY());
CreateObject("PointItem", GetX(), GetY());
};
}
}
Enemy_Shot "EvilShot"
{
define count;
define next_count;
initialize
{
SetSize(5.5, 7.5);
SetAngle(180);
SetSpeed(1.5);
count = 60;
next_count = 90;
// Call the internal bullet init function to ensure standard stuff is setup
enemy_shot_init();
SetImage("shot2.png", true, 55);
}
tick
{
count = count - 1;
if (count <= 0)
{
count = next_count;
next_count = next_count + 30;
player_id = GetPlayerID();
if (player_id > -1)
{
ydiff = ObjGetY(player_id) - GetY();
xdiff = ObjGetX(player_id) - GetX();
if (ydiff == 0 && xdiff == 0)
{
ydiff = 1;
}
SetAngle(arctan2(ydiff, xdiff));
}
}
}
}Important to note (aside from some minor changes and fixes) is the addition of the custom shot type "EvilShot". This shot will re-aim itself to face the player after 60 frames, then do so again after 90 frames, then 120 frames, etc ...
I also made the main spread of blue bullets aimed at the player. This is now a lot harder to dodge than the earlier variants.

Now, one more thing to address ... *clears throat*
TESTING RELEASE 1It is still missing a bunch of stuff, but it's complete-enough to have people start throwing down some custom scripts and seeing how easily they can break it.
Important:If you're running on a non-Windows platform, you'll need to use
Mono to run the program. Please let me know how that works out, by the way - I don't have any non-Windows machines to try it out on.
You need to install the SDL.NET runtime libraries. Go
here, select the downloads link, and grab the most recent version for your platform. There are necessary, since they include the SDL.NET function mapping that the program uses.
I included the Tao framework .dlls, but if that doesn't work find an installer
here, and then let me know (so I can update the info).
Included in the testing archive:
- The program itself
- Tao framework DLLs
- ANTLR runtime DLL
- A sample script, along with images (yes, I know the "point item" image looks too much like another shot. I'm not an artist. :V)
- A readme that outlines important info
As this is a testing release, please keep in mind that there is no gaurentee that the program won't randomly shit itself. In fact, part of what this release is for is to find such situations, so that they can be remedied.
The program is currently written such that, if anything errors, it will simply close itself immediately. This is the safest thing to do at the moment, in my opinion, so that things don't start getting ugly.
In the event of an error:If the program is erroring, please do the following:
- Check any custom scripts you made. Right now, I can't catch syntax errors in mdScript because ANTLR catches them internally, so if there's an error in there it may be ignoring part of your script.
- Run the program using the "-l" command line parameter (you can create a shortcut to the program, and add a space then "-l" to the end of the target.) - this will create a log file which will catch some more information on the error.
- Post the log file, the scripts being run, and any other relevant information here, so I can evaluate.
To run scripts other than the default one, and getting some extra info:You can specify a set of script files to load instead of the default ("script2.txt") by adding the file names to the command line.
Also, you can add the "-dt" option to the command line to have the program write debugging information in the window's title bar - FPS, # of objects, graze counter, and score.
So, for instance, if you want to run "omgscript.txt" and show debugging info:
"Musuu no Danmaku.exe" omgscript.txt -dt
Note that the program will attempt to spawn one "Boss" and one "Player" object - if none of the specified scripts contain one, than one won't be spawned. See the provided sample scriptfiles for an example.
This is a
temporary way of loading scripts, until a menu is implemented (which requires me to implement fonts).
Controls:Currently, the controls are fixed. Control configuration will come later, once there's a menu setup.
Arrow keys - move
Shift - focused movement
Z - shot (currently unusable, since there's nothing triggered off of it)
X - bomb (currently unusable, since there's nothing triggered off of it)
Escape -
quits the program immediately - once we get menu stuff going, this will instead bring up the pause menu.
PLEASE KEEP IN MIND - this is an incomplete version, that does not yet have many features to be implemented. A bit of patience is appreciated, and any bugs that you find will help make this program a better one! Have fun, people.
(bump, motherfuckers.)