My game. Please take a look.

Discussion in 'Software' started by Anon-15281db623, Dec 17, 2004.

  1. Anon-15281db623

    Anon-15281db623 Anonymized

    Ok. I have made or actually am in the process of making a game in visual basic .NEt
    I am trying to make something simular to mortal kombat. There is a selection screen for each fighter and then a form loads with the fighter and an oponent on the form. The game will be two player. Both using the keyboard.

    So here is the scoop.

    I have running into some problems:

    1) When i move Cage around using the arrow keys, he disapears when i hit the up arrow. (jumping)
    Is there a simplier or more efficent code out there other then mine which uses 4 timers?

    2) I am using the e.keycode operation, and i cant figure out how to make it possible to move two images at once.

    All i can do right now is post the code, but soon i will be able to post a link to a zip of the game so you can see for your self. :)

    Please take a look, and make any comments. I am begining to learn VB, and i really like it. I just need to smooth off the corners a bit. ;)

    Thanks

    Code:
    
    Public Class ArmoryBckGnd
        Inherits System.Windows.Forms.Form
    
    [Windows Form Designer Generated Code]
    
    Private Sub MoveFighter(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
            'Move the fighter by pressing the arrow keys
            Static intx As Integer
            Dim moveLeft As String
            moveLeft = Me.CageStanding.Location.X
            Select Case e.KeyCode
                Case Keys.Left
                    MoveLeft2()
                Case Keys.Right
                    MoveRight()
                Case Keys.Up
                    MoveUp()
                Case Keys.Down
                    MoveDown()   
            End Select
            'move the second fighter reptile
            Dim LeftReptileMovement As String
            LeftReptileMovement = Me.ReptileStanding.Location.X
            Select Case e.KeyCode
                Case Keys.A
                    MoveLeftReptile()
                Case Keys.D
                    MoveRightReptile()
                Case Keys.W
                    ReptileJump()
                Case Keys.S
                    ReptileDuck()
            End Select
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Dim a As Integer = 5
            Do While a > 0
                CageJumping.Top = CageJumping.Top - 10
                a = a - 1
            Loop
            Timer2.Enabled = True
        End Sub
    
        Private Sub ArmoryBckGnd_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
            'When keyup reshow standing fighter for cage
            Me.CageWalkingRight.Hide()
            Me.CageWalkingLeft.Hide()
            Me.CageStanding.Show()
            Me.CageJumping.Hide()
            'when keyup reshow standing fighter for reptile
            Me.ReptileWalkingRight.Hide()
            Me.ReptileWalkingLeft.Hide()
            Me.ReptileStanding.Show()
            Me.ReptileJumping.Hide()
        End Sub
    
        Private Sub MoveRight()
            Me.CageDucking.Left = Me.CageWalkingRight.Left
            Me.CageJumping.Left = Me.CageWalkingRight.Left
            Me.CageWalkingRight.Left = Me.CageStanding.Left
            Me.CageWalkingLeft.Left = Me.CageWalkingRight.Left
            Me.CageStanding.Left = Me.CageStanding.Left + 5
            Me.CageWalkingRight.Visible = True
            Me.CageDucking.Hide()
            Me.CageJumping.Hide()
            Me.CageStanding.Hide()
            Me.CageWalkingLeft.Hide()
        End Sub
    
        Private Sub MoveUp()
            Me.CageJumping.Visible = True
            Me.CageStanding.Hide()
            Me.CageDucking.Hide()
            Me.CageWalkingRight.Hide()
            Me.CageWalkingLeft.Hide()
            Timer1.Enabled = True
        End Sub
    
        Private Sub MoveDown()
            Me.CageDucking.Left = Me.CageWalkingRight.Left
            Me.CageJumping.Left = Me.CageWalkingRight.Left
            Me.CageWalkingRight.Left = Me.CageStanding.Left
            Me.CageWalkingLeft.Left = Me.CageWalkingRight.Left
            Me.CageStanding.Hide()
            Me.CageJumping.Hide()
            Me.CageDucking.Visible = True
            Me.CageWalkingRight.Hide()
            Me.CageWalkingLeft.Hide()
        End Sub
    
        Private Sub MoveLeft2()
            Me.CageDucking.Left = Me.CageWalkingRight.Left
            Me.CageJumping.Left = Me.CageWalkingRight.Left
            Me.CageWalkingRight.Left = Me.CageStanding.Left
            Me.CageWalkingLeft.Left = Me.CageWalkingRight.Left
            Me.CageStanding.Left = Me.CageStanding.Left - 5
            Me.CageWalkingLeft.Visible = True
            Me.CageDucking.Hide()
            Me.CageJumping.Hide()
            Me.CageStanding.Hide()
            Me.CageWalkingRight.Hide()
        End Sub
    
        Private Sub ArmoryBckGnd_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        End Sub
    
        Private Sub MoveLeftReptile()
            Me.ReptileDucking.Left = Me.ReptileWalkingRight.Left
            Me.ReptileJumping.Left = Me.ReptileWalkingRight.Left
            Me.ReptileWalkingRight.Left = Me.ReptileStanding.Left
            Me.ReptileWalkingLeft.Left = Me.ReptileWalkingRight.Left
            Me.ReptileStanding.Left = Me.ReptileStanding.Left - 5
            Me.ReptileWalkingLeft.Visible = True
            Me.ReptileDucking.Hide()
            Me.ReptileJumping.Hide()
            Me.ReptileStanding.Hide()
            Me.ReptileWalkingRight.Hide()
        End Sub
        Private Sub MoveRightReptile()
            Me.ReptileDucking.Left = Me.ReptileWalkingRight.Left
            Me.ReptileJumping.Left = Me.ReptileWalkingRight.Left
            Me.ReptileWalkingRight.Left = Me.ReptileStanding.Left
            Me.ReptileWalkingLeft.Left = Me.ReptileWalkingRight.Left
            Me.ReptileStanding.Left = Me.ReptileStanding.Left + 5
            Me.ReptileWalkingRight.Visible = True
            Me.ReptileDucking.Hide()
            Me.ReptileJumping.Hide()
            Me.ReptileStanding.Hide()
            Me.ReptileWalkingLeft.Hide()
        End Sub
        Private Sub ReptileDuck()
            Me.ReptileDucking.Left = Me.ReptileWalkingRight.Left
            Me.ReptileJumping.Left = Me.ReptileWalkingRight.Left
            Me.ReptileWalkingRight.Left = Me.ReptileStanding.Left
            Me.ReptileWalkingLeft.Left = Me.ReptileWalkingRight.Left
            Me.ReptileStanding.Hide()
            Me.ReptileJumping.Hide()
            Me.ReptileDucking.Visible = True
            Me.ReptileWalkingRight.Hide()
            Me.ReptileWalkingLeft.Hide()
        End Sub
        Private Sub ReptileJump()
            Me.ReptileJumping.Visible = True
            Me.ReptileStanding.Hide()
            Me.ReptileDucking.Hide()
            Me.ReptileWalkingRight.Hide()
            Me.ReptileWalkingLeft.Hide()
            Timer1.Enabled = True
        End Sub
    
        Private Sub Reptile1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reptile1.Tick
            Dim a As Integer = 5
            Do While a > 0
                ReptileJumping.Top = ReptileJumping.Top - 10
                a = a - 1
            Loop
            Reptile2.Enabled = True
        End Sub
    
        Private Sub Reptile2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reptile2.Tick
            Dim a As Integer = 5
            Do While a > 0
                a = a - 1
            Loop
            Reptile1.Enabled = False
            Reptile3.Enabled = True
            Reptile2.Enabled = False
        End Sub
    
        Private Sub Reptile3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reptile3.Tick
            Dim a As Integer = 5
            Do While a > 0
                a = a - 1
                ReptileJumping.Top = ReptileJumping.Top + 10
            Loop
            Reptile4.Enabled = True
        End Sub
    
        Private Sub Reptile4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reptile4.Tick
            Reptile3.Enabled = False
            Reptile4.Enabled = False
        End Sub
    End Class
    
    
    Thanks, and ill try and get the file up asap. ;)

    :cool:

    cooked
     
  2. Anon-15281db623

    Anon-15281db623 Anonymized

  3. anarchy

    anarchy Private E-2

    I don't know about anyone else who's tried to get this but when I try to open either of your exe's I'm getting a "Failure to initialize properly, click OK to terminate" error message.
     
  4. Anon-15281db623

    Anon-15281db623 Anonymized

    Hum works for me. Did you estract the files from the zip archive?

    :cool:

    cooked
     
  5. anarchy

    anarchy Private E-2

    Ya I extracted it to my desktop. I am wondering because I am sort of a newbie at programming...Would I need any specfic software to be able to open the .exe's?

    anarchy
     
  6. Anon-15281db623

    Anon-15281db623 Anonymized

    Yeah your probley going to need the .net framework, and maybe Visual Studio .NET

    :cool:

    cooked
     
  7. mcadam

    mcadam Major Amnesia

    cooked, just gimme a shout if there's a problem!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds