• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

stretching one part of a sprite/object?

S

scooperdoop

Guest
Is there any good way to make one part of a sprite or an object stretch? I need to make the player character's neck grow upwards on command. Anything would be helpful. I'd like to avoid skeleton animation if I can.
 
M

montiedragon

Guest
It's not ideal but I'd look into the draw_sprite_part_ext and draw_sprite_part functions. You'd draw the body with draw_sprite_part, then the neck with draw_sprite_part_ext, then the head with draw_sprite_part after calculating where the head would be after stretching the neck.
 

kburkhart84

Firehammer Games
You can also do something similar by keeping the "parts" separate. It is kind of a pain, though maybe less pain than drawing the separate parts as suggested. Another consideration would be to draw the animation as actual frames of a sprite. You could then change the neck height by simply choosing a frame, but then if you are already doing animation you would still need to separate the lower half from the upper half, but that may be better than the other options.
 
S

scooperdoop

Guest
It's not ideal but I'd look into the draw_sprite_part_ext and draw_sprite_part functions. You'd draw the body with draw_sprite_part, then the neck with draw_sprite_part_ext, then the head with draw_sprite_part after calculating where the head would be after stretching the neck.
I actually did end up making the body and head and neck all separate, and I have the head following the mouse's y location. Is there any way to have the neck do the same, but elongate instead of move?
 
Top