Ooops
March 01, 2021, 10:38:06 PM

Author Topic: [bb] Paralax Circles by xlsior [ 1+ years ago ]  (Read 417 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Paralax Circles by xlsior [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
Title : Paralax Circles
Author : xlsior
Posted : 1+ years ago

Description : Two circles moving in paralax

Code :
Code: BlitzBasic
  1. ; Paralax -- Sample paralax circle demo
  2. ; 12/13/2003, by Marc van den Dikkenberg / xlsior
  3. ;
  4. ;       The code below is just a simple example of the general principle.
  5. ;       This effect was used in many demo's during the 80's.
  6. ;
  7. ; Note: The black bars could be removed by using multiple tiles images that are
  8. ;       have a combined size of larger than the full screen.
  9. ;      
  10.  
  11. Graphics 640,480,16,3
  12. SetBuffer BackBuffer()
  13. circle1=CreateImage(640,480)
  14. circle2=CreateImage(640,480)
  15.  
  16. For t=(640*1.5) To 0 Step -40
  17.    Color 255,0,0
  18.    Oval 320-(t/2),240-(t/2),t,t
  19.    Color 0,255,0
  20.    Oval 320-(t/2)+10,240-(t/2)+10,t-20,t-20
  21. Next
  22.  
  23. GrabImage circle1,0,0
  24. Color 0,0,0
  25.  
  26. Rect 0,0,640,480
  27. For t=840 To 0 Step -40
  28. Color 0,0,255
  29. Oval 320-(t/2),240-(t/2),t,t
  30. Color 0,255,0
  31. Oval 320-(t/2)+10,240-(t/2)+10,t-20,t-20
  32. Next
  33. GrabImage circle2,0,0
  34.  
  35. MaskImage circle1,0,255,0
  36. MaskImage circle2,0,255,0
  37.  
  38. While Not KeyDown(1)
  39.    aa=MilliSecs()
  40.  
  41.    ; Make both circles move at different speeds
  42.    t=t+3
  43.    t2=t2+2
  44.    Cls
  45.  
  46.    ; Make both circles move in a different pattern
  47.    x#=Sin(t)*10
  48.    y#=Cos(t)*10
  49.    x2#=Sin(t2)*15
  50.    y2#=Cos(t2)*15
  51.  
  52.    ; SIN/COS gone full circle, reset
  53.    If t>359 Then t=t-360
  54.    If t2>359 Then t2=t2-360
  55.  
  56.  
  57.    ; Draw the first circle
  58.    DrawImage circle1,x#,y#
  59.    ; Have circle 2's X-value be influenced by its Y position, to differentiate
  60.    DrawImage circle2,x2#+y2#,y2#*3
  61.  
  62.    ; Put black bars around the image, so the edges look better
  63.    Color 0,0,0
  64.    Rect 0,0,640,50
  65.    Rect 0,430,640,50
  66.    Rect 0,0,32,480
  67.    Rect 608,0,32,480
  68.  
  69.    ; Update Screen
  70.    Flip
  71. Wend


Comments :


Steve0(Posted 1+ years ago)

 Very nice.


CyberHeater(Posted 1+ years ago)

 My eyes my eyes...


big10p(Posted 1+ years ago)

 Oooh, groovy effect, that. You can play with effects like this all day. Nice one!


mv333(Posted 1+ years ago)

 <div class="quote"> This effect was used in many demo's during the 80's </div>Can you tell me the names of these demos? I only remember seeing this effect in "State of the Art", which is from 1992.


Hotshot2005(Posted 1+ years ago)

 <div class="quote"> Can you tell me the names of these demos? I only remember seeing this effect in "State of the Art", which is from 1992.  </div>That Correct :)


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal