Legacy GM Create of an animation over another sprite

M

marvoc

Guest
Hi,
I have question about, how to run animation over object.
I'm doing something wrong but dont know what :)
I have a balloon object and want to run animation over this object? But when Im creating this directly in ballloon object, graphic is switched to the animation.

And second question is about, how to create a group (like one object) compounded with many sprites?

thanks :)
martin
 

jo-thijs

Member
Hi and welcome to the GMC!

I'm sorry, but I don't quite understand your problem.
You have a balloon object that should play an animation?
What do you mean with "running an animation over an object"?
And what do you mean with "creating an animation directly in an object"?
How do you directly create it in an object?
And also, what do you mean with "graphic is switched to the animation"?

And finally, what do you mean with "a group compounded with many sprites"?
Do you want 1 object to be able to switch between sprites?
Do you want 1 object to show multiple sprites at once?
 
M

marvoc

Guest
Hi, sorry for created mess :)
To your questions, I would like to have 1 object to show multiple sprites at once.
Example of a balloon, balloon is my player unit, like side shooter. And sometimes I want to show animaton of explosion over it or another sprites, like rope dropping from ballon and a guy going down on that. :)
 

jo-thijs

Member
To make 1 object draw multiple sprites, you will need to use the draw event.
If you're using DnD actions, you will need to use these actions:
Ok, this is awkward... The new GMC apparently doesn't have the DnD action images...
Well, just use pretty much anything you find in the draw tab.

If you're using GML, use the draw_sprite, draw_sprite_ext and draw_self functions.

Using those things, you also have a very good control over what animations get drawn when and where.
 
A

Aura

Guest
You can do that easily with the help of draw_sprite() and a number of variables.

Code:
draw_self(); // So that the original sprite is still drawn and the Draw event does not override it
if (man_going_down) {
   draw_sprite(spr_mangodown, ind, x - 5, y);
}
You would have to deal with the variables yourself, though. If you want the drawn sprite to "animate" then use ind which holds the current image index, that is, increase its value in the Step event and reset the related variable to false when the animation has played and *stuff*.
 
M

marvoc

Guest
thx a lot, I'll try that draw_sprite(), really curious ;) thx:)
 
Top