Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
grayscale sunbeam
#1
(ok, so i couldn't think of a better subject line)

ok so one day i was messing around and i did something and i thought it was cool so i took it a step further and did even more cooler stuff which made it super neat so i created a whole interphase for it so that it would be easy to use. (as you can tell im very articulate in conveying a point) i thought about not posting this but i thought since i put soooo much effort into this that some people might as well see it (i swear im not drunk, notice the good spelling...ok i used spell check in conjunction with Microsoft Word, so what!?)
well it is 2:48 AM and sleep does sound good, and im hungry, but i digress. anyways run this code and tell me if you like it. and im not high either.

[syntax="qbasic"]'-------------------------------------------------------------------------|
' HOW TO USE |
' When running, press "1" to have it randomly choose the X and Y coords |
' every three seconds (that varies). press "2" to have the center bounce |
' around the screen. press "3" to move the center around (with the arrow |
' keys) and by pressing "4" it freezes the current window and while you |
' are in "4" mode press "5" to advance a single frame. also press "`" |
' (left of the "1" key) to stop the spinning (toggle) |
' when you are in "3" mode pressing shift + "3" (in other words, "#" |
' the distance you travels between 10 and 1 (toggle) have fun!! |
' |
' NOTE: and cannot be held responsible for epilepsy trigger during use  |
'--------------------------------------------------------------------------
' the below is (obviously) referring to the # of seconds to wait until it
' changes (try zero for a cool effect (like i have to tell you ;)
seconds = 3

IF seconds < 0 THEN seconds = 3
seconds = INT(seconds)
RANDOMIZE TIMER
SCREEN 13
SLEEP 2
1
c = 30

xx = 160: yy = 100
xxx = 1: yyy = 1
stimer = TIMER
ch = 0
DO
2
press$ = INKEY$
IF press$ = "`" THEN
SELECT CASE str
CASE 0
str = 1
CASE 1
str = 0
END SELECT
END IF
IF press$ = "#" THEN
IF ch = 3 THEN
SELECT CASE td
CASE 0
td = 1
CASE 1
td = 0
END SELECT
END IF
END IF

IF press$ = "1" THEN ch = 1
IF press$ = "2" THEN ch = 2
IF press$ = "3" THEN ch = 3
IF press$ = "4" THEN och = ch: ch = 4
IF ch = 1 THEN
IF TIMER > stimer + seconds THEN
xx = INT(RND * 319): yy = INT(RND * 199)
stimer = TIMER
END IF
END IF
IF ch = 2 THEN
IF xx + xxx = 320 THEN xxx = -1
IF xx + xxx = -1 THEN xxx = 1
IF yy + yyy = 200 THEN yyy = -1
IF yy + yyy = 0 THEN yyy = 1
xx = xx + xxx: yy = yy + yyy
END IF

IF ch = 3 THEN
IF td = 1 THEN
IF press$ = CHR$(0) + "H" THEN yy = yy - 10
IF press$ = CHR$(0) + "P" THEN yy = yy + 10
IF press$ = CHR$(0) + "M" THEN xx = xx + 10
IF press$ = CHR$(0) + "K" THEN xx = xx - 10
END IF
IF td = 0 THEN
IF press$ = CHR$(0) + "H" THEN yy = yy - 1
IF press$ = CHR$(0) + "P" THEN yy = yy + 1
IF press$ = CHR$(0) + "M" THEN xx = xx + 1
IF press$ = CHR$(0) + "K" THEN xx = xx - 1
END IF
IF xx > 319 THEN xx = 319
IF xx < 0 THEN xx = 0
IF yy > 199 THEN yy = 199
IF yy < 0 THEN yy = 0

END IF

11
FOR y = 199 TO 0 STEP -1

IF a = 1 THEN c = c + 1: IF c = 31 THEN a = 0
IF a = 0 THEN c = c - 1: IF c = 16 THEN a = 1

LINE (xx, yy)-(319, y), c

NEXT
FOR x = 319 TO 0 STEP -1
IF a = 1 THEN c = c + 1: IF c = 31 THEN a = 0
IF a = 0 THEN c = c - 1: IF c = 16 THEN a = 1
LINE (xx, yy)-(x, 0), c

NEXT
FOR y = 0 TO 199
IF a = 1 THEN c = c + 1: IF c = 31 THEN a = 0
IF a = 0 THEN c = c - 1: IF c = 16 THEN a = 1
LINE (xx, yy)-(0, y), c

NEXT
FOR x = 0 TO 319
IF a = 1 THEN c = c + 1: IF c = 31 THEN a = 0
IF a = 0 THEN c = c - 1: IF c = 16 THEN a = 1
LINE (xx, yy)-(x, 199), c
NEXT
12
IF ofa = 1 THEN GOTO 10
IF press$ = "r" THEN GOTO 1
IF ch = 4 THEN
10
ofa = 0
DO
press$ = INKEY$
LOOP UNTIL press$ <> "": IF press$ = CHR$(27) THEN END
IF press$ = "1" THEN ch = 1: GOTO 2
IF press$ = "2" THEN ch = 2: GOTO 2
IF press$ = "3" THEN ch = 3: GOTO 2
IF press$ = "5" THEN
ofa = 1
GOTO 11
END IF
ch = och
END IF
5
IF str = 1 THEN c = 30

LOOP UNTIL press$ = CHR$(27)



[/syntax]
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#2
Quote: ... i created a whole interphase for it ...

Excellent spelling, yup.. Tongue
Reply
#3
:o numberofsecondstowaituntilnewxandycoords :o - what a long variable name :lol:

I saved it, hope messing with these Linuxes i will not forget to run :-?
fter 60 million years a civilization will search for a meteorite destroying most of the living creatures around this age...

There must be a better future for the Cheetahs!

http://rcs.fateback.com/
Reply
#4
Why not "secswaitnewxy"? =P
or if you want it to be readble

"secs2wait4newxy"
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#5
There, I fixed your sick obsession with that long variable name!

and DrV, technically, I didn't misspell a word, I just used the wrong one Tongue
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#6
Pretty cool looking.
hat were we arguing about again?
Reply
#7
Thank You.









especially for not scrutinizing my code like some certain unnamed people did.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)