help plz
im makeing a program that plays cd music but i can only make it play song number 1 how do i make it when i press a button it plays the next song each time u press it
im useing darkbasic
You could have a int var like SongNum;
every time the user presses the button SongNum++; PlayerSong();
Something like that
or to go back SongNum--;
every time the user presses the button SongNum++; PlayerSong();
Something like that
or to go back SongNum--;
Then learn how to code in DarkBasic.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Use a variable!!!
I USE DarkBASIC (I recommended it as easy software). I cannot verify commands however as the computer I am currently on lacks DB.
I do not know the command for CD music but I,d emagine it''s like this:
PLAYCDTRACK track number
As I say I''m not familiar with CD commands as I program 3D games. I take it you have used the lines:
box(10,10,60,60) /*OR WHEREVER YOU WANT THE BUTTON TO BE (and you could use a sprite)*/
if mouse position x()<60 and mouse position x()>10 and mouse position y()<60 and mouse position y()>10
PLAYCDTRACK a
endif
The bold text is the text I will edit now for you.
Note that you could replace the box with a sprite and the coordinates are probably different.
(begins the bold section)
inc a
if a>GETCDTRACKS() then a=1
PLAYCDTRACK a
(end bold section)
You want to use the a variable to control which track plays.
Note that GETCDTRACKS() is an example command also so don''t try it and hope it''ll work. If you have no joy send me an E-Mail as I''ll be back on my own PC fairly soon.
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
Sorry about the bad "over HTML" in the last reply. I would also like to say that you should read the help files more carefully. USE THE TUTORIALS!!! Not only is DB the simplest programming language in the known universe it also has amazing tutorials and help files. If you are stuck you should try using the DarkBASIC forums for DB specific queries as it is not a universal language like C++/VB/JAVA and 95%+ of this site''s users have never heard of it.
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement