Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- zipper = {
- tile=90,
- init=function(this)
- this.v_check_pointr=1
- this.h_check_pointr=1
- this.track_length=0
- this.track_dir=0
- end,
- update=function(this)
- if mget(this.x/8,this.y/8-this.v_check_pointr)==91 then
- this.v_check_pointr += 8
- elseif mget(this.x/8,this.y/8-this.v_check_pointr)==89 then
- this.track_length = this.v_check_pointr + 8
- this.track_dir=0
- elseif mget(this.x/8,this.y/8+this.v_check_pointr)==91 then
- this.v_check_pointr -= 8
- elseif mget(this.x/8,this.y/8+this.v_check_pointr)==89 then
- this.track_length = this.v_check_pointer - 8
- this.track_dir=1
- elseif mget(this.x/8+this.v_check_pointr,this.y/8)==91 then
- this.h_check_pointr += 8
- elseif mget(this.x/8+this.v_check_pointr,this.y/8)==89 then
- this.track_length = this.h_check_pointr + 8
- this.track_dir=2
- elseif mget(this.x/8-this.v_check_pointr,this.y/8)==91 then
- this.h_check_pointr -= 8
- elseif mget(this.x/8-this.v_check_pointr,this.y/8)==89 then
- this.track_length = this.h_check_pointer - 8
- this.track_dir=3
- else
- this.track_dir=4
- end
- end,
- draw=function(this)
- if this.track_dir==0 then
- line(this.x,this.y-1,this.x,this.x+this.track_length,4)
- line(this.x+8,this.y-1,this.x+8,this.y+this.track_length,4)
- elseif this.track_dir==1 then
- line(this.x,this.y+7,this.x,this.y-this.track_length,4)
- line(this.x+8,thix.y+7,this.x+8,this.y-this.trach_length,4)
- elseif track_dir==2 then
- line(this.x+8,this.y-1,this.x+this.track_length,this.y-1,4)
- line(this.x+8,this.y+7,this.x+this.track_length,this.y+7,4)
- elseif this.track_dir==3 then
- line(this.x,this.y-1,this.x-this.track_length,this.y-1,4)
- line(this.x,this.y+7,this.x-this.track_length,this.y+7,4)
- end
- end
- }
- add(types,zipper)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement