Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Dance test

Author
Message
kage
21
Years of Service
User Offline
Joined: 7th Jan 2004
Location:
Posted: 7th Jan 2004 19:17 Edited at: 7th Jan 2004 19:18
Hey all,

I have this little problem wiv this test i am trying to complete to see if i can make a sort of dancemat game using darkbasic. What I need help wiv is the code to count the beats of a song. I dont kno how to do it, so wiv the example code, i jus made the prog count time b4 it printed the next number, and it stays accurate 4 bout 30 seconds of the song and then drifts off, either going faster or slower than the song. Is there any way in darkbasic becoz 1000 equals 1 second, to get it using code to count 1,2,3,4 accuratly all the way thru the song?

If you can help me you help wil b greatly appreciated. As you can prob see lol, am not v gd at programming but wanted to see if i could get it to count , n gettin it to do this is prob v simple to u

The code I used is in the source part of the message

Thx
KaGe

KaGe
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 7th Jan 2004 19:19
i think the sync has to be exactly 60 in order for it to count 1000 equals 1 second...i could be wrong

Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 7th Jan 2004 19:28
I'm sure therez a way to read an internal clock timer (even to the second maybe even millisecond. you could run it with that?

Somehow make a loop to check the timer advance on the clock ( I think it may even be the system clock) to keep check of the beats

Ok so its not a mouse.
kage
21
Years of Service
User Offline
Joined: 7th Jan 2004
Location:
Posted: 7th Jan 2004 20:02
Hey,
thx Darwin 4 the idea of puttin the sync rate 2 60
but doesn't seem to make a difference, i thought it wud of dun actually like u thought after i got the post from u. but nope

n thx Penfold 4 the idea on usin the internal clock, but i hav no idea wat the code wud b n how it wud get the beats right exactly becoz its stil usin the rule of milliseconds , but possibly becoz its not doin 1000 in 1 second, the beat mite b mroe accurate. any ideas on the code?

I got an idea though that i thought would work. I set the song goin, and then on my keybord I got the tempo right wiv the drum beat playin usin accompliment. I then thought if theres 60,000 in 1 min in darkbasic then if i do this sum on a calculator "60000 / 137 (the beat the keyboard took the beat at), i thought if i pressed equals i sud get the exact beat in the 1000 second form, but obviously i was wrong as the beat was too slow.

thx 4 ur help
KaGe

KaGe
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 7th Jan 2004 22:32 Edited at: 7th Jan 2004 22:34
Ooh something I can code...lalala..

I feel kinda special now I've been playing around on here for a few weeks now learning some stuff now I can pass some help on.

This is what you wanted...change the name of the file you want to load and then change the bits I've stated in the code to change the other stuff like the beat timer.

Code in source below. I hope it still works..

This code will just load the music file and start a 1 second beat. as you asked.

Ok so its not a mouse.
kage
21
Years of Service
User Offline
Joined: 7th Jan 2004
Location:
Posted: 8th Jan 2004 12:58
Hey,
Thx alot Penfold, the code works gr8

It counts completly accuratly after I do that sum that i mentioned b4 (60000/? *the beat* and then puttin that in place of 1000.

There are a one question I hav bout the code tho:

Why does it have to run at 40 fps to run properly? (summit to do wiv the beats) or is that jus the way u put it?

What I actually wanna finally achieve wiv this dance test is seein if i can get one where arrows cum up on the beat which at this time wud hav to b pressed on the keyboard. I kno this is probably possible to do when the beat is now accurate so i'll av a go lol.

Hav u possibly got any pointers on how this cud b achieved?

This wud b usin either 3d models that wud scroll *sumhow in beat* or sprites (But i dont kno how to move them across the screen frame by frame instead of one frame it bein there, n the next frame it bein where it was suppsoed to end movin)

So is there a way of main that code work wiv objects or sprites so they move within beat to the music so u hva to press the buttons on the beat as they reach the top? (which wud b on each beat on a hard mode). If u hva seen any dancemat games like on the ps2 u'll prob kno wot i mean by this.

I hav managed to create a text menu system so when u press numbers it chooses the song corrispondin to the number which also chnages the beat time. Am jus gonna try n create one wiv images which u hva to click next, so i can create a menu system

Thx alot 4 al ur help,
If i actually get any where wiv this ur name wil def b in credits.

KaGe

KaGe
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 8th Jan 2004 19:31 Edited at: 8th Jan 2004 19:33
Um I could probably figure something out..

You'd definetly need to put a function in the main loop that moves a 3d object or sprite down the screen.

Something that would work out a starting position at the bottom (if it was traveling up) so that it would hit a specific position on the beat.

You could alter teh code a heck of a lot to check if sprite had overlapped or 3d objects had collided to know if you had hit the beat at the right time.

Oh and the sync rate doesn't need to be 40 to work. I just put that in so the update would work. remember though if you change the sync rate in the code I gave it will alter the length of time the beat text is displayed depending on what you change the sync rate to and how well your comp keeps up if you put the rate too high.

You'd have to check in 2d and 3d forums I think on the specifics of this cuz I'm not too good at this YET!

Ok so its not a mouse.
kage
21
Years of Service
User Offline
Joined: 7th Jan 2004
Location:
Posted: 9th Jan 2004 01:58
Hey,
Thx,

I'll hav a go to see if i can get anywhere
I'll try usin 3d objects first prob, n then do sprites if i hav success (in my opinion sprites wud b harder to move round tho)

N wiv the menu system i hav set up to select songs, it is only basic, givin text commands at the top and u press 1,2 etc to get each song to play and it changes the code appropitatly. Hopefully I can get possibly sum things u can click to select the songs in the nxt day or 2

Like i said, am not that gd at programmin ...at the mo , n cud not create summit liek the code u gav me lol. Even tho av had the prog 4 bout 1 1/2 years...oh wel

Any more ideas anyone on how a dance mat game cud work?
lol maybe if i finish it i can post it...but i doubt i'll eva get it complete(not the way i am wiv programmin anyways) but i'll av a go

Thx 4 al ur help
KaGe

KaGe

Login to post a reply

Server time is: 2025-05-22 06:21:23
Your offset time is: 2025-05-22 06:21:23