TGC Codebase Backup



My by DBPro Forum

9th Jan 2009 13:52
Summary

It's an analogue Clock, a pretty one.



Description

When I started creating this small program. I only knew DBPro for two weeks, but I took me only 2 hours to write it down, Don't think it's hqrder to learn, I think It's the easier among the programming software, now I'm working on a 3D game. Have Fun, and Make handsome games !!

It has no Media



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    set display mode 640,480,32
set window layout 1,1,1
set window size 800,600
Disable escapekey
hide mouse
if inkey$()=chr$(113) or inkey$()=chr$(81) then end
randomize timer()
dot 320,240
circle 320,240,100
ink rgb(255,0,0),rgb(0,0,0)
circle 320,140,2 : circle 420,240,2 : circle 320,340,2 : circle 220,240,2
ink rgb(255,255,255),rgb(0,0,0)
dat$ = get date$()
mois$=left$(dat$,2)
an$=right$(dat$,2)
jour1$=left$(dat$,5)
jour$=right$(jour1$,2)
dat$ = get date$()
mois$=left$(dat$,2)
an$=right$(dat$,2)
jour1$=left$(dat$,5)
jour$=right$(jour1$,2)
data "January","February","March","April","May","June","July","August","September","October","November","December"
mnth = val(mois$)
for n = 1 to mnth
   read this$
next n
if inkey$()=chr$(113) or inkey$()=chr$(81) then end

do
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
   var$ = get time$()
   heure$=left$(var$,2)
   minute1$=left$(var$,5)
   minute$=right$(minute1$,2)
   second$=right$(var$,2)
   n = 270+(val(second$)*6)
   m = 270+(val(minute$)*6)
   l = 270+((val(heure$)-12)*30)
   dat$ = get date$()
   mois$=left$(dat$,2)
   an$=right$(dat$,2)
   jour1$=left$(dat$,5)
   jour$=right$(jour1$,2)
   cls
   Thetime()
   thecircle()
   x=320+cos(n)*97
   y=240+sin(n)*97
   x2=320+cos(m)*90
   y2=240+sin(m)*90
   x3=320+cos(l)*65
   y3=240+sin(l)*65
   ink rgb(0,255,0),rgb(0,0,0)
   line 320,240,x,y
   ink rgb(200,150,0),rgb(0,0,0)
   line 320,240,x2,y2
   ink rgb(10,5,255),rgb(0,0,0)
   line 320,240,x3,y3
   ink rgb(255,255,255),rgb(0,0,0)
   wait 280
   ink rgb(rnd(255),rnd(255),rnd(255)),0
   set text font "palatino linotype"
   set text to italic
   center text 320,50,"Today is : "+jour$+" "+this$+" 20"+an$+"."
   set text size 18
   center text 320,90,"Press Q to quit !"
   ink rgb(rnd(255),rnd(255),rnd(255)),0
   set text size 30
   center text 320,400,"Abderrahman Rhardane Program"
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
   wait 200
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
   wait 200
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
   wait 200
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
   wait 120
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
loop
wait key


function Thetime()
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
   var$ = get time$()
   set text font "Courrier New"
   ink rgb(rnd(255),rnd(255),rnd(255)),1
   set text size 40
   center text 320,225,var$
   if inkey$()=chr$(113) or inkey$()=chr$(81) then end
endfunction


function thecircle()
if inkey$()=chr$(113) or inkey$()=chr$(81) then end
circle 320,240,100
ink rgb(255,0,0),rgb(0,0,0)
circle 320,140,2 : circle 420,240,2 : circle 320,340,2 : circle 220,240,2
ink rgb(5,255,255),rgb(0,0,0)
for ff = 0 to 360 step 30
   if ff = 0 or ff = 360 or ff = 90 or ff = 180 or ff = 270 then ff = ff + 30
   circle 320+cos(ff)*100,240+sin(ff)*100,2
next ff
ink rgb(255,255,0),rgb(0,0,0)
for gg = 0 to 360 step 6
   circle 320+cos(gg)*100,240+sin(gg)*100,1
next gg
ink rgb(255,255,255),rgb(0,0,0)
if inkey$()=chr$(113) or inkey$()=chr$(81) then end
endfunction