Raizing-esque medal system in GM

A place for people with an interest in developing new shmups.
Post Reply
User avatar
Aru-san
Posts: 815
Joined: Sat Mar 29, 2008 7:45 pm
Location: North America
Contact:

Raizing-esque medal system in GM

Post by Aru-san »

I'm trying to make a shmup in GM that incorporates a Raizing-esque medal system, but I'm not sure how to make it work.

The thing I have trouble with is making medals "level up" after the last medal onscreen has been collected. How does one go about doing this in GM?

Any help would be appreciated.
Image
[ Wonder Force IV -sorry Frenetic :c- ]
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Post by worstplayer »

Let's say you have a global variable next_medal

-it starts of as lowest medal's value.
-When a medal is spawned, it'll have next_medal value.
-When you pick up a medal, change next_medal to next value.(IE when you collect 500point one, change next_medal to 600)
-If any medal leaves screen, reset next_medal to initial value, so next spawned medal will be worth 100 points or whatever your lowest medal is.

NOTE: This is how Battle Bakraid works, not sure about other Raizing games.

I can't write it in GML without seeing rest of the game, but it shouldn't be hard.
"A game isn't bad because you resent it. A game is bad because it's shitty."
User avatar
croikle
Posts: 426
Joined: Thu Aug 07, 2008 12:45 am

Post by croikle »

Yeah, that's the way Raizing medals work. The gold bars in RFJ are more like what Aru-san described, where you need to collect all onscreen medals before the value will increase.

I don't know anything about GM, but for the RFJ system I'd look at something like:
bool upgrade
collect medal -> upgrade = true
if (medals onscreen = 0) and (upgrade = true) -> increase value, upgrade = false
drop medal -> reset value, upgrade = false

This may be assuming more power than GML has, of course.
EddyMRA
Posts: 798
Joined: Wed Jan 26, 2005 9:36 am
Location: San Diego, CA, USA

Post by EddyMRA »

I use a simplified version of the Raiden Fighters medal system in Xeno Fighters EX (does not take Slaves into account), but it is similar to Raizing's medal system.

Here's the GML code I used for the XF medal system. You will need to adjust it to fit the Raizing medal system, but since both systems are similar, the adjustments should be minimal.

In your medal object (I call mine obj_medal):

CREATE event:
Upon creation of the instance of the medal, change its appearance and assign a point value to it.

Code: Select all

switch (global.medal_index)
{
    case 1:
    {
        sprite_index = spr_medal_sm1
        value = 10
        break
    }

    case 2:
    {
        sprite_index = spr_medal_sm1
        value = 20
        break
    }
.
.
.
    case 34:
    {
        sprite_index = spr_medal_gold
        value = 70000
        break
    }
    case 35:
    {
        sprite_index = spr_medal_gold
        value = 80000
        break
    }
    case 36:
    {
        sprite_index = spr_medal_gold
        value = 90000
        break
    }
    case 37:
    {
        sprite_index = spr_medal_gold
        value = 100000
        break
    }

}
Medal object, Step event:
Reset medals to initial value when it leaves the screen:

Code: Select all

        if x<view_xview[0]-32
        or x>view_xview[0]+272
        or y>view_yview[0]+336
        or y<view_yview[0]-16
        {
           //Reset medal value to 100 if any valued over 100 exits the screen
           if global.medal_index > 1
               global.medal_index = 1
            instance_destroy()
        }
Medal object, collision with your player ship object:

Code: Select all

score += value

//If last medal onscreen is collected, increase medal value
if instance_number (obj_medal) = 1
    global.medal_index += 1

//If medal index global goes above the index for 10K medals, keep it at that maximum index
if global.medal_index > (maximum index value)
    global.medal_index = (maximum index value)
instance_destroy()
The age of Alluro and JudgeSpear is over.
User avatar
Rozyrg
Posts: 918
Joined: Wed Feb 11, 2009 12:03 am
Location: Southeast USA

Post by Rozyrg »

Odd... medals were the last thing I added to mine and I read this. They're pretty rudimentary in comparison to what was described in that last post, though... wow.

(As usual, I was pretty much just seeing if I could do it at all.)
Post Reply