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.
Raizing-esque medal system in GM
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
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.
-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."
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.
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.
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.
Medal object, Step event:
Reset medals to initial value when it leaves the screen:
Medal object, collision with your player ship object:
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
}
}
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()
}
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.