Playing music while displaying an animation
Author |
Message |
illu45
![](http://img9.exs.cx/img9/1348/roadavvy2ht.png)
|
Posted: Sun Mar 13, 2005 1:28 pm Post subject: Playing music while displaying an animation |
|
|
Hello all...
I'm trying to make a dancing guy while playing music. I've managed to make the dancing guy, but if I plug in the code for music, the animation doesn't start until the music is finished... As I don't think Turing has multi-threading, I guess I'm kinda screwed, but I figure I'd ask first... Here's my code so far (without the music command)
code: |
var i, row, col : int := 1
i := 1
locatexy (290, 190)
put "Get up!"
delay (750)
cls
locatexy (280, 190)
put "Get on up!"
delay (750)
cls
locatexy (290, 190)
put "Get up!"
delay (750)
cls
locatexy (280, 190)
put "Get on up!"
delay (750)
cls
locatexy (280, 190)
put "And DANCE!"
delay (750)
cls
put ":D-<"
loop
if i = 1 then
delay (100)
cls
locate (row, col)
put ":D|-<"
row := row + 1
if row > 25 then
col := col + 10
row := 1
end if
if col > maxcol then
col := 1
row := 1
end if
i := 2
elsif i = 2 then
delay (100)
cls
locate (row, col)
put ":D/-<"
row := row + 1
if row > 25 then
col := col + 10
row := 1
end if
if col > maxcol then
col := 1
row := 1
end if
i := 1
end if
end loop
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 13, 2005 2:04 pm Post subject: (No subject) |
|
|
silly illu45 reading documentation is your friend. You can ether make a new thread with process / fork or just use Music.PlayFileReturn() (I think that's the command, check F10) that will create a new thread for you.
|
|
|
|
|
![](images/spacer.gif) |
illu45
![](http://img9.exs.cx/img9/1348/roadavvy2ht.png)
|
Posted: Sun Mar 13, 2005 2:36 pm Post subject: (No subject) |
|
|
Oh.. whoops . I looked at the documentation, it works now... Thanks
Here's the code, if someone wants it:
code: |
var i, row, col : int := 1
i := 1
locatexy (290, 190)
put "Get up!"
delay (750)
cls
locatexy (280, 190)
put "Get on up!"
delay (750)
cls
locatexy (290, 190)
put "Get up!"
delay (750)
cls
locatexy (280, 190)
put "Get on up!"
delay (750)
cls
locatexy (280, 190)
put "And DANCE!"
delay (750)
cls
process music
Music.PlayFileLoop ("Music.MP3")
end music
process dance
put ":D-<"
loop
if i = 1 then
delay (100)
cls
locate (row, col)
put ":D|-<"
row := row + 1
if row > 25 then
col := col + 10
row := 1
end if
if col > maxcol then
col := 1
row := 1
end if
i := 2
elsif i = 2 then
delay (100)
cls
locate (row, col)
put ":D/-<"
row := row + 1
if row > 25 then
col := col + 10
row := 1
end if
if col > maxcol then
col := 1
row := 1
end if
i := 1
end if
end loop
end dance
fork music
fork dance
|
Feel free to use your own music, I used 'One more Time' .
|
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Sun Mar 13, 2005 3:27 pm Post subject: (No subject) |
|
|
Looking at your code, you need MUSIC.mp3 for anything to play.
But I've never seen a stickman done like that, thanks
|
|
|
|
|
![](images/spacer.gif) |
illu45
![](http://img9.exs.cx/img9/1348/roadavvy2ht.png)
|
Posted: Sun Mar 13, 2005 5:41 pm Post subject: (No subject) |
|
|
Glad you liked it... It was inspired by (ripped off of) This bash.org Quote:
http://www.bash.org/?4281
<Zybl0re> get up
<Zybl0re> get on up
<Zybl0re> get up
<Zybl0re> get on up
<phxl|paper> and DANCE
* nmp3bot dances -<
* nmp3bot dances |-<
* nmp3bot dances /-<
<[SA]HatfulOfHollow> i'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
|
|
|
|
|
![](images/spacer.gif) |
ssr
![](http://siruisite.port5.com/ssr.jpg)
|
Posted: Sun Mar 13, 2005 8:28 pm Post subject: (No subject) |
|
|
nice
lol funny
post ur music too eh
|
|
|
|
|
![](images/spacer.gif) |
illu45
![](http://img9.exs.cx/img9/1348/roadavvy2ht.png)
|
Posted: Mon Mar 14, 2005 10:02 am Post subject: (No subject) |
|
|
Hmm.. I'm having some trouble uploading the file (It's about 8 MBs in size, which is below the limit...) Any ideas? Here's the error message:
Upload Error: Could not upload Attachment to ./../bbs/files/music.zip.
|
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Mon Mar 14, 2005 10:07 am Post subject: (No subject) |
|
|
illu45 wrote: It's about 8 MBs in size, which is below the limit...
actually your limit (same as any other new user) is 2MB I could upgrade that for you as needed, but I'm questioning your 8MB music uploads
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
illu45
![](http://img9.exs.cx/img9/1348/roadavvy2ht.png)
|
Posted: Mon Mar 14, 2005 11:47 am Post subject: (No subject) |
|
|
Ah... All right... Um, no need to upgrade my storage capacity yet... The file is large, probably becasue its pretty long (6:07 mins)... I'll see if I can get a smaller version (a sample).
EDIT: All right, I found a sample of another song that seems to work pretty well... Here it is:
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
Music.zip |
Filesize: |
231.29 KB |
Downloaded: |
114 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
atrain
|
Posted: Wed Mar 16, 2005 6:54 pm Post subject: (No subject) |
|
|
it should go:
: D /-<
: D |-<
: D \-<
clearly about to see...
|
|
|
|
|
![](images/spacer.gif) |
atrain
|
Posted: Wed Mar 16, 2005 6:56 pm Post subject: (No subject) |
|
|
hmm never mind crashed when i tried... stupid turing
|
|
|
|
|
![](images/spacer.gif) |
|
|