Advertisement
Guest User

STUPPED CODEEEE

a guest
Nov 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. zipper = {
  2. tile=90,
  3. init=function(this)
  4. this.v_check_pointr=1
  5. this.h_check_pointr=1
  6. this.track_length=0
  7. this.track_dir=0
  8. end,
  9. update=function(this)
  10. if mget(this.x/8,this.y/8-this.v_check_pointr)==91 then
  11. this.v_check_pointr += 8
  12. elseif mget(this.x/8,this.y/8-this.v_check_pointr)==89 then
  13. this.track_length = this.v_check_pointr + 8
  14. this.track_dir=0
  15. elseif mget(this.x/8,this.y/8+this.v_check_pointr)==91 then
  16. this.v_check_pointr -= 8
  17. elseif mget(this.x/8,this.y/8+this.v_check_pointr)==89 then
  18. this.track_length = this.v_check_pointer - 8
  19. this.track_dir=1
  20. elseif mget(this.x/8+this.v_check_pointr,this.y/8)==91 then
  21. this.h_check_pointr += 8
  22. elseif mget(this.x/8+this.v_check_pointr,this.y/8)==89 then
  23. this.track_length = this.h_check_pointr + 8
  24. this.track_dir=2
  25. elseif mget(this.x/8-this.v_check_pointr,this.y/8)==91 then
  26. this.h_check_pointr -= 8
  27. elseif mget(this.x/8-this.v_check_pointr,this.y/8)==89 then
  28. this.track_length = this.h_check_pointer - 8
  29. this.track_dir=3
  30. else
  31. this.track_dir=4
  32. end
  33. end,
  34. draw=function(this)
  35. if this.track_dir==0 then
  36. line(this.x,this.y-1,this.x,this.x+this.track_length,4)
  37. line(this.x+8,this.y-1,this.x+8,this.y+this.track_length,4)
  38. elseif this.track_dir==1 then
  39. line(this.x,this.y+7,this.x,this.y-this.track_length,4)
  40. line(this.x+8,thix.y+7,this.x+8,this.y-this.trach_length,4)
  41. elseif track_dir==2 then
  42. line(this.x+8,this.y-1,this.x+this.track_length,this.y-1,4)
  43. line(this.x+8,this.y+7,this.x+this.track_length,this.y+7,4)
  44. elseif this.track_dir==3 then
  45. line(this.x,this.y-1,this.x-this.track_length,this.y-1,4)
  46. line(this.x,this.y+7,this.x-this.track_length,this.y+7,4)
  47. end
  48. end
  49. }
  50. add(types,zipper)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement