Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An equipment screen for my RPG game
#2
declare types first thing in code and fucntions go after main code.

then you can dim a single varaible as a type or make an array of the type.

Code: (Select All)
Type equipment
    equipmentname As String
    equipmentdamage As Integer
    equipmentdefense As Integer
    equipmentdurability As Integer
End Type

type enemies
  name as string
  as integer damage, defense, durability
end type

dim bonespear as equipment  ' do this first but you don't need the equipment name in type if you want to say bonespear.damage = 4
bonespear.equipmentname = "Bone spear" ' ---------- Will this work with TYPE ? yes
bonespear.equipmentdamage = 2
bonespear.equipmentdefense = 0
bonespear.equipmentdurability = 20
bonespearcount = 0

'   either go by name and list.qualities or go by number and include the name in the type definition

dim foes(nEnemies) as enemies
foes(1).name = rabbit
foes(1).damage = ....
b = b + ...
Reply


Messages In This Thread
An equipment screen for my RPG game - by Delsus - 03-26-2024, 09:41 AM
RE: An equipment screen for my RPG game - by bplus - 03-26-2024, 01:51 PM



Users browsing this thread: 1 Guest(s)