Is it possible to create an array of objects in visual basic?
I'm making a battle system and whenever the battle begins, i wanna be able to randomly select a Monster object from an array.
If it is possible, could somebody show me how to store Public Spider as New Monster(50, 20, 5) into an array?
Thank you.
Monster Class:
Public Class Monster
Private hp As Integer
Private xp As Integer
Private dmg As Integer
Sub New(ByVal hitpoints As Integer, ByVal exp As Integer, ByVal damage As Integer)
hp = hitpoints
xp = exp
dmg = damage
End Sub
End Class
Form Class:
Imports Monster
Public Class Form
Public Spider As New Monster(50, 20, 5)
End Class