Guest User

Game Maker Mouse Gun Codes

a guest
May 14th, 2013
1,305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. obj_player:
  2.  
  3. Step:
  4.  
  5. image_xscale = obj_player_arm.image_yscale
  6.  
  7. Keyboard Left:
  8.  
  9. x -= 3
  10.  
  11. Keyboard right:
  12.  
  13. x += 3
  14.  
  15. obj_player_arm:
  16.  
  17. Step:
  18.  
  19. direction=point_direction(x,y,mouse_x,mouse_y)
  20. image_angle=direction
  21. x= obj_player.x
  22. y= obj_player.y
  23.  
  24. if direction>270
  25. {
  26. image_yscale=1
  27. }
  28. if direction<=90
  29. {
  30. image_yscale=1
  31. }
  32. if direction>90 and direction<=270
  33. {
  34. image_yscale=-1
  35. }
  36. //this is the main code
  37. //
  38. //it tells the sprite to flip on the y axis when it reaches a cretain direction
  39.  
  40. Global Left Pressed:
  41.  
  42. instance_create(x,y,obj_bullet)
  43.  
  44. Draw:
  45.  
  46. draw_sprite_ext(sprite_index,image_index,obj_player.x,obj_player.y,image_xscale,image_yscale,image_angle,c_white,1)
  47.  
  48. obj_bullet:
  49.  
  50. move_towards_point(mouse_x,mouse_y,10)
Advertisement
Add Comment
Please, Sign In to add comment