Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Created the DVD "bounce" screen in Turing
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MrMac




PostPosted: Tue Mar 10, 2015 5:03 pm   Post subject: Created the DVD "bounce" screen in Turing

If you've ever seen the scene in The Office where they wait for the DVD logo to bounce in the corner of the screen, or looked at a TV with the output set to DVD, with no DVD in the player, you've seen this before. But now, you can enjoy it from the comfort of your own home, using TURING!

Warning! Flickers a lot. If you can, explain how to remove the flickering.



DVDbounceSourceUncompressed.zip
 Description:
Same as DVDbounceSource, but with no compression.

Download
 Filename:  DVDbounceSourceUncompressed.zip
 Filesize:  186.62 KB
 Downloaded:  280 Time(s)


DVDbounceGOTYuncompressed.zip
 Description:
Same as DVDbounceGOTYedition, with no compression. Good if you have no processing power.

Download
 Filename:  DVDbounceGOTYuncompressed.zip
 Filesize:  1.18 MB
 Downloaded:  509 Time(s)


DVDbounceGOTYedition.zip
 Description:
Executable, source, and picture

Download
 Filename:  DVDbounceGOTYedition.zip
 Filesize:  274.47 KB
 Downloaded:  272 Time(s)


DVDbounceEXE.zip
 Description:
Executable & picture

Download
 Filename:  DVDbounceEXE.zip
 Filesize:  274.04 KB
 Downloaded:  298 Time(s)


DVDbounceSource.zip
 Description:
Source code and DVD picture

Download
 Filename:  DVDbounceSource.zip
 Filesize:  5.76 KB
 Downloaded:  331 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Zren




PostPosted: Tue Mar 10, 2015 5:29 pm   Post subject: RE:Created the DVD "bounce" screen in Turing

Quote:
Warning! Flickers a lot. If you can, explain how to remove the flickering.


That's because, by default, draw operations are drawn directly to the screen. The screen refreshes 60 times per second, and it can refresh at any point during your code. The "flicker" is because it might be updating the screen when you haven't completely drawn everything in the current iteration of your loop. Eg: it updates right after you've cleared the screen, but haven't drawn the logo.

The fix this, we need to manually update the screen.

Turing:

View.Set ("offscreenonly") % Turn on drawing to memory, instead of right to the screen.
% Initialize
% ...
loop
    % Update / Logic
    % ...

    % Draw Frame
    cls
    Draw.FillBox (0, 0, maxx, maxy, black) % Draw in memory
    View.Update () % Display picture drawn in memory onto the screen.

    Time.DelaySinceLast (1000 div 60) % ~60 FPS
end loop
MrMac




PostPosted: Tue Mar 10, 2015 5:45 pm   Post subject: Re: Created the DVD "bounce" screen in Turing

Actually figured it out.

%Pic.Draw (DVDlogo, x, y, picXor)
%drawfillbox(x,y,x+320,y+198,black)

These two lines were redundant, and I fixed the flickering.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: