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 = ....
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  No warning to mix screen 0 and screen graphic commands! TempodiBasic 8 1,853 06-16-2023, 11:36 PM
Last Post: TempodiBasic

Forum Jump:


Users browsing this thread: 1 Guest(s)