none
Conflict between two mousedowns RRS feed

  • Question

  • Private Sub Pics_MouseDown(ByVal obj As Object, ByVal e As MouseEventArgs)
            If e.Button = MouseButtons.Left Then
                For Each spt As Sprite In Sprites
                    If spt.Pic Is DirectCast(obj, PictureBox) Then
                        If spt.Visible = 2 Then
                            MouseDownPicLocation = spt.Pic.Location
                            MouseDownLocation = e.Location
                            MouseDownSprite = spt
                            spt.Pic.BringToFront()
                        Else
                            MouseDownSprite = Nothing
                        End If
                        Exit For
                    End If
                Next
            End If
        End Sub

    This code here helps to move the sprite around on the game grid. 

     Private Sub Pics_MouseDown(sender As Object, e As MouseEventArgs)
            If TankSelectStatus = 1 Then
                TargetSprite = DirectCast(sender, PictureBox).Name
                TankSelectStatus = 0
    
                Dim AttackListIndex = GetSpriteIndex(AttackSprite)
                Dim TargetListIndex = GetSpriteIndex(TargetSprite)
                Dim hp As Integer = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
    
                If hp <= 0 Then
                    MsgBox(Sprites(TargetListIndex).Name & " Murked by " & Sprites(AttackListIndex).Name)
                    Sprites(AttackListIndex).HP += Sprites(TargetListIndex).HP
                    'remove sprite from list
                    Sprites(TargetListIndex).Pic.Dispose()
                    Sprites.Remove(Sprites(TargetListIndex))
                Else
                    Sprites(TargetListIndex).HP = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
                    MsgBox("Still standing")
                End If
            Else
                AttackSprite = DirectCast(sender, PictureBox).Name
                TankToolbar.Location = New Point(Sprites(GetSpriteIndex(AttackSprite)).Pic.Right, Sprites(GetSpriteIndex(AttackSprite)).Pic.Bottom)
                TankToolbar.Visible = True
            End If
        End Sub

    This is another code using the mousedown feature to select a sprite, it opens a panel which has the button to attack then the player selects which sprite to destroy and if it is successful then the tank is destroyed and removed which perfectly works. 

    I want to use both of these pieces of code and I think using lmb alone for both of these features would work as I have tested it thus I will use lmb to move the sprite around the game grid and rmb to select the panel and lmb to start selecting. 

    Could somebody help me with some guidelines on how I can actually do this?


    WRA


    Sunday, March 26, 2017 12:54 PM

All replies

  • Wali,

    You are still trying to mix code written for different specific tasks by copy and paste. You cant take two different examples and combine them if you dont understand what you are doing. You will need to understand what the code does and then write new code to combine them.

    So here is an example. Its not exactly what you need. You are the only one that knows what you want to do. Thats how it works. You wont understand it if you dont write it.

    I just made up the variable like InSelectionMode. That would be a variable set after the user clicks a button to select something etc. You will have to work out the logic this is just an example.

    Private Sub Pics_MouseDown(sender As Object, e As MouseEventArgs) If InSelectionMode Then

    'an object has been selected show the menu or pick from menu If TankSelectMenu.visible Then 'select the action Else 'show the menu End If ElseIf e.Button = MouseButtons.Left Then If tankselected Then 'move the sprite Else 'Select the sprite End If ElseIf e.Button = MouseButtons.Right Then 'popup the menu Else 'reset the tools End If End Sub


    Sunday, March 26, 2017 1:46 PM
  • I see so it is a bit like I should "think on my own feet here". 

    Also it is like "anything is possible" idea


    WRA

    Sunday, March 26, 2017 1:50 PM
  • I see so it is a bit like I should "think on my own feet here". 

    Also it is like "anything is possible" idea


    WRA


    Its the only way. You cant learn to code if you dont write some code.

    The reason things are done the way they are just will not connect if you dont track through each item and understand each step. The way that happens is you write what you want to do, test it, realize this has to be that, change it, run it, debug it, repeat. Thats how one gets their brain wired to program. You cant only read about it. You cant copy it. You have to do it.

    Sunday, March 26, 2017 2:00 PM
  • Ohhh I like that so process it in the mind by typing it out which helps to start thinking about how the code will function. Is this something you always do? I'm asking because I wanna try use this method especially when I get into sticky situations in the future. 


    WRA

    Sunday, March 26, 2017 2:04 PM
  • @Tommy 

    I wonder how come people call me wali its just so funny like throughout my life time friends of mine just call me wali rather than waliur. 


    WRA

    Sunday, March 26, 2017 2:11 PM
  • Ohhh I like that so process it in the mind by typing it out which helps to start thinking about how the code will function. Is this something you always do? I'm asking because I wanna try use this method especially when I get into sticky situations in the future. 


    WRA

    Well, me thinks you think too much.

    Start doing now. Learn by doing now.

    You have a few tools. A pile of wood. Some half baked plans. Start sawing up the examples into pieces. Nail the pieces together into your project. Stand back and look. Crooked, fix it. Broken, fix it. Does not do what you want? Start over.

    Yes I sometimes make a pencil outline in my notebook of thoughts. Then I sometimes look for examples first. Then I start with a one form project. Empty. I start adding controls, arraging the look. Thinking how things interact. Show a picture. Write the code to click the start button. Test it. Change it. Add to it. Works. Now add the select tank button, test it, change it, test, it change it. Look for examples. Stumped. Ask a question. Write it, test it, change it.

    Practice practice practice.

    Sunday, March 26, 2017 2:14 PM
  • Woah devotion, Im impressed :)

    WRA

    Sunday, March 26, 2017 2:22 PM
  • Do you know the answer to my one of my other threads such as the general one with removing safely imported pictures?

    WRA

    Sunday, March 26, 2017 2:23 PM
  • Do you know the answer to my one of my other threads such as the general one with removing safely imported pictures?

    WRA

    Yes I do.

    And I know you don't understand what you are doing. There is no problem with your pictures. You just don't understand what you are doing. You have made a bad assumption based on a casual remark someone that did not understand what you were asking made and now you are wasting more time on it.

    Sunday, March 26, 2017 2:35 PM
  • Ahh so the one thread of something general I could find the answer to it right away

    WRA

    Sunday, March 26, 2017 3:02 PM
  • Also that whenever I'm specifying my issue try cut around to getting to the solution rather than confusing people as I did in recent threads

    WRA

    Sunday, March 26, 2017 3:09 PM
  • @Tommy 

    whats the inselectionmode suppose to indicate? or is it a variable that I have mentioned such as Tankselectedstatus as integer  = 1 


    WRA

    Sunday, March 26, 2017 3:12 PM
  • Also that whenever I'm specifying my issue try cut around to getting to the solution rather than confusing people as I did in recent threads

    WRA

    Well dont take any of it the wrong way. I am just trying to help. Its just my opinion I could be wrong I may not understand.

    However, I seem to see you posting the same question over and over with the same 30 lines of code from the question you last asked with no change. You dont seem to be getting much detail from your forum questions.

    Now its becoming a waste of time.

    Yes it is not clear to most what you are asking. I know. Acamar knows. Thats about it though. We have been involved and can deduce what you want.

    But you are still stuck with the example I made weeks ago that you are adapting. You are still stuck on the first question. Why the pics are named 1,2,3 and what that means, what they are and how the sprite class works. How a class works.

    My suggestion has not changed. Work simple examples of saving data in a class until you understand it. Then work on your large project.

    Go back to the other thread with the three examples of how it works, the last being the red green blue example. The first two being the ones just before that. Read it carefully. Read what I wrote. Read what Acamar wrote. Make the examples and watch them run until you really understand. Everything you need for step 1 is there. You cant move to step 2 until you are done with step 1. Anything else right now is a waste of time and just confusing you.

    Thats about all I have to say until something changes. I get off merry go rounds to knowwhere when I realize I am on one.

    Like I say dont take it the wrong way. You are learning to fish. Its not easy. I try to tell you what I know about it. Not that I know it all. I am done giving you fish. You have a pole, you cut enough bait, now go fish. Dont come back and ask why the pole does not work. That is not the problem. That is a waste of time.

    :)


    Sunday, March 26, 2017 3:27 PM
  • No no no you are just giving a bit of peptalk and I'm cool with that you are simply encouraging me to think on my own feet here and figure how things will operate from my perspective. 

    Oh yh I finally manage to fix the problem btw with the name of the files and I can access them according to their name rather than calling them 1.png and so on. 

    For now I'm going to focus face on with this issue to use lmb to move sprites about and use the rmb to actually select the tank.

    Once I have finally figured that out then I could move right onto setting the range of how far can my sprites actually attack and use the examples given to figure out what is going in the code and function it in a style so It could work for me too. 

    It's a bit by bit process like with the example of fishing and in other words you are saying learning new stuff or understanding familiar stuff takes a lot of time to actually understand and master it. Something I am capable to do if I put my mind to it. 


    WRA

    Sunday, March 26, 2017 3:35 PM
  • No no no you are just giving a bit of peptalk and I'm cool with that you are simply encouraging me to think on my own feet here and figure how things will operate from my perspective. 

    Oh yh I finally manage to fix the problem btw with the name of the files and I can access them according to their name rather than calling them 1.png and so on. 

    For now I'm going to focus face on with this issue to use lmb to move sprites about and use the rmb to actually select the tank.

    Once I have finally figured that out then I could move right onto setting the range of how far can my sprites actually attack and use the examples given to figure out what is going in the code and function it in a style so It could work for me too. 

    It's a bit by bit process like with the example of fishing and in other words you are saying learning new stuff or understanding familiar stuff takes a lot of time to actually understand and master it. Something I am capable to do if I put my mind to it. 


    WRA


    Once you truly understand how each block works then its just chugging through it.

    Dont add any more to your project. Get what you have working. Keep a list of things to do. But get a basic shell running.

    Do you have an instructor? Other classmates friends and family that are helping you?

    One cant learn programing or anything else from only a book and a forum.

    Feelings and body language dont come through emails.

    Some questions need to be explained and answered in a personal way. Reading and forums are not enough.

    Sunday, March 26, 2017 4:12 PM
  • Yeh true. I don't have family members who do computer science but I have my teacher so I'll ask him some questions whenever I get the concern but the problem is sometimes when I ask him a question he sometimes waffles when I just want to know one specific thing and yes I know I can sometimes be unclear in what I am saying. 

    That is why I have used MSDN to get help as well since my teacher isn't free all the time because were a class of 8 and the class need help from him just as much. 

    Sometimes he doesn't have time to help out so basically I use this site to help me with my question and my teacher for other relative questions too. So its basically a mix of primary and secondary sources.


    WRA


    Sunday, March 26, 2017 4:17 PM
  • As soon as I solved this one I'll mark your structure as an answer when I'm satisfied with it. 

    WRA

    Sunday, March 26, 2017 8:05 PM
  • I have received three relevant errors: Here is a screenshot which states them

    Private Sub Pics_MouseDown(ByVal obj As Object, sender As Object, e As MouseEventArgs)
    
            ElseIf e.Button = MouseButtons.Right Then
                'popup the menu
                Dim AttackListIndex = GetSpriteIndex(AttackListIndex)
                Dim TargetListIndex = GetSpriteIndex(TargetListIndex)
                Dim hp As Integer = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
    

    The first error is basically from the private sub on the top and the second is the first two declared variables. 

    Here is the other part in the form1_load section which provides a red squiggly line. 

    AddHandler .MouseDown, AddressOf Pics_MouseDown
    
    Tommy or anyone else could you indicate where am I going wrong here?


    WRA

    Sunday, March 26, 2017 8:19 PM
  • Here is the other part in the form1_load section which provides a red squiggly line. 

    If you want to use this:

        TargetSprite = DirectCast(sender, PictureBox).Name

    Then you have to change

        With pic
          .Name = "Pic" & i.ToString

    in the form load event to

       With pic
         .Name = Sprites(i).Name

    so that the picturebox name for the picturebox that you assign to the sprite really does have the name of the sprite.   That is an example of adapting code examples to your specific circumstance.

    However your immediate problem is processing the mouse down event.  To do that you need to state, in clear, simple non-technical language, one statement at a time, exactly what should occur when the user presses down on the mouse button.


    • Edited by Acamar Sunday, March 26, 2017 10:05 PM sp
    Sunday, March 26, 2017 10:03 PM
  • Alrighty thanks.

    I'm gonna sleep on it. The solution might snap to me like it did today with some things I manage to solve such as positioning each sprite and find them by their name rather than numbered.


    WRA

    Sunday, March 26, 2017 10:30 PM
  • Afternoon all, I'm really stuck on the area to do with the same errors I have mentioned the yesterday so still on square one. 

    It shows my private sub can't indicate a signature with a delegate... Here is the list of errors.  

    The first error I am able to solve I just indicate in my private sub (byval obj as object)


    WRA

    Monday, March 27, 2017 12:41 PM
  • If e.Button = MouseButtons.Right Then
                Dim AttackListIndex = GetSpriteIndex(AttackListIndex) 'this is where the error sits
                Dim TargetListIndex = GetSpriteIndex(TargetListIndex) 'this is where the error sits
                Dim hp As Integer = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
    End if 

    Otherwise when I have tested then individually they work perfectly. 

    My intention here is to get the code for when I use the Left mouse button it moves my sprite around then by selecting the right mouse button, it opens the panel and I select the button within that panel and select a sprite to attack. 

            

    WRA

    Monday, March 27, 2017 12:43 PM
  • Afternoon all, I'm really stuck on the area to do with the same errors I have mentioned the yesterday so still on square one. 

    It shows my private sub can't indicate a signature with a delegate... Here is the list of errors.  

    The first error I am able to solve I just indicate in my private sub (byval obj as object)


    WRA

    Wali,

    Dont expect the forum members to know exactly what you are doing. You need to provide the background info required for the question you asked. Otherwise you get the wrong answer and get confused.

    You did not show the code for the function GetSpriteIndex from this line of code and what does it do and what argument type does it take? You changed it to object type but that will not work properly.

           Dim AttackListIndex = GetSpriteIndex(AttackListIndex)


    Why in your code in the first post is the line:

           Dim AttackListIndex = GetSpriteIndex(AttackSprite)


    which uses AttackSprite. Not the same as AttackListIndex.

    Where have you defined AttackSprite and what type object is it? ie Integer? Picturebox? Sprite?

    So you still just copied the code without understanding what it does.


    Monday, March 27, 2017 2:09 PM
  • I asked my teacher about this and he says about this code here: 

           Dim AttackListIndex = GetSpriteIndex(AttackListIndex) 

    it is literally calling in on itself 

    Btw I use the structure you have provided to set out how to actually approach what I am trying to do. 

        ', Sender As Object
        Private Sub Pics_MouseDown(ByVal obj As Object, e As MouseEventArgs) Handles MyBase.MouseDown
            If TankSelectStatus = 1 Then
                'select the action
                TargetSprite = DirectCast(Sender, PictureBox).Name
                TankSelectStatus = 0
            Else
                'show the menu
                TankToolbar.Visible = True
            End If
    
            If e.Button = MouseButtons.Left Then
                For Each spt As Sprite In Sprites
                    If spt.Pic Is DirectCast(obj, PictureBox) Then
                        If spt.Visible = 2 Then
                            'move the sprite
                            MouseDownPicLocation = spt.Pic.Location
                            MouseDownLocation = e.Location
                            MouseDownSprite = spt
                            spt.Pic.BringToFront()
                        Else
                            'Select the sprite
                            MouseDownSprite = Nothing
                        End If
                        Exit For
                    End If
                Next
            End If
    
            If e.Button = MouseButtons.Right Then
                'popup the menu
                Dim AttackListIndex = GetSpriteIndex(AttackListIndex)
                Dim TargetListIndex = GetSpriteIndex(TargetListIndex)
                Dim hp As Integer = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
    
                If hp <= 0 Then
                    MsgBox(Sprites(TargetListIndex).Name & " Murked by " & Sprites(AttackListIndex).Name)
                    Sprites(AttackListIndex).HP += Sprites(TargetListIndex).HP
                    'remove sprite from list
                    Sprites(TargetListIndex).Pic.Dispose()
                    Sprites.Remove(Sprites(TargetListIndex))
                Else
                    Sprites(TargetListIndex).HP = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
                    MsgBox("Still standing")
                End If
            Else
                'reset the tools
                AttackSprite = DirectCast(Sender, PictureBox).Name
                TankToolbar.Location = New Point(Sprites(GetSpriteIndex(AttackSprite)).Pic.Right, Sprites(GetSpriteIndex(AttackSprite)).Pic.Bottom)
                TankToolbar.Visible = True
            End If
        End Sub
    


    WRA

    Monday, March 27, 2017 2:26 PM
  • Wali,

    I suggest you work on these examples from this thread until you understand them.

    Make the first two examples and put values in the text box and step through the code and watch what it is doing. Learn what I showed you there. Then do the red green blue and learn it.

    In the red, green, blue example, AttackSprite is the sprite that is attacking. It is not the name of the sprite it is a reference to the sprite object. AttachSpriteIndex is the index of the sprite in the list of sprites. The function GetSpriteIndex() returns the list index of the AttackSprite in the Sprites() list.

    You should have referenced this info in this question so others know where you are coming from.

    You may or may not want to do things exactly this way. The way Acamar last showed and etc will also work.

    But until you understand how lists work and how this sprite class works you wont progress. That's what these examples show you.

    Here they are again:

    ==================================================

    Wali,

    The files just happened to be named 1, 2, 3. It has nothing to do with the listindex value.

    ( i )   filename   listindex

     1         1.png         0
     2         2.png         1
     3         3.png         2


    In the following example the for loop index i goes from 3 to 5, but the list index is still the same 0 to 2. A list is similar to an array that starts at zero is all. First item added to the list is at index 0. Second is index 1 etc. In the example Name 3 was first to be added to the list so it is at list index = 0.

    Public Class Form3
        Private MyList As New List(Of String)
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim s As String
            For i = 3 To 5
                s = "Name " & i.ToString
                MyList.Add(s)
            Next
            Label1.Text = "Enter a Value from 0 to 2"
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            If IsNumeric(TextBox1.Text) Then
                Dim n As Integer = CInt(TextBox1.Text)
                If n >= 0 AndAlso n <= 2 Then
                    Label1.Text = MyList(n)
                Else
                    Label1.Text = "Enter a Value from 0 to 2"
                End If
            End If
        End Sub
    
    End Class

    <input id="234d3a7b-b0d4-4651-bfbc-0088d8a9db5c_attachments" type="hidden" value="1030839" />                
  • ======================================================            

    PS Here is another example.

    Enter the index = 1 to the text box click button, the list item at index 1 is removed (name 4) and the exampe shows Name 3 Name 5 remaining in the list (at index 0, 1). Name 4 was at list index 1 so was removed.

    Now click again with list index 1 in the text box and the item at list index 1 = name 5 is removed. Now the list has only Name 3 left at index 0.

    Click again with list index = 1 and get an error because all the list has is one item at index 0 = Name 3.

    Public Class Form3
        Private MyList As New List(Of String)
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim s As String
            For i = 3 To 5
                s = "Name " & i.ToString
                MyList.Add(s)
            Next
            ShowList()
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            If IsNumeric(TextBox1.Text) Then
                Dim n As Integer = CInt(TextBox1.Text)
                MyList.Remove(MyList(n))
                ShowList()
            End If
        End Sub
    
        Private Sub ShowList()
            Label1.Text = ""
            For i = 0 To MyList.Count - 1
                Label1.Text &= MyList(i) & "  "
            Next
        End Sub
    End Class

    ====================================================

    Learn by example you said? Have you learned anything? :)

    So you can either remove the Sprites from the list when destroyed or you can flag a variable as Acamar describes. BTW you already have a variable for this in the Health Points. If HP<0 then that sprite is destroyed. Dont need another flag, dont need to remove from list. Just have to check the points each time you select a sprite etc.

    Here is a working example that removes the sprite from the list. Sometimes one cant tell which way is best until one does them both. Maybe neither is "better". Maybe the method you understand is best.

    See how I named the Sprites red green blue instead of 1, 2, 3? Then search the list for the name to get the list index. See how there is no relation to the sprite string name and the list index?

    And then this example shows one possibility for how to set the Attacker and Target using a popup toolbar. Or you could just have a toolbar that is always visible. Or whatever you have in mind.

    See how I named the target sprite something that makes sense like TargetListIndex  instead of just i or j ?

    Public Class Form3
        Private GridColRows As New Point(5, 5)
        Private GridRect As Rectangle
        Private GridSize As Size = New Size(50, 50)
        Private MouseMovingColRow, PicColRow, MouseDownPicLocation, MouseDownLocation As Point
        Public Crushed As Boolean
    
        Private WithEvents TankToolbar As New Panel With {.Parent = Me,
            .Size = New Size(GridSize.Width * 3, GridSize.Height), .Visible = False,
            .BackColor = Color.White}
        Private WithEvents SelectTankButton As New Button With {.Parent = TankToolbar,
            .Text = "Target"}
        Private AttackSprite, TargetSprite As String
        Private TankSelectStatus As Integer = 0
    
        Private Class Sprite
            Public Name As String
            Public Pic As PictureBox
            Public ColRow As Point
            Public Steps As Integer = -1    '-1 = unlimited move
            Public Visible As Integer = 2   '0 = not visible  1= Frozen  2=Active   
            Public Range As Integer
            Public AP As Integer
            Public HP As Integer
        End Class
    
        Private Sprites As New List(Of Sprite)
    
        Private Sub Pics_MouseDown(sender As Object, e As MouseEventArgs)
            If TankSelectStatus = 1 Then
                TargetSprite = DirectCast(sender, PictureBox).Name
                TankSelectStatus = 0
    
                Dim AttackListIndex = GetSpriteIndex(AttackSprite)
                Dim TargetListIndex = GetSpriteIndex(TargetSprite)
                Dim hp As Integer = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
    
                If hp <= 0 Then
                    MsgBox(Sprites(TargetListIndex).Name & " Murked by " & Sprites(AttackListIndex).Name)
                    Sprites(AttackListIndex).HP += Sprites(TargetListIndex).HP
                    'remove sprite from list
                    Sprites(TargetListIndex).Pic.Dispose()
                    Sprites.Remove(Sprites(TargetListIndex))
                Else
                    Sprites(TargetListIndex).HP = Sprites(TargetListIndex).HP - Sprites(AttackListIndex).AP
                    MsgBox("Still standing")
                End If
            Else
                AttackSprite = DirectCast(sender, PictureBox).Name
                TankToolbar.Location = New Point(Sprites(GetSpriteIndex(AttackSprite)).Pic.Right, Sprites(GetSpriteIndex(AttackSprite)).Pic.Bottom)
                TankToolbar.Visible = True
            End If
        End Sub
    
        Private Function GetSpriteIndex(theName As String) As Integer
            For i = 0 To Sprites.Count - 1
                If theName = Sprites(i).Pic.Name Then
                    Return i
                End If
            Next
    
            Return -1
        End Function
    
        Private Sub SelectTankButton_Click(sender As Object, e As EventArgs) Handles SelectTankButton.Click
            TankToolbar.Visible = False
            TankSelectStatus = 1
        End Sub
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            DoubleBuffered = True
            For i = 1 To 3
                Dim pic = New PictureBox()
                With pic
                    .Name = "Picturebox" & i.ToString
                    .Size = GridSize
                    .Left = i * GridSize.Width
                    Me.Controls.Add(pic)
                    AddHandler .MouseDown, AddressOf Pics_MouseDown
                    'AddHandler .MouseMove, AddressOf pics_MouseMove
                    'AddHandler .MouseUp, AddressOf pics_MouseUp
                End With
    
                Dim spt As New Sprite
                spt.Pic = pic
                spt.ColRow = New Point(i)
                Sprites.Add(spt)
            Next
    
            Sprites(0).Pic.BackColor = Color.Red
            Sprites(0).Name = "Sprite Red"
            Sprites(1).Pic.BackColor = Color.Green
            Sprites(1).Name = "Sprite Green"
            Sprites(2).Pic.BackColor = Color.Blue
            Sprites(2).Name = "Sprite Blue"
    
            Sprites(0).HP = 100
            Sprites(1).HP = 10
            Sprites(2).HP = 10
    
            Sprites(0).AP = 10
            Sprites(1).AP = 10
            Sprites(2).AP = 5
    
        End Sub
    End Class

Monday, March 27, 2017 2:29 PM
  • PS I guess I messed up that last post. Sorry.
    Monday, March 27, 2017 2:34 PM
  • PS Wali,

    Study the examples and then make a new question if you have one. This thread is messed up. Post all the code if you post a question about the examples.

    Monday, March 27, 2017 2:36 PM
  • Yeah sounds like a good idea it looks messy at this point.

    WRA

    Monday, March 27, 2017 2:41 PM