Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Create Event
  2. SWAY_HEIGHT = 64;
  3. MAX_SWAY = 2;
  4. swayspeed = 0.02;
  5. sway = 0;
  6. spriteid = sprite_index //or whatever you want the sprite to be
  7.  
  8. //Draw Event
  9. sway+=swayspeed;
  10.  
  11. for (p=0; p<SWAY_HEIGHT; p+=1)
  12. {
  13.   draw_sprite_part(spriteid, 0, 0, p, sprite_get_width(spriteid), 1, x+MAX_SWAY*sin(p/SWAY_HEIGHT*2*pi+sway), y+p);
  14. }
  15. 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