Posted: Mon Apr 05, 2004 2:56 pm Post subject: need a little bit of help [DDR]
I have an ISP to do, I am re-creating the game Dance Dance revolution, i have a problem though, i get the user to enter watn song they want, but when the game starts, i cannot get any user input (when the arrow matches up and the user hits the key) and my GUI menus will freeze. I could use alittle help now
Sponsor Sponsor
Dan
Posted: Mon Apr 05, 2004 4:00 pm Post subject: (No subject)
well i have not used the music fuctions in turing but i bivle they are blocking. What this means is that it will stop the progam intill it is done playing the song.
so u will have to uses a process to play the music. An example of this can be found in the turing manual witch i copyed in to this post below:
code:
process DoMusic
loop
Music.PlayFile ("branden3.wav")
end loop
end DoMusic
fork DoMusic
var x, y, clr : int
loop
x := Rand.Int (0, maxx)
y := Rand.Int (0, maxy)
clr := Rand.Int (0, maxcolor)
Draw.FillOval (x, y, 30, 30, clr)
end loop
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony
Posted: Mon Apr 05, 2004 7:36 pm Post subject: (No subject)
may I introduce you to the wonders of turing v4.0.5 - althought numerically it is just a slight modification (3rd order increase), it really changed quite a bit (well... introduced quite a bit of new functions)
code:
Music.PlayFileReturn ( fileName : string )
and
code:
Music.PlayFileLoop ( fileName : string )
Both procedures return as soon as file starts playing, so your program can go on. It eliminates the need of setting up your own processes (I have my suspecions on its internal workings, but what do I know )
Posted: Mon Apr 05, 2004 9:10 pm Post subject: (No subject)
thank you, its about time holt software didsomething useful
nightcrawler938
Posted: Tue Apr 06, 2004 7:28 am Post subject: (No subject)
thanks guys the music coomand really worked well, however, it still proves that it is impossible to run music and recieve input at the same time, anyway around that i can get all arrows to appear, but user input freezes it up
nightcrawler938
Posted: Tue Apr 06, 2004 8:56 am Post subject: (No subject)
also, i don't know what i should do for arrows, use grid ?
Dan
Posted: Tue Apr 06, 2004 3:39 pm Post subject: (No subject)
nightcrawler938 wrote:
thanks guys the music coomand really worked well, however, it still proves that it is impossible to run music and recieve input at the same time, anyway around that i can get all arrows to appear, but user input freezes it up
Hacker Dan wrote:
well i have not used the music fuctions in turing but i bivle they are blocking. What this means is that it will stop the progam intill it is done playing the song.
so u will have to uses a process to play the music. An example of this can be found in the turing manual witch i copyed in to this post below:
code:
process DoMusic
loop
Music.PlayFile ("branden3.wav")
end loop
end DoMusic
fork DoMusic
var x, y, clr : int
loop
x := Rand.Int (0, maxx)
y := Rand.Int (0, maxy)
clr := Rand.Int (0, maxcolor)
Draw.FillOval (x, y, 30, 30, clr)
end loop
it works, realy, i dont just make this stuff up. i have had input and muscik at the same time.
look:
code:
process DoMusic
loop
Music.PlayFile ("streamsound1.mp3")
end loop
end DoMusic
fork DoMusic
var temp:string
loop
get temp
put temp
end loop
works and so dose this in turing 4.0.5
code:
var temp:string
Music.PlayFileReturn ("streamsound1.mp3")
loop
get temp
put temp
end loop
but now you may say that it has to do with turing GUI but it dose not
code:
import GUI
procedure DrawRandomCircle
Music.PlayFileReturn ("streamsound1.mp3")
var r : int := Rand.Int (20, 50)
var x : int := Rand.Int (r, maxx - r)
var y : int := Rand.Int (r, maxy - r)
var c : int := Rand.Int (0, maxcolor)
Draw.FillOval (x, y, r, r, c)
% In case we drew over the buttons, redraw them.
GUI.Refresh
end DrawRandomCircle
View.Set ("graphics:300;200,nobuttonbar ")
var draw : int := GUI.CreateButtonFull (50, 10, 0, "Draw Circle",
DrawRandomCircle, 0, '^D', true)
var quitBtn : int := GUI.CreateButton (200, 10, 0, "Quit", GUI.Quit)
loop
exit when GUI.ProcessEvent
end loop
works fine. sory if i seem pissed but so far you have made over 5 topics realting to this and i dont think you even tryed our solction.
you are knew to the site so i gusse i can undersant it, but plz dont post the same question many many many times. one time in turing help with a good suject name is fine.
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
limited_skillz
Posted: Tue Apr 06, 2004 4:10 pm Post subject: (No subject)
i tried creating this game as well, i sorta failed though
check out my code though, its not efficient at all, i was such a n00b 3 months ago
just create a text file with numbers 1-4 for the arrows
ex.
1
2
1
3
4
2
1
save as trial.step
when i get the time this weekend, ill redo it because now i know objects
Posted: Tue Apr 06, 2004 7:43 pm Post subject: (No subject)
i have tried it, and i works great but the problem is not just that i must press spacebar to pause music and then the arrows go up and still cannot recieve input, the arrows go up and then the game freezes
DDR4.T
Description:
DDR, missing some pic and sound files, since zip file is too big
Posted: Tue Apr 06, 2004 8:03 pm Post subject: (No subject)
nightcrawler - you should be ashamed of yourself Perhaps you should start paying attention in class - Shannon is a great teacher
code:
procedure DoMusic
%put usong
if usong = "Sandstorm" then
Music.PlayFileLoop ("Darude - Sandstorm.MP3")
loop
exit when hasch
end loop
Music.PlayFileStop
elsif usong = "Speedway" then
Music.PlayFileLoop ("speedway.wav")
loop
exit when hasch
end loop
Music.PlayFileStop
end if
end DoMusic
now plz tell me - why do you have those loops in there?!
also why do you set your screen and declear all your menu variables insdie the input procedure?!
I'm sorry - I don't mean offence - but the code looks like shit Maybe you should consider making another game for your project
Posted: Tue Apr 06, 2004 9:18 pm Post subject: (No subject)
i do pay attention, i manage to have 94 % in that calss , i don't really have time to change, you should have seen the code before, it is all bs, i re did my format to make it neater, especially with the GUI Menus,
i have the loops there because hacker dan told me, err, i didn't realize, now i do, but when this happens and the game starts, the GUI MEnus disapper (cls) or the arrows cause streaking effect, so i tried to recreate them, i could use GUI.Dispose, since i'm familiar with that, i also thought of using rand,int to determine where the arrows go (with specific perameters), ?SO MANY PROBELMS,
however turing 4.0.5, helped alot and i thank you for your help
Tony
Posted: Tue Apr 06, 2004 10:43 pm Post subject: (No subject)
well mark in class doesn't mean much
anyways - I'm suspecting that your main problem is the fact that you desided to use turing's GUI you might consider dropping it and writing your own UI
Posted: Wed Apr 07, 2004 7:16 am Post subject: (No subject)
well i know how to make a GUI button, but have no clue on making my own GUI Menu, would that possibly solve all my problems, shannon thinks i'm going into a whole new world, even i though i agree with Turing's GUI screwing up my entrie program , is there no way around it
Tony
Posted: Wed Apr 07, 2004 8:04 am Post subject: (No subject)
nope You see that
code:
loop
exit when GUI.ProcessEvent
end loop
?
That what's driving your GUI and that is preaty much your entire program. Unless you use GUI for user input you just can't tell what user is doing.
You are going into a whole new world and it ain't preaty.
Posted: Wed Apr 07, 2004 8:15 am Post subject: (No subject)
no kidding , but anywho, that loop is crucial, because without it, the menus don't drop down, shannon has informed me that,i've already technically created my own, GUI items, she thinks that creating my own GUI, will screw me over!!!