Advertisement
CaptainLepidus

Bullet Shooting

Mar 5th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE:
  2. reload=0;
  3. re=30;//reload time, in steps(30=1 second)
  4. spd=4;//bullet speed
  5. damage=10;//bullet damage
  6. acc=5;//accuracy, the higher it is, the less accurate
  7. STEP:
  8. re=max(0,re-1);
  9. SCRIPT:
  10. if mouse_check_button(mb_left)
  11. {
  12. if reload==0
  13. {
  14. var i;
  15. i = instance_create(x,y,obj_energy);
  16. i.image_angle = point_direction(x,y,mouse_x,mouse_y);
  17. i.direction = image_angle+random(acc)-random(acc);
  18. i.speed = spd;
  19. i.damage = damage;
  20. reload=r;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement