Qbasicnews.com
Challenge.... - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html)
+--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html)
+--- Thread: Challenge.... (/thread-93.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


Challenge.... - relsoft - 02-05-2003

Bouncing Spheremaped ball...

Code:
'"The Lens" by Relsoft
'Relsoft.ath.cx
1 SCREEN 13
2 IF xx% = 0 THEN xx% = 3 + INT(RND * 260) ELSE IF xv% = 0 THEN xv% = -1 + INT(RND * 2)
3 IF (xx% <= 1 AND xv% < 0) OR (xx% >= 319 AND xv% > 0) THEN xv% = -xv% ELSE xx% = xx% + xv%
4 yy% = 100 - ABS(SIN(((xx% * 3) * 3.141593 / 180))) * 160
5 FOR yt% = 0 TO 99
6 FOR xt% = 0 TO 99
7 IF (((xt% - 50) * (xt% - 50)) + ((yt% - 50) * (yt% - 50))) < (2500 - 900) THEN PSET (xx% + xt%, yy% + yt%), (((((((20 - SQR(2500 - (((xt% - 50) * (xt% - 50)) + ((yt% - 50) * (yt% - 50)))))) * ((xt% - 50) / SQR(2500 - (((xt% - 50) * (xt% - 50)) + ( _
(yt% - 50) * (yt% - 50))))))) + xt% + xx%) AND 15) OR (((((20 - SQR(2500 - (((xt% - 50) * (xt% - 50)) + ((yt% - 50) * (yt% - 50)))))) * ((yt% - 50) / SQR(2500 - (((xt% - 50) * (xt% - 50)) + ((yt% - 50) * (yt% - 50)))))) + yt% + yy%) AND 15)) + 16  _
ELSE PSET (xx% + xt%, yy% + yt%), 0
8 NEXT xt%, yt%
9 IF INKEY$ = "" THEN 2


;*)


Challenge.... - BinarySHOCK - 02-05-2003

wow nice 1 rel, very cool!


Challenge.... - red_Marvin - 02-05-2003

I don't know much about peek/pokes memory adresses but here's
my screensaver:

Code:
1 RANDOMIZE TIMER
2 SCREEN 12
3 c = INT(RND * 14) + 1
4 IF POINT(0) < 0 OR POINT(0) > 640 OR POINT(1) < 0 OR POINT(1) > 480 THEN CLS
5 IF POINT(0) < 0 OR POINT(0) > 640 OR POINT(1) < 0 OR POINT(1) > 480 THEN PSET (320, 240), c
6 DRAW "ta" + STR$(INT(RND * 720) - 360) + "u" + STR$(INT(RND * 50) + 5)
7 CIRCLE (POINT(0), POINT(1)), RND * 10, c
8 FOR b = 0 TO 1000: NEXT
9 IF INKEY$ = "" THEN GOTO 3



Challenge.... - Agamemnus - 02-05-2003

heh, just what I wanted Rel. Smile

What about a 3D pong game with that 9-line sphere? Smile Might be a good idea...


Challenge.... - relsoft - 02-06-2003

Quote:heh, just what I wanted Rel. Smile

What about a 3D pong game with that 9-line sphere? Smile Might be a good idea...

In 9 lines?????!!!!!

Yer kidding me!!!!!

Code:
'Lightmapping by RelSoft 2003
'Http://RelSoft.ath.cx
'Sorry about this not being able to compile ;*(
'BC sez: "expression too complex" Guess Qb has its limits after all!!!

1 IF I& = 0 THEN SCREEN 13 ELSE IF I& < 256 THEN PALETTE I&, 65536 * (I& \ 4) + 256 * (I& \ 4) + (I& \ 4)
2 I& = (I& + 1) AND &H7FFFFFFF
3 Var$ = "" + CHR$(100 + COS((I& MOD 360) * 3.141593 / 180) * 100) + CHR$(60 + SIN((I& MOD 360) * 3.141593 / 180) * 60)
4 FOR yy% = 0 TO 99
5 FOR xx% = 0 TO 99
6 H2% = ((xx% - 50) * (xx% - 50) + (yy% - 50) * (yy% - 50))
7 IF (H2% < 2500) AND (I& > 255) THEN PSET (100 + (ASC(MID$(Var$, 1, 1)) - 100) + xx%, 60 + (ASC(MID$(Var$, 2, 1)) - 60) + yy%), (((255 - (SQR(H2%) * (SQR(SQR(H2%))))) + ((((ASC(MID$(Var$, 1, 1)) - 100) + xx%) OR ((ASC(MID$(Var$, 2, 1)) - 60) + yy%) _
) AND 127)) \ 2) * -((((255 - (SQR(H2%) * (SQR(SQR(H2%))))) + ((((ASC(MID$(Var$, 1, 1)) - 100) + xx%) OR ((ASC(MID$(Var$, 2, 1)) - 60) + yy%)) AND 127)) \ 2) > 0) ELSE IF (I& > 255) THEN PSET (100 + (ASC(MID$(Var$, 1, 1)) - 100) + xx%, 60 + (ASC( _
MID$(Var$, 2, 1)) - 60) + yy%), 0
8 NEXT xx%, yy%
9 IF INKEY$ = "" THEN 1



Challenge.... - BinarySHOCK - 02-06-2003

Finally some lightmapping!!!!
3d pong with a spheremapped ball in 9 lines?? your crazy! Wink


Challenge.... - toonski84 - 02-06-2003

good lord rel, you're making us all feel bad about our programming abilities Big Grin

anyhow here's a cheesy little blur demo i made last night:

Code:
1 SCREEN 13
2 IF i& = 0 THEN SCREEN 13 ELSE OUT &H3C8, 0
3 IF i& = 0 THEN DEF SEG = &HA000 ELSE LINE (RND * 280 + 20, RND * 159 + 20)-(RND * 280 + 20, RND * 159 + 20), 255', B
4 FOR i& = 6400 TO 57600
5 IF i& < 7168 THEN OUT &H3C9, (i& - 6400) \ 12
6 POKE i&, (PEEK(i& - 1) + PEEK(i& + 1)) / 2
7 NEXT i&
8 LINE (RND * 280 + 20, RND * 159 + 20)-(RND * 280 + 20, RND * 159 + 20), 0', B
9 IF INKEY$ = "" THEN GOTO 3



Challenge.... - BinarySHOCK - 02-06-2003

i uploaded a better version of the 9 line pong, removed about 90% of the flicker, so ya go grab a new copy Wink


Challenge.... - relsoft - 02-07-2003

Whoooooooaaaaa!!!!!!!

WU LINES!!!!!!!



Don't worry, I'm averaging about 30 mins for the effect and about 3 hours fitting it in nine lines!!!!!

BTW the Lightmapping took me 4 hours last saturday. :*)

Great job guys!!!!!

Toonkski: is there any possibitity for your kewl text fire to be converted to :

Screen 0:width 80,50 ?

it would kick ass!!!!


Challenge.... - toonski84 - 02-08-2003

not if i can beat you to it Smile

obviously ye has never tried to compress a wu line Big Grin