SOLVED Help me how can I do this?

River

Member
Hello everyone, wish you all a healthy and happy day. Currently I am making a monster boss, I found this clip on the internet, I want to ask how can I make these fire balls fall from top to bottom and before falling it has a shadow ( as in the clip below). Hope your suggestions help, I really thank you so much. I'm using GMS1.4
Video
 

FoxyOfJungle

Kazan Games
You simply create the object that will be the fireball, and draw a "shadow" exactly in the position it was created (will be where you want the ball to land at the end), and the falling fireball will be a motion simulation, where the Y axis increases until it "falls" in the shadow thus destroying the object.

Example:
You draw the shadow exactly in the position it was created:

Create the fireball
GML:
instance_create_layer(50, 50, "layer_name", obj_fireball);

Inside obj_fireball:
GML:
// CREATE EVENT
fireball_y = 300; // < change this to "view height"

// STEP EVENT
fireball_y -= 3;
if (fireball_y <= 0) {
    instance_destroy()
}

// DRAW EVENT
// fireball
draw_sprite(spr_fireball, 0, x, y-fireball_y);

// shadow
draw_sprite(spr_fireball_shadow, 0, x, y);
You can also scale the shadow to make it look more beautiful and realistic.
 
Last edited:

River

Member
You simply create the object that will be the fireball, and draw a "shadow" exactly in the position it was created (will be where you want the ball to land at the end), and the falling fireball will be a motion simulation, where the Y axis increases until it "falls" in the shadow thus destroying the object.

Example:
You draw the shadow exactly in the position it was created:

Create the fireball
GML:
instance_create_layer(50, 50, "layer_name", obj_fireball);

Inside obj_fireball:
GML:
// CREATE EVENT
fireball_y = 300; // < change this to "view height"

// STEP EVENT
fireball_y -= 3;
if (fireball_y <= 0) {
    instance_destroy()
}

// DRAW EVENT
// fireball
draw_sprite(spr_fireball, 0, x, y-fireball_y);

// shadow
draw_sprite(spr_fireball_shadow, 0, x, y);
You can also scale the shadow to make it look more beautiful and realistic.
Thank you so much for your help.
I want to ask: how can the player just collision with the fire ball will lose hp but touch the shadow of the fire ball will not lose hp? because I have the player collision with fire ball object (objFireball) then just: player touch shadow also lose hp, and I tried other way but it didn't work. eg:
code:
Player Collison objFireball event:
GML:
if (other.y>= other.fireball_y)
{
    hp -=1;
}
 

FoxyOfJungle

Kazan Games
Thank you so much for your help.
I want to ask: how can the player just collision with the fire ball will lose hp but touch the shadow of the fire ball will not lose hp? because I have the player collision with fire ball object (objFireball) then just: player touch shadow also lose hp, and I tried other way but it didn't work. eg:
code:
Player Collison objFireball event:
GML:
if (other.y>= other.fireball_y)
{
    hp -=1;
}
When the fireball destroys, in the "Destroy" event, it creates a damage object, that object will damage the player when it collides with the player.
 
Top