Game Mechanics Gradius-Style Power-up System...

N

Neocraftz1553

Guest
Ok, so, I have a few questions on this...
I've tried to do it before with code, but I just couldn't get it...
I've also tried searching it up, but, I couldn't find anything, so, forgive me if this has been answered before.

So what I have set up is a power up object that when the ship collides with it, the ship destroys the instance and plays a "power up collect" sound. What I think might work is setting up something like:

(Create Event)
PowerMeter = 0;

(Collision Event on the ship colliding with a Red Powerup Capsule)
hud_game.PowerMeter +=1;

(Step Event)
if PowerMeter = 1;
{

if (keyboard_check(ord('I')));
{
PowerMeter = 0;
obj_FalshionBeta.speedUp +=3;
}

What this does is increase the players speed every time they collect one power up capsule and reset a counter that tracks how many the player has collected, but I want to know how to make the hud draw a sprite and how to make it change the frames of the sprite(So like a sprite that has 8 frames, one has no bars highlighted, while the others have a bar highlighted.)


Is there a way to do this every time the player collects a power capsule?

Another Question:

How to make a sprite(Like the plane sprite) change frames like the Vic Viper does in the Gradius Games?

Last Question:

I have a title screen, but I want to know how to make it so that you can press up/down W/S to change whats highlighted, like in most title screens.

Sorry for asking so many questions
:|
 

Genetix

Member
Can you use sprite_index() image_index() and image_speed() functions for most of that? If you aren't familiar with them, you should definitely read the manual a bit.

There are a ton of ways to approach the title screen issue. You could keep track of a var for example "current_button" then everytime you press up or down increase/decrease the value (in a specific range) as needed. Then for each button, have it check if it is active based on what current_button is set to.
 
N

Neocraftz1553

Guest
Can you use sprite_index() image_index() and image_speed() functions for most of that? If you aren't familiar with them, you should definitely read the manual a bit.

There are a ton of ways to approach the title screen issue. You could keep track of a var for example "current_button" then everytime you press up or down increase/decrease the value (in a specific range) as needed. Then for each button, have it check if it is active based on what current_button is set to.
Thank you! I made a title screen and options using this and it works well.

Menu1.png Menu2.png
 
Last edited by a moderator:

Yal

šŸ§ *penguin noises*
GMC Elder
What this does is increase the players speed every time they collect one power up capsule and reset a counter that tracks how many the player has collected, but I want to know how to make the hud draw a sprite and how to make it change the frames of the sprite(So like a sprite that has 8 frames, one has no bars highlighted, while the others have a bar highlighted.)

Is there a way to do this every time the player collects a power capsule?
The easiest way is to just have a sprite with 8 images, one per highlighted thing. It has limitations, though, since a lot of powerups in Gradius vanishes as options once they're maxed out. If you worry about that... I'd personally make a bunch of sprites (highlighted and not highlighted, empty and nonempty) and use a loop to draw all sprites.
 
Top