Guitar hero project?

Discussion in 'Programming General' started by kharg0, Feb 4, 2008.

Thread Status:
Not open for further replies.
Guitar hero project?
  1. Unread #1 - Feb 4, 2008 at 6:37 PM
  2. kharg0
    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0

    kharg0 Active Member

    Guitar hero project?

    I'm in the midsts of creating a guitar hero with visual basic i have button pressing down but i need more (i also have the part that makes the pictures move across the page)

    what i need is... i need some one who can help me make this by, using a location to see if you missed the note...

    i have..
    Code:
    if picturebox1.location.x = 10 or 15 or 20 or 25 or 30 or 35 or 40 or 45 or 50 then picturebox1.location.x = 0

    eDIT!
    Already a new update now i am able to press a key and send the notes down a line


    Edit...
    Code:
    Public Class Form1
        Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
        Public Const VK_F9 = &H78
    
        Private Sub PictureBox9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox9.Click
            Me.Close()
        End Sub
    
        Private Sub Keyboardtimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Keyboardtimer.Tick
            If GetAsyncKeyState(Keys.F1) And PictureBox10.Location.Y = 550 Or 545 Or 540 Or 535 Or 530 Or 525 Or 520 Or 515 Or 510 Or 505 Or 500 Then
                keytime.Enabled = False
                PictureBox10.Location = New Point(PictureBox10.Location.X, PictureBox10.Location.Y = 0)
                keytime.Enabled = True
            Else : My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If GetAsyncKeyState(Keys.F2) And PictureBox12.Location.Y = 550 Or 545 Or 540 Or 535 Or 530 Or 525 Or 520 Or 515 Or 510 Or 505 Or 500 Then
                t2.Enabled = False
                PictureBox12.Location = New Point(PictureBox12.Location.X, PictureBox12.Location.Y = 0)
                t2.Enabled = True
            Else : My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If GetAsyncKeyState(Keys.F3) And PictureBox13.Location.Y = 550 Or 545 Or 540 Or 535 Or 530 Or 525 Or 520 Or 515 Or 510 Or 505 Or 500 Then
                t3.Enabled = False
                PictureBox13.Location = New Point(PictureBox13.Location.X, PictureBox13.Location.Y = 0)
                t3.Enabled = True
            Else : My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If GetAsyncKeyState(Keys.F4) And PictureBox14.Location.Y = 550 Or 545 Or 540 Or 535 Or 530 Or 525 Or 520 Or 515 Or 510 Or 505 Or 500 Then
                t4.Enabled = False
                PictureBox14.Location = New Point(PictureBox14.Location.X, PictureBox14.Location.Y = 0)
                t4.Enabled = True
            Else : My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If PictureBox10.Location.Y = 555 Then
                My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If PictureBox12.Location.Y = 555 Then
                My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If PictureBox13.Location.Y = 555 Then
                My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
            If PictureBox14.Location.Y = 555 Then
                My.Computer.Audio.Play("C:\WINDOWS\Media\chord.wav", AudioPlayMode.Background)
            End If
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Keyboardtimer.Enabled = True
        End Sub
    
        Private Sub keytime_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keytime.Tick
            PictureBox10.Location = New Point(PictureBox10.Location.X, PictureBox10.Location.Y + 5)
        End Sub
    
        Private Sub t2_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t2.Tick
            PictureBox12.Location = New Point(PictureBox12.Location.X, PictureBox12.Location.Y + 5)
        End Sub
    
        Private Sub t3_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t3.Tick
            PictureBox13.Location = New Point(PictureBox13.Location.X, PictureBox13.Location.Y + 5)
        End Sub
    
        Private Sub t4_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t4.Tick
            PictureBox14.Location = New Point(PictureBox14.Location.X, PictureBox14.Location.Y + 5)
        End Sub
    
        Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox5.Click
            keywait.Enabled = True
            w2.Enabled = True
            w3.Enabled = True
            w4.Enabled = True
        End Sub
    
        Private Sub keywait_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keywait.Tick
            keytime.Enabled = True
        End Sub
    
        Private Sub w2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w2.Tick
            t2.Enabled = True
        End Sub
    
        Private Sub w3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w3.Tick
            t3.Enabled = True
        End Sub
    
        Private Sub w4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w4.Tick
            t4.Enabled = True
        End Sub
    End Class
    thats my code overall but im still getting problems
    1.when i start up my program the pictures just shake? (look at keyboardtimer because it starts on form load)
     
  3. Unread #2 - Feb 4, 2008 at 9:33 PM
  4. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Guitar hero project?

    I don't think it would work because you need to specify each time what needs to be that number in an if statement you can't just go and 35 or 40 or 45.

    You should try shortening your if statements like so.

    Code:
    if picturebox1.location.x >= 10 and picturebox1.location.x <= 50 then picturebox1.location.x = 0
    
     
  5. Unread #3 - Feb 4, 2008 at 10:20 PM
  6. kharg0
    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0

    kharg0 Active Member

    Guitar hero project?

    omg thanks i needed that so bad
    i was wondering how to put a range instead of random numbers
    thanks man

    1>!!!!!!!!!!!!!!! ok i need to know why it's ignoring my requests

    i tell it
    Code:
    If GetAsyncKeyState(Keys.F1) And PictureBox10.Location.Y >= 400 And PictureBox10.Location.Y <= 550 Then
    and it doesnt work? is there something wrong with my code ??

    please help with this soon
    peace out b town..
     
  7. Unread #4 - Feb 4, 2008 at 11:25 PM
  8. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Guitar hero project?

    Ok here is a working example that I tried myself. It is shorter and cleaner.

    Code:
        Dim minallow As Integer = 450
        Dim maxallow As Integer = 500
    
        Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
            If e.KeyCode = Keys.F9 Then
                If PictureBox1.Location.Y >= minallow And PictureBox1.Location.Y <= maxallow Then
                    PictureBox1.Location = New Point(PictureBox1.Location.X, 0)
                End If
            End If
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            If PictureBox1.Location.Y <= maxallow Then
                PictureBox1.Location = New Point(PictureBox1.Location.X, PictureBox1.Location.Y + 5)
            Else
                ' Missed note
                PictureBox1.Location = New Point(PictureBox1.Location.X, 0)
            End If
        End Sub
    
     
  9. Unread #5 - Feb 4, 2008 at 11:29 PM
  10. kharg0
    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0

    kharg0 Active Member

    Guitar hero project?

    Aight thx stuart real big help really

    my stupid program it wont work rite ill try a diff prog

    ?!?! somethings wrong with my code somewhere it works wen i start over on a new application but not wih the one im using
     
  11. Unread #6 - Feb 4, 2008 at 11:31 PM
  12. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Guitar hero project?

    I edited it again

    Edit - third time

    yw
     
  13. Unread #7 - Feb 5, 2008 at 12:35 AM
  14. kharg0
    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0

    kharg0 Active Member

    Guitar hero project?

    nicely done stuart your in my credits as a partner

    and i fixed the problem

    do know of a way we cloukld nake ikt random beats not just all in a pattern

    Perfect idea hard code.. we could use import music and if vb can do this scan the music for loud parts and spft partsand send the correct key down when it hard or soft!

    if anyone who owns vb hard knows how to do this please post

    please reply any post would be nice,
     
  15. Unread #8 - Feb 11, 2008 at 9:47 PM
  16. cooladrrang
    Joined:
    Jan 21, 2007
    Posts:
    125
    Referrals:
    0
    Sythe Gold:
    0

    cooladrrang Active Member

    Guitar hero project?

    just if you wanted to know this already exists i dont know if its on visual basic but this is its name Frets on Fire you can get ideas from it and make them better
     
  17. Unread #9 - Feb 11, 2008 at 11:25 PM
  18. Michael3455
    Joined:
    Sep 11, 2005
    Posts:
    134
    Referrals:
    0
    Sythe Gold:
    0

    Michael3455 Active Member

    Guitar hero project?

    Yeah, Frets on Fire is another guitar hero clone, and it's very good. You can make your own songs, or import them from Guitar Hero.

    Instead of just re-inventing the wheel, you should try and help improve Frets on Fire. It's open source so you can easily edit and change it.

    Also, Frets on Fire is written in Python so it'd be pretty easy for you to pick it up and be able to follow the code quite easily.
     
  19. Unread #10 - Feb 14, 2008 at 6:07 PM
  20. kharg0
    Joined:
    Feb 25, 2007
    Posts:
    131
    Referrals:
    0
    Sythe Gold:
    0

    kharg0 Active Member

    Guitar hero project?

    yea my prob with frets on fire is that my cp is crap and wont load it so im making my own and theres also flash hero for computer its online how do u edit frets on fire?

    and i coukld use an ax media player to play the song then use a sound recorder to record and listen?
     
  21. Unread #11 - May 21, 2010 at 12:49 PM
  22. neiba
    Joined:
    May 21, 2010
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0

    neiba Newcomer

    Guitar hero project?

    hi... i'm making a guitar hero project with visual basic... i can understand your code except one part: "timer1.tick"

    what is that?
     
  23. Unread #12 - May 21, 2010 at 6:14 PM
  24. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    Guitar hero project?

    Nice gravedig.
     
< [HELP] How do I make my VB2k8 Program open and edit .ff files? | need Trial Timer code >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site