Author Topic: Short Intro Challenge Xorthing  (Read 3234 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Short Intro Challenge Xorthing
« on: June 15, 2006 »
Don't know what to call this effect but I saw it done on the Amiga a lot (and better), still, managed to squash quite a bit into 20 lines for this and it still runs at a fairly ok speed.

Code: [Select]
#Include Once "fmod.bi"
 #Include Once "tinyptc.bi"
 if (FSOUND_Init(48000, 16, 0) =1 ) then  song = FMUSIC_LoadSong("180deg.xm") 
 FMUSIC_PlaySong(song)
 If( ptc_open( "DBF TINY INTRO BY SHOCKWAVE 2006.", 640, 480 ) = 1 ) Then dim   colours(500) as integer , buffer (640*480) as integer, logo (216) as integer , lg as double
 for a=1 to 500
     if a<= 216 then read logo(a)
     colours(a)=rgb(a shr 1, a shr 1 , a shr 1) next     
    do 
       for y=0 to 479
        ln=50+(150+120*sin(timer*2))+((150*cos(timer*3)*cos(timer*2))*sin((y+(timer *500)) / 150))
        cv=1
        for x= 0 to 640           
            c=int (x  xor y )
            if x >320-(ln/2) and x<320 then cv=cv+1 else if  x <320+(ln/2) and x >320 then cv=cv-1 else buffer(x+(y*640))=(rgb(c shr 1 ,c shr 1 ,y shr 1)) end if           
            if x >320-(ln/2) and x< 320+ln/2 then buffer(x+(y*640))= colours(cv)+rgb(c shr 3,c shr 4,y shr 5)  next   next           
    for x=1 to 216
    if logo(x) <> 0 then buffer( ((x mod 24)+308) + ( ((int ( x / 24 )+1)+212) * 640 ))=rgb(250,250,x)  next
ptc_update@buffer(0) loop until inkey$<>""
data 1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,1,0, 1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,1,0, 1,1,0,0,1,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,1,0,0, 1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,0,0,0,0,1,1,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,0,0,0,0,1,1,1,0

Nb, all the data should be on the same line!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline zparticle

  • Atari ST
  • ***
  • Posts: 168
  • Karma: 11
    • View Profile
    • ScottShaver2000
Re: Short Intro Challenge Xorthing
« Reply #1 on: June 15, 2006 »
That's cool. I hate the FreeBasic fullscreen apps, they totally jack up my display when the program closes. I have dual monitors. Blitz doesn't do that.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Short Intro Challenge Xorthing
« Reply #2 on: June 15, 2006 »
Put the line ;

#define PTC_WIN in the top of the listing to run it in windowed mode :)
Shockwave ^ Codigos
Challenge Trophies Won: