Author Topic: DemoCoding - Reflections (Windows, Linux, Mac)  (Read 3661 times)

0 Members and 1 Guest are viewing this topic.

Offline va!n

  • Pentium
  • *****
  • Posts: 1431
  • Karma: 109
    • View Profile
    • http://www.secretly.de
DemoCoding - Reflections (Windows, Linux, Mac)
« on: September 07, 2009 »
This was my contribution for a coding challenge (20 lines, each max 80 chars)...



.: Please download the full archive to get all needed media files / compiled version!
>> Download Here<< http://www.secretly.de/public/Reflections.zip

Code: [Select]

;*****************************************************************************
;*         _____          ______            __
;*        /\  _ `\      /'___\_ \          /\ \____
;*        \ \ \L\ \   __\ \__//\ \    __ __\_\ ,_\_\  ___   ___   ________  _
;*         \ \ ,  /_/'__`\ ,__\ \ \ /'__`\'___\ \/\ \/ __`\' _ `\/',_____ _
;*         _\_\ \__ \  __/\ \_/\_\ \_  __/ \__/\ \_\ \ \L\ \ \/\ \__, `\
;*  _  ___/\_____\ \_\____\\_\ /\____\____\____\\__\\_\____/\_\ \_\____/\
;*  " __ __/_____/\/_/____//_/ \/____/____/____//__//_/___/\/_/\/_/___/\
;*     
;*    C A T E G O R Y :    P u r e P u n c h   C o d i n g C o n t e s t   3
;*
;*                  v e r s i o n   1.0  [ 31 - aug - 2009 ]
;*
;* ---------------------------------------------------------------------------
;*
;* PurePunch Contest #3
;*
;* Name.....: Reflections
;* Author...: Thorsten Will aka "Mr.Vain of Secretly!" (va!n)
;* Category.: Demo
;* Date.....: 31.08.2009
;*
;* Notes....: This is my contribution for the PurePunch coding cotest #3...
;*            The rule is to code something in max 20 lines, each max 80 chars!
;*            Its allowed to add a graphic file (only one image, or sprite, or
;*            texture...), maximum size 512x512 pixels using 32 bits! For music
;*            its allowed to add a soundfile (and only one) max filesize 1 MB!
;*
;* About....: I come up with a small demo that should run in same speed on any
;*            PC (fps independent) and should compile/run on windows,linux,mac!
;*            3D GfxCard must support any texturesize (else possible gfx probs)
;*            Please dont use OpenGL as SubSystem, it will make some problems!
;*       
;*            - Should compile and run on 32/64 bit Windows, Linux, Mac
;*            - Should run in same speed on any PC (fps independent)
;*            - Title and credits screen
;*            - Layers (skyline, floor, bobs) moving with the perspective
;*            - Moving oldskool copperbars
;*            - Moving realtime floor with faked reflection effect
;*            - Moving glowing blobs with small mirrow effect on the floor
;*            - Great atmospheric tune (sadly no loop, due fact of module lib)
;*            - Police car with animated blue/red lights
;*            - Heavy size optimized and crypted sourcecode (had a lot fun)
;*            - Source fits in only 19,5 lines (but can be done in 18,5 lines)
;*            - Exit by hitting the ESCAPE key...
;*            - What do you want more? Hope you like it... ;)
;*
;*
;*            P L E A S E   D I S A B L E   T H E   D E B U G G E R  !!!
;*
;*****************************************************************************

MessageRequester("Reflections v1.0 - 31-Aug-2009","Entry (20 liner) for PurePunch #3 - by va!n aka Thorsten Will",0)

Macro m(t,d):Macro t:d:EndMacr:EndMacro:m(Z,Sprite3DBlendingMode)o:m(D,Drawing)o
m(N,Sprite)o:n=b:m(W,Sprite3D)o:InitSound():a=800:h=600:InitKeyboard():b=400:o.f
Init#N():Init#W():m=b:OpenScreen(a,h,32,""):a=200:Sprite3DQuality(1):f=100:g=a;;
Load#N(0,"x.bmp",4):Display#N(0,0,0):Dim d(a):Start#D(ScreenOutput()):m(P,Next)o
For i=0 To 89:d(i)=Point(256+i,480):P:Stop#D():m(E,Display#W)o:For x=0 To 14;;;;
Grab#N(x,d(s),d(s+1),d(s+2),d(s+3),4):i=40<<16:TransparentSpriteColor(x,i):w=255
Create#W(x,x):Zoom#W(x,d(s+4),d(s+5)):s+6:P:_.f=0.01745:LoadModule(0,"x.mod");;;
PlayModule(0):m(U,FlipBuffers)o:i=2:j=6:Gosub L:Repeat:ExamineKeyboard():n=511;;
Start#D(SpriteOutput(0)):ot=nt:j=w*Sin(i*_):nt=ElapsedMilliseconds():dt=nt-ot;;;
tt.f=tt+dt*(1/15):i=tt:For y=0 To w:z.f=-a/y:v=n*z-i:o=-w*z+j:For x=0 To 511;;;;
t=(Int(o)!v)&64:o+z:c=Int((t/256)*y)+2:Plot(x,y,RGB(c,c,c<<1)):P:P:Stop#D():b=30
Create#W(0,0):Start3D():n=300:Zoom#W(0,800,n):E(0,0,n):E(14,0,0,b):E(3,-f+j/8,0)
d.f=e.f:For t=0 To 9:s=Sin(d)*64:d+0.27:E(7,0,f+s,w-t*26):P:E(13,-f+j>>2,n,74);;
e=-i/32:E(12,700,10,90):E(1,-f+j>>2,0):E(14,0,0,56):For n=0 To 45:g=240:q=i+n<<3
o=Cos(q*_):z=Sin(q*_):k.f=m+a*o:l.f=a+a*z/2:u.f=n*8-f*o/1.5:t=(n<<1+8)/2:d=g-f*z
c=j/6+a:Z(3,7):x=c-t:y=u-t:t<<1:Zoom#W(9,t,t):Zoom#W(10,t,t):E(9,k+x,l+y):x=125;
E(10,k+x,658-l+y):E(9,u+x,d+y):E(10,u+x,658-d+y):Z(5,6):P:E(5,20,330,245):Z(3,7)
t=8:If r<8:t=9:x=65:EndIf:Zoom#W(t,128,128):E(t,x,315):r=i%16:Z(5,6):Stop3D();;;
U():Until KeyboardPushed(1):i=4:j=11:Gosub L:End:L:Start3D():E(11,0,0):E(i,0,f);
Z(3,7):E(j,0,300):Z(4,5):Stop3D():U():Delay(6000):Return

- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: DemoCoding - Reflections (Windows, Linux, Mac)
« Reply #1 on: September 10, 2009 »
Is voting already over ? If so, which place did you get ?
Since we see this thing evolving .. it would be interesting
to know which place you get ? Are there other interesting
entries featuring demo-fx ?
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline PapaSmurf

  • ZX 81
  • *
  • Posts: 22
  • Karma: 3
    • View Profile
    • Grandpa Scott's Country Cookin'
Re: DemoCoding - Reflections (Windows, Linux, Mac)
« Reply #2 on: October 03, 2009 »
I just ran across this demo and all I can say is WOW!!!  This is one of the best demos I've seen in quite some time.   :updance:
Are You Rapture Ready?

Way.net

  • Guest
Re: DemoCoding - Reflections (Windows, Linux, Mac)
« Reply #3 on: October 03, 2009 »
Damm how did i miss this one.That is superb and i love the Depeche  Mode style music.Top stuff :clap: