help with guitar hero for turing
Author |
Message |
tudball33
|
Posted: Mon May 12, 2008 6:32 pm Post subject: help with guitar hero for turing |
|
|
hi, im doing a game for turing similar to guitar hero with or without strumming. i was just wondering if anyone could help me with getting the notes to move down the screen?
any help is great
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon May 12, 2008 6:40 pm Post subject: RE:help with guitar hero for turing |
|
|
how much thought have you put into planning for this game?
drawing the notes is by far not the most difficult part of the project. Are you sure you'll be able to finish it in time?
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
andrew.
|
Posted: Mon May 12, 2008 6:45 pm Post subject: RE:help with guitar hero for turing |
|
|
I don't think actually drawing the notes and making them move is the hard part. I think syncing the music with notes that come at a steady pace is the hard part. How will you make that work? Will you use file I/O so you can add more songs, or will it be embedded in the code so there's only one song?
|
|
|
|
|
|
nastynika
|
Posted: Tue May 13, 2008 8:54 am Post subject: Re: help with guitar hero for turing |
|
|
there are a couple of examples of guitar hero that have already been made if u search the site you could find them and use them as an example
|
|
|
|
|
|
nastynika
|
|
|
|
|
isaiahk9
|
Posted: Sun May 18, 2008 6:28 pm Post subject: RE:help with guitar hero for turing |
|
|
Draw a circle, and give it a y variable. Each time the program runs through the loop, reduce the y variable by 10. If you want it to move into the middle of the screen, make a x variable and add or decrease to that.
|
|
|
|
|
|
Sean
|
Posted: Sun May 18, 2008 7:03 pm Post subject: Re: help with guitar hero for turing |
|
|
Simple for loop miniuplation of the y variable of your notes. Since your notes are circular, you would have these variables within them.
What you need to do is decreasing your Y variable from the top of the screen. So use a decreasing for loop and lower the y variable of your oval.
An example would be this:
|
|
|
|
|
|
tudball33
|
Posted: Tue May 20, 2008 5:15 pm Post subject: RE:help with guitar hero for turing |
|
|
im just in grade 10, so my teacher doesn't expect me to sync the music with it. and i just randomized the notes going down the screen, so thats fine. i just dont know how to make it subtract points when you arent holding down the right note ie. if you are holding down all the notes. is there a way to do it without making all of the "if" statements?
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue May 20, 2008 6:30 pm Post subject: RE:help with guitar hero for turing |
|
|
even though you "just" in grade 10, looking ahead into arrays will help tremendously. If you put the note row into one array and held down keys into another array, it's super simple to compare the patterns and decide what to do.
For example, if the note row is green+red+blue: [1,1,0,1,0]
But the player is holding down green+red+yellow: [1,1,1,0,0]
Then we can see
[1,1,0,1,0]
[1,1,1,0,0]
That we have 2 matches + 1 extra key + 1 missing key. You can decide your point system from there based on those sums. This way your if statement should only concern itself with the number of missed keys and number of extra keys, and it doesn't matter what the actual combination of keys was pressed (there are 2^5 = 32 combinations, which is way too many to write out)
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
tudball33
|
Posted: Tue May 20, 2008 8:09 pm Post subject: RE:help with guitar hero for turing |
|
|
srry i forgot that i have to make a controller-like thing for it on a breadboard. with the input through a parallel port (yes, our school computers are that bad and old lol!) would it work if i did keypress? and then the values of the different keys would change the input? so i could have variables for the different colours
if a(1) = 1 and greenbutton = 1 then
score = score+1
i dont know if that would work because i dont have turing on my computer, but is that the way it would work?
|
|
|
|
|
|
tudball33
|
Posted: Wed May 21, 2008 1:22 pm Post subject: Re: help with guitar hero for turing |
|
|
here is what i have so far. if anyone could help, or get me started with the points system (when you hit a note you get points) it would be great
Description: |
|
Download |
Filename: |
final.t |
Filesize: |
1.1 KB |
Downloaded: |
91 Time(s) |
|
|
|
|
|
|
tudball33
|
Posted: Wed May 21, 2008 1:24 pm Post subject: RE:help with guitar hero for turing |
|
|
it looks like this
var a, b, c, d, e : array 1 .. 20 of int
var points : int
setscreen ("graphics:640;480")
for x : 1 .. 20
a (x) := 0
b (x) := 0
c (x) := 0
d (x) := 0
e (x) := 0
end for
loop
for x : 1 .. 19
a (x) := a (x + 1)
b (x) := b (x + 1)
c (x) := c (x + 1)
d (x) := d (x + 1)
e (x) := e (x + 1)
end for
randint (a (20), 0, 1)
randint (b (20), 0, 1)
randint (c (20), 0, 1)
randint (d (20), 0, 1)
randint (e (20), 0, 1)
cls
locatexy (600, 400)
points := 0
put points
for x : 1 .. 20
if a (x) = 1 then
drawfilloval (100, 20 * x, 8, 8, 47)
end if
end for
for x : 1 .. 20
if b (x) = 1 then
drawfilloval (120, 20 * x, 8, 8, 12)
end if
end for
for x : 1 .. 20
if c (x) = 1 then
drawfilloval (140, 20 * x, 8, 8, yellow)
end if
end for
for x : 1 .. 20
if d (x) = 1 then
drawfilloval (160, 20 * x, 8, 8, 55)
end if
end for
for x : 1 .. 20
if e (x) = 1 then
drawfilloval (180, 20 * x, 8, 8, 42)
end if
end for
delay (500)
end loop
|
|
|
|
|
|
|
|