I believe I'm the first person who was bored enough to figure out the mechanism. I posted it months ago on a Startropics fansite forum, and I thought I'd post it on GameFAQs, so here goes.
Every level starts out with a set number of points. In fact, the Initial value of all levels in both ST1 and 2 is 7650. As you progress through the level you will lose points. Not by taking too long, dying, getting hurt, or even picking up items; one loses points for killing enemies! How does this work? Well, first of all, no baddie is sacred (literally!) -- enemies you must kill to get past a room, bosses, and even the infinite spawns in the boss rooms all count toward the subtraction of your total. So, how many points is each baddie worth? The answer is a little complicated. Every level in the games have a certain "n" value: every n enemies you kill subtracts 30 points from the initial value of 7650. So if the "n" value for a level is 4, and you kill 32 monsters by the end, you will get 7650 - (30 * 8) = 7410 points. If there is a remainder, such as if you kill 33, 34, or 35 monsters in the n=4 level, then the extras aren't factored into your score. For ST2, most (all?) levels have an "n" value of 2, and for ST1, it varies a bit. I really don't have the time to record the value for every level.
So there you go. One interesting item of note is the initial and subtraction value. Why 7650 to start and 30 deduced each time? Well, divide 7650 by 30 and you get the NES's magic memory number: 255. -Mingy Jongo: Crafty Shaman Impersonator http://brawlnotices.tk/
255 is the maximum number you can express with an 8 bit integer. 1111 1111 = 255 check it out. open up your pc calculator and put it in scientific mode. then enter 255, after which click on the bin radio button.
You may find some games today play with "magic numbers" the ds is a 16 bit system. So the max an integer can hold in it is 65 535.