TGC Codebase Backup



FullScreen Motion Blur by Azrael

2nd Mar 2005 12:01
Summary

A simple but great FullScreen Motion Blur Effect.



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Sync On : Sync Rate 0 : Sync
set window on
set display mode 800,600,32


make object cube 1,10

alpha = 20

set camera to image 0,1,512,512
  set camera aspect 800/600
  color backdrop 0
  sprite 1,0,0,1
  set sprite 1,0,1
  set sprite alpha 1,alpha
  size sprite 1,800,600

Do

  set cursor 0,0
  print screen fps()
  print "Press 'Down' to increase the Blur"
  print "Press 'Up' to decrease the Blur"
  print "Alpha: ", alpha

  If upkey() = 1 and alpha < 255 and up = 0 then inc alpha : set sprite alpha 1,alpha : up = 1
    If upkey() = 0 then up = 0
  If downkey() = 1 and alpha > 0 and down = 0 then dec alpha : set sprite alpha 1,alpha : down = 1
    If downkey() = 0 then down = 0

  sprite 1,0,0,1

  pitch object up 1,cos(Timer()/10)/10
  roll object left 1,sin(Timer()/10)/10
  turn object left 1,0.1
  color object 1,rgb(int(sin(timer()/50)*255),0,int(cos(timer()/50)*255))

  position camera camera position x(), camera position y(), -30+sin(timer()/10)*20

  Sync
Loop