Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Wormed by Logan G. / "TheBaykun"
- ' Try to survive as long as you can without
- ' hitting any obstacles!
- ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- Settings:
- '''''''''''''''''''''''
- Dots = 700 '0 - 1000.
- DotSize = 2 '1 - 10.
- Walls = 0 '1: On, 2: Off.
- WallWidth = 2
- RETINA on
- ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- speed=wallwidth 'This is actually the width of the walls, not speed.
- LOADSPRITE 1, "dpad"
- SLEEP 0.01
- sw=ScreenWidth
- sh=ScreenHeight
- TCOLOR 0,200,20
- SLEEP 0.01
- IF speed<1 THEN
- speed=1
- ENDIF
- IF speed>10 THEN
- speed=10
- ENDIF
- IF dots<0 THEN
- dots=0
- ENDIF
- IF dots>1000 THEN
- dots=1000
- ENDIF
- IF dotsize<1 THEN
- dotsize=1
- ENDIF
- IF dotsize>10 THEN
- dotsize=10
- ENDIF
- SLEEP 0.01
- IF walls=1 THEN
- BCOLOR 255,255,255
- SLEEP 0.01
- COLOR 50,50,50
- RECT speed*2,speed*2,sw-(speed*2),sh-(speed*2)
- x=((speed*2)+20)+(RND*(sw-(2*((speed*2)+20))))
- y=((speed*2)+20)+(RND*(sh-(2*((speed*2)+20))))
- COLOR 255,0,0
- SLEEP 0.01
- CIRCLE x,y,15,2
- COLOR 255,255,255
- FOR i=1 TO dots
- CIRCLE (speed*2)+(RND*(sw-(2*speed))),(speed*2)+(RND*(sh-(2*speed))),dotsize
- NEXT
- ELSE
- BCOLOR 50,50,50
- x=20+(RND*(sw-20))
- y=20+(RND*(sh-20))
- COLOR 255,0,0
- SLEEP 0.01
- CIRCLE x,y,15,2
- COLOR 255,255,255
- FOR i=1 TO dots
- CIRCLE 1+(RND*sw),1+(RND*sh),dotsize
- NEXT
- ENDIF
- SLEEP 0.01
- DRAWSPRITE 1, sw-180-(2*speed),sh-120-(2*speed),6
- SLEEP 0.01
- d=INT(1+(RND*4))
- DIM dirTriX(3)
- DIM dirTriY(3)
- IF d=1 THEN 'Left.
- dirTriX(1)=x-19
- dirTriY(1)=y
- dirTriX(2)=x-15
- dirTriY(2)=y-2
- dirTriX(3)=x-15
- dirTriY(3)=y+2
- ENDIF
- IF d=2 THEN 'up
- dirTriX(1)=x
- dirTriY(1)=y-19
- dirTriX(2)=x-2
- dirTriY(2)=y-15
- dirTriX(3)=x+2
- dirTriY(3)=y-15
- ENDIF
- IF d=3 THEN 'right
- dirTriX(1)=x+19
- dirTriY(1)=y
- dirTriX(2)=x+15
- dirTriY(2)=y-2
- dirTriX(3)=x+15
- dirTriY(3)=y+2
- ENDIF
- IF d=4 THEN 'down
- dirTriX(1)=x
- dirTriY(1)=y+19
- dirTriX(2)=x-2
- dirTriY(2)=y+15
- dirTriX(3)=x+2
- dirTriY(3)=y+15
- ENDIF
- SLEEP 0.01
- COLOR 50,50,50
- RECT x-20,y-20,x+20,y+20
- COLOR 255,0,0
- SHAPE 3,dirTriX,dirTriY
- TEXTFONT "Arial Rounded","Bold",12
- DRAWTEXT "3",x-4,y-6
- SLEEP 1
- COLOR 50,50,50
- RECT x-6,y-6,x+6,y+6
- COLOR 255,0,0
- DRAWTEXT "2",x-4,y-6
- SLEEP 1
- COLOR 50,50,50
- RECT x-6,y-6,x+6,y+6
- COLOR 255,0,0
- DRAWTEXT "1",x-4,y-6
- SLEEP 1
- COLOR 50,50,50
- RECT x-20,y-20,x+20,y+20
- COLOR 255,0,0
- CLS tty
- pts=0
- loopA:
- 'BEGINDRAW
- IF x<0 THEN
- x=Sw
- ENDIF
- IF x>sw THEN
- x=0
- ENDIF
- IF y<0 THEN
- y=sh
- ENDIF
- IF y>sh THEN
- y=0
- ENDIF
- pts=pts+1
- POINT x,y
- CLS tty
- PRINT pts
- IF Touch>=1 THEN
- IF TouchX>=sw-60-(2*speed) AND TouchY>=sh-60-(2*speed) AND d<>1 THEN
- d=3
- ENDIF
- IF TouchX>=sw-120-(2*speed) AND TouchY>=sh-60-(2*speed) AND TouchX<sw-60-(2*speed) AND d<>2 THEN
- d=4
- ENDIF
- IF TouchX>=sw-180-(2*speed) AND TouchY>=sh-60-(2*speed) AND TouchX<sw-120-(2*speed) AND d<>3 THEN
- d=1
- ENDIF
- IF TouchX>=sw-120-(2*speed) AND TouchY>=sh-120-(2*speed) AND TouchX<sw-60-(2*speed) AND TouchY<sh-60-(2*speed) AND d<>4 THEN
- d=2
- ENDIF
- ENDIF
- IF d=1 THEN 'left
- xa=-1
- ya=0
- ENDIF
- IF d=2 THEN 'up
- xa=0
- ya=-1
- ENDIF
- IF d=3 THEN 'right
- xa=1
- ya=0
- ENDIF
- IF d=4 THEN 'down
- xa=0
- ya=1
- ENDIF
- x=x+xa
- y=ya+y
- SLEEP 0.02
- READPIXEL x+xa,y+ya
- 'ENDDRAW
- IF ReadPixelR<=200 THEN
- GOTO loopA
- ENDIF
- OPEN "wormedData" FOR INPUT AS #1
- INPUT #1, hiScore
- CLOSE #1
- IF pts>hiScore THEN
- hiScore=pts
- ENDIF
- OPEN "wormedData" FOR OUTPUT AS #1
- PRINT #1, hiScore
- CLOSE #1
- PRINT "Highscore:",hiScore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement