
-----------------------------------
nightcrawler938
Mon Apr 05, 2004 2:56 pm

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 :D

-----------------------------------
Dan
Mon Apr 05, 2004 4:00 pm


-----------------------------------
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:


       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


-----------------------------------
Tony
Mon Apr 05, 2004 7:36 pm


-----------------------------------
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)

Music.PlayFileReturn ( fileName : string )

and

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 :roll: )

You could stop your music at any time using

Music.PlayFileStop


-----------------------------------
nightcrawler938
Mon Apr 05, 2004 9:10 pm


-----------------------------------
thank you, its about time holt software didsomething useful

-----------------------------------
nightcrawler938
Tue Apr 06, 2004 7:28 am


-----------------------------------
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
Tue Apr 06, 2004 8:56 am


-----------------------------------
also, i don't know what i should do for arrows, use grid ?

-----------------------------------
Dan
Tue Apr 06, 2004 3:39 pm


-----------------------------------
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

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:


       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:


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


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



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.

-----------------------------------
limited_skillz
Tue Apr 06, 2004 4:10 pm


-----------------------------------
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

-----------------------------------
nightcrawler938
Tue Apr 06, 2004 7:43 pm


-----------------------------------
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

-----------------------------------
Tony
Tue Apr 06, 2004 8:03 pm


-----------------------------------
nightcrawler - you should be ashamed of yourself :roll: Perhaps you should start paying attention in class - Shannon is a great teacher :wink:

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 :think:

-----------------------------------
nightcrawler938
Tue Apr 06, 2004 9:18 pm


-----------------------------------
i do pay attention, i manage to have 94 % in that calss  :D , 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
Tue Apr 06, 2004 10:43 pm


-----------------------------------
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 :think: you might consider dropping it and writing your own UI

-----------------------------------
nightcrawler938
Wed Apr 07, 2004 7:16 am


-----------------------------------
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 :x , is there no way around it

-----------------------------------
Tony
Wed Apr 07, 2004 8:04 am


-----------------------------------
nope :lol: You see that

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.

-----------------------------------
nightcrawler938
Wed Apr 07, 2004 8:15 am


-----------------------------------
no kidding :x , 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!!!

-----------------------------------
omni
Wed Apr 07, 2004 4:15 pm


-----------------------------------
I think what tony means is to get rid of TURING GUIS. Make your own from scratch. Draw your own boxes, then do a loop with mousewhere in it. 

proc drawOWNmenu
drawboxes..
..
end drawOWNmenu

loop
mousewhere
(if user clicked on the box area, then do whatever that button was supposed to) 
end loop

A good rule is don't use someones routine if you can't understand it yourself.
In other words, dont use TURING GUIS.

-----------------------------------
Dan
Wed Apr 07, 2004 6:40 pm


-----------------------------------
i dont know how good a rule that is...

i mean if u falow that stricly, i dont think most poleop could uses put or get. u know that it puts stuff on the screen but no one knows exctaly how b/c we can not see the code for it.

-----------------------------------
Tony
Wed Apr 07, 2004 6:56 pm


-----------------------------------
nightcrawler - reason that Turing GUI will screw you over is because it is badly writen and it hoggs the processing power (that never ending ProcessEvent loop).

Does shannon use MSN? :think: or just tell her to actually read compsci once in a while - it might help her with teaching :wink:

-----------------------------------
nightcrawler938
Wed Apr 07, 2004 7:54 pm


-----------------------------------
yeah, shannon doesn't know all the answers, but still is a great teacher, well today i discovered that removing GUI speeds up my arrow movement, Turing pusts this natural delay of  (3), err, well now i need to determine wether or not to use hasch or input key down :think: 
heres my new improved code!

-----------------------------------
Tony
Wed Apr 07, 2004 8:03 pm


-----------------------------------
defenatly Input.KeyDown if you want to have two players and/or have two arrows pressed down at same time

-----------------------------------
nightcrawler938
Thu Apr 08, 2004 7:24 am


-----------------------------------
acutally, i started using GUI.SetEventKeyHandler,it works well, but a few bugs

-----------------------------------
equs
Thu Apr 08, 2004 8:41 pm


-----------------------------------
Shannon is a great teacher. I am in michelas class and his code is great and his program is good, just its to compliated.Well to complicated for me. IM having trouble making a grid in snake and collision detection. I wonder if Tony could help me? lol.  Tony were you in Shannons class?

-----------------------------------
Tony
Thu Apr 08, 2004 11:58 pm


-----------------------------------
Tony were you in Shannons class?
yes :lol: grades 10 and 11 CS

snake eh? ask Shannon about turing v3.1 snake days :wink: Fun times. The code was horrible though, I used to be such a bad programming :roll:

-----------------------------------
nightcrawler938
Fri Apr 09, 2004 3:00 pm


-----------------------------------
tony, input.keydown doesn't work so well, should i put it in my game procedure or call it separatly  :?:

-----------------------------------
Tony
Fri Apr 09, 2004 3:04 pm


-----------------------------------
huh :? what do you mean?

Idealy you would call it right before you check user's input.

-----------------------------------
nightcrawler938
Sat Apr 10, 2004 1:29 pm


-----------------------------------
i mean that, the computer can only recieve input before the music plays and the arrows move, so i've tried decrlaing it as a procedure, then calling it the game procedure, i've kinda tried to put the input in the game procedure but it doesn't work

-----------------------------------
white_dragon
Sat Apr 10, 2004 1:31 pm


-----------------------------------
try foolin round with forkin the process and procedures. tat might help a little.

-----------------------------------
Tony
Sat Apr 10, 2004 3:36 pm


-----------------------------------
no, no processes :evil: damn it people, if there's one thing you don't fork - that's input!

Now then... the reason input doesn't work is because you never call the procedure :? That largely has to do with the fact that you have GUI. So you have to put your game loop inside of the GUI loop

Music.PlayLoopReturn %or something
loop
draw background
draw arrow
Input.KeyDown
process input
exit when GUI.ProcessEvents
end loop


-----------------------------------
nightcrawler938
Sat Apr 10, 2004 4:48 pm


-----------------------------------
makes sense, however i assume that process input is the input recieved from the user

-----------------------------------
nightcrawler938
Fri Apr 16, 2004 8:23 am


-----------------------------------
tony, i think i solved, my porblem, just wanted verification, since my arrows are picture files, could that be the reason why, i recieve input before arrows showup :?: :?:  :?: , because i have started to draw my own arrows

-----------------------------------
Tony
Fri Apr 16, 2004 9:55 am


-----------------------------------
Input.KeyDown is input. By process I ment analyze

anyways.. I'm not sure what you mean by having input before pictures show up :?

-----------------------------------
nightcrawler938
Mon Apr 26, 2004 1:24 pm


-----------------------------------
since i am using picture files for the animated arrows, i am not able to recieve input while the picture files are moving, so a friend recommended i create my own arrows, using drawline etc, what do you think?

-----------------------------------
Tony
Mon Apr 26, 2004 4:28 pm


-----------------------------------
i think it's not going to make any difference since instead of drawing the picture you'll just be calling a procedure to draw the arrow using turing gfx :? 

what you need to do is to check for input in between the arrow movement, as in

Move/Draw
Check Input
Move/Draw
Check Input
... etc

btw - what's shannon's email? she doesn't seem to be replying :think:

-----------------------------------
nightcrawler938
Wed Apr 28, 2004 8:09 am


-----------------------------------
no , she recieved your message

-----------------------------------
nightcrawler938
Wed May 19, 2004 7:55 am

EDITED: DDR
-----------------------------------
hey its been a while but i have acomplished alot :P , take a look, i still have to verify if user keys mat ches att he exact time the idsplayed image does.

-----------------------------------
Ultimus
Wed May 19, 2004 10:57 am


-----------------------------------
Hmmm I can't seem to get it working...

Anyways, if you're trying to make a DDR simulator, it will be best if you just use the DWI file format, so people can use their own stepcharts without converting them. Tell me if you're interested, I might be able to help you there. I was once on the dev team of Stepmania.

-----------------------------------
nightcrawler938
Thu May 20, 2004 8:19 am


-----------------------------------
hmm, that would be appreciated, i have played stepmania before, plus my program wasn't working cause you were missing some music files and picture files, send me a message, because DWI patterns would help alot :D

-----------------------------------
nightcrawler938
Thu May 20, 2004 8:30 am


-----------------------------------
oh yeah, to whoever  downloads my program, you'll need some picture and music files, ask me for them

-----------------------------------
Tony
Thu May 20, 2004 12:37 pm


-----------------------------------
maybe you should just zip everything into one nice working zip file and upload it :)

-----------------------------------
nightcrawler938
Fri May 21, 2004 8:12 am


-----------------------------------
my zip would be too large, i've tried before, this is because of the sound and picture files, meh, i'll try again sometime

-----------------------------------
Josh_VK
Sun May 23, 2004 12:28 am


-----------------------------------
Dude just post it.. so everyonw knows what your talking about..
it will fit if zipped im sure

-----------------------------------
Paul
Sun May 23, 2004 10:18 am


-----------------------------------
lol, we only get what, 2 mb of space? a large zipped mp3 or 2 would excede that limit.

-----------------------------------
Josh_VK
Sun May 23, 2004 11:22 am


-----------------------------------
yeah mabey your right.. i dunno.. host it someplace? lol

-----------------------------------
nightcrawler938
Sun May 23, 2004 2:42 pm


-----------------------------------
i can post it on my website, but that also doesn't have enough space... :roll: , and i 'm lazy, if you need it badly i 'll send it to whoever needs it

-----------------------------------
Dan
Tue May 25, 2004 2:12 pm


-----------------------------------
while if u tell us exactly how much it will take up we can adjusted your size limits for uploads on this site. PM if u still whont to upload it here and i will add some MBs on.

-----------------------------------
nightcrawler938
Fri May 28, 2004 7:22 pm


-----------------------------------
ok, i need help in recieving input at the exact moment the keys hit the stationary keys

i've used Input.Keydown, however when the eact moment come and the user hits the correct key i need it to display either excellent, or miss any suggestions, i think locatexy would work

-----------------------------------
nightcrawler938
Tue Jun 01, 2004 7:25 am


-----------------------------------
i finished DDR, ask to see, it exactly like DDR to each intricate detail
