Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create Event
- SWAY_HEIGHT = 64;
- MAX_SWAY = 2;
- swayspeed = 0.02;
- sway = 0;
- spriteid = sprite_index //or whatever you want the sprite to be
- //Draw Event
- sway+=swayspeed;
- for (p=0; p<SWAY_HEIGHT; p+=1)
- {
- draw_sprite_part(spriteid, 0, 0, p, sprite_get_width(spriteid), 1, x+MAX_SWAY*sin(p/SWAY_HEIGHT*2*pi+sway), y+p);
- }
- draw_sprite_part(spriteid, 0, 0, SWAY_HEIGHT, sprite_get_width(spriteid), sprite_get_height(spriteid)-SWAY_HEIGHT, x, y+SWAY_HEIGHT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement