TGC Codebase Backup



MMD DCD Player by SunDawg

21st Dec 2004 18:23
Summary

It's a nifty little CD Player for you computer. Easily customized!



Description

Like I said before, it's a CD Player. Very glitchty and needs a nice prgrammer to fix it up. Well, it needs a lot of fixing.....Do what you can. A quite look over the code tells you what you need to have. (Mainly a CD in the Drive and a bitmap in it's directory called background.bmp that's 640x480 in Pixels.) I've included a .zip file that includes all of these files so that it may not be hard for you to get them. You may want to review the source code for a list of controls, by reading what stuff does, before you run it. Things are not as they seem. Like you need to right-click on play to start the music. and tap the right arrow VERY lighty to go to the next song. (and again right click on the play button). If you pause, left click on play to resume.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Rem Project: Digital CD Music Player
Rem Created: 4/11/2004 8:15:21 AM

Rem ***** Main Source File *****
track = 1
track_playing = 1
set window size 640, 480
set window position screen width()/4, screen height()/4
set window title "MP-Digital CD Player «» Copyright (C) 2004 Warturtle/ZAP! Inc. Co."
set window on

load image "background.bmp", 1
paste image 1, 1, 1
ink 16000000, 1
set text size 36 : print "Track: ",track
print "Track Playing: ",track_playing
load cdmusic track, 1

disable escapekey

help()

ink 16000000, 1

while escapekey()=0
if mouseclick()=1 then if mousex()>70 then if mousex()<150 then if mousey()>380 then if mousey()<450 then resume music 1
if mouseclick()=2 then if mousex()>70 then if mousex()<150 then if mousey()>380 then if mousey()<450 then play music 1 : cls : paste image 1, 1, 1 : track_playing = track : set text size 36 : print "Track:",track : print "Track Playing: ",track_playing : help()
if mouseclick()=1 then if mousex()>155 then if mousex()<200 then if mousey()>410 then if mousey()<450 then pause music 1
if mouseclick()=1 then if mousex()>155 then if mousex()<250 then if mousey()>380 then if mousey()<420 then stop music 1
if rightkey()=1 then if track < get number of cd tracks() then track = track + 1 : delete music 1 : load cdmusic track, 1 : wait 100 : cls : paste image 1, 1, 1 : set text size 36 : print "Track: ",track : print "Track Playing: ",track_playing : help()
if leftkey()=1 then if track <> 1 then track = track - 1 : delete music 1 : load cdmusic track, 1 : wait 100 : cls : paste image 1, 1, 1 : set text size 36 : print "Track: ",track : print "Track Playing: ",track_playing : help()
endwhile

function help()
set text size 12
text screen width()/2, 385, "Use the left and right keys to swap between songs on your CD"
text screen width()/2, 400, "To start play right-click on the play button."
text screen width()/2, 420, "To resume after pausing, left-click on the play button."
text screen width()/2, 440, "If you right click on the play button after a song has been started,"
text screen width()/2, 455, "it will restart the song. Enjoy!"
endfunction