Chaser
Member
Hello, been racking my head around this little problem i have so maybe you guys and gals could help me?
Basically i'm trying to create animations from sprites i have 'built' using the draw_sprite-part functions.
The object i have has no sprite index, nor a image index as a result of having no sprite index. Its just an object with a draw event. The draw event has the following code:
draw_sprite_part(spr_Vigilante,0,0,48,16,16,obj_Player_Prime.x,obj_Player_Prime.y); // top half
draw_sprite_part(spr_Vigilante,0,0,64,16,16,obj_Player_Prime.x,obj_Player_Prime.y+16); // bottom half
This works fine to draw like this but it is not a 'frame', i want to be able to add 4 frames to this object and on each frame draw the sprite using the draw_sprite_part function. So if frame is 0 draw dadada, frame1 draw dadada, frame2 dadad and so on. this seems pretty straight forward enough(to me it did) but need to obviously tell gamemaker what the frames are. I'm not to sure whats the best way to do this, create a script maybe? or give the object a BLANK sprite index with four BLANK subimages and have the draw events do the rest because the draw event overwrites any sprite image assigned to the object?. I did try this, and the result worked, sort of, the sprite animates my draw sprite parts but it flashes, which is not what i want. I have been reading other posts and they talk about image_index, setting it to -1, or image_index as gamemaker will automatically run through image speeds but i'm having no luck that way, maybe its simular to what im trying to do but not exactly. I have been reading the manual to, and i'm clearly not getting something.
my logic is this:
if image_index = 0 draw_sprite_part
if image_index = 1 draw_sprite_part etc
my logic is completely flawed so i need someone to check me.
The way the Import strip function works in the image editor would be awesome if we could do that manually in code. I don't want to create lots of strips to store, i want to be able to use one sprite sheet and build the sprites using that when an image index or frame is actioned. does that make sense? Think how NES/Master system worked from a bitmap, that's kind of what i'm trying to achieve. I'm not looking for someone to say heres the code you need, or do this, i'm looking for someone to explain to me how it works using gamemaker, and maybe how my thinking is sending me down the wrong path, i want to understand the code i'm using.
thanks in advance
Basically i'm trying to create animations from sprites i have 'built' using the draw_sprite-part functions.
The object i have has no sprite index, nor a image index as a result of having no sprite index. Its just an object with a draw event. The draw event has the following code:
draw_sprite_part(spr_Vigilante,0,0,48,16,16,obj_Player_Prime.x,obj_Player_Prime.y); // top half
draw_sprite_part(spr_Vigilante,0,0,64,16,16,obj_Player_Prime.x,obj_Player_Prime.y+16); // bottom half
This works fine to draw like this but it is not a 'frame', i want to be able to add 4 frames to this object and on each frame draw the sprite using the draw_sprite_part function. So if frame is 0 draw dadada, frame1 draw dadada, frame2 dadad and so on. this seems pretty straight forward enough(to me it did) but need to obviously tell gamemaker what the frames are. I'm not to sure whats the best way to do this, create a script maybe? or give the object a BLANK sprite index with four BLANK subimages and have the draw events do the rest because the draw event overwrites any sprite image assigned to the object?. I did try this, and the result worked, sort of, the sprite animates my draw sprite parts but it flashes, which is not what i want. I have been reading other posts and they talk about image_index, setting it to -1, or image_index as gamemaker will automatically run through image speeds but i'm having no luck that way, maybe its simular to what im trying to do but not exactly. I have been reading the manual to, and i'm clearly not getting something.
my logic is this:
if image_index = 0 draw_sprite_part
if image_index = 1 draw_sprite_part etc
my logic is completely flawed so i need someone to check me.
The way the Import strip function works in the image editor would be awesome if we could do that manually in code. I don't want to create lots of strips to store, i want to be able to use one sprite sheet and build the sprites using that when an image index or frame is actioned. does that make sense? Think how NES/Master system worked from a bitmap, that's kind of what i'm trying to achieve. I'm not looking for someone to say heres the code you need, or do this, i'm looking for someone to explain to me how it works using gamemaker, and maybe how my thinking is sending me down the wrong path, i want to understand the code i'm using.
thanks in advance