Results 1 to 11 of 11

Thread: Shooting

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216

    Shooting

    I am making a shooting game but i cant make the right click button to shoot. How can i shoot and make the right mouse button the activate (w/e you call it)

    tia

  2. #2
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    VB Code:
    1. If Button = 1 Then 'means if mouse button = left then
    2. If Button = 2 Then 'means if mouse button = right then
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    thanks... i keep on getting a compile error - Block i without end if

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    If you have more then on eline after the IF...you have to end it with End if...

    If Button = 1 Then
    'means if mouse button = left then
    ...more lines
    ....more lines
    end if

    If Button = 2 Then
    'means if mouse button = right then
    ...more lines...
    ,,,...more line....
    end if

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    ok thanks but it doesnt solve my shooting problem.

    (yes i solved the compile error after i saw that i had 2 end if's)
    Last edited by james14; Nov 14th, 2002 at 02:30 PM.

  6. #6
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245
    What he's saying is that the problem isn't in determining the right mouse button, but in that you've got an unclosed block somewhere. You'll get the error you mention if you have an If without an End If, or a With without an End With, or a Select without an End Select. It could be anywhere in the routine it craps out on, not necessarily on the line it points you to.
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

  7. #7
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I'm not sure anymore if i understand your problem anymore....do you still have a compile error...or is the code just not workin....have you put the code in the...

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    End Sub


    ...event????

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    yeah i solved that after i posted that but i want to shoot but i dont know how.

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    You have to tell me more about how you want the shooting too look like. Is it a 2D game...Scrollong game??? Etc...

    Look at this in the mean time...
    http://www.vbforums.com/showthread.p...hreadid=211059

  10. #10
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    ok.... ill post what i want my game to be like... (it is some of teh discreption)

    I am looking for an online multiplayer 2-dimensional game. The package will include a main server, a sub-server, and a client.
    The main server will store account information and broadcast remote announces/tells to the other servers.
    The sub-servers will store all of the game information, and will check user/password combinations from clients to the main server. The sub-server will only function if it is connected to the main server.

    For more information please go to hvpb.com and download the game, I want my game to be better graphics and less lag. I want my game to be the same idea as that game (lvls, splats, eq and other things to)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width