Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An equipment screen for my RPG game
#9
Thank you for your messages!
I was able to reorder the equipment as TYPE and it seems to work :

Code: (Select All)

Type equipment
    equipmentname AS STRING
    equipmentdamage AS INTEGER
    equipmentdefense AS INTEGER
    equipmentdurability AS INTEGER
equipmentcount AS INTEGER
End Type

DIM bonespear AS equipment
bonespear.equipmentname = "Lance en os" 'game's language is actually in French.
bonespear.equipmentdamage = 2
bonespear.equipmentdefense = 0
bonespear.equipmentdurability = 20
bonespear.equipmentcount = 0

DIM flintspear AS equipment
flintspear.equipmentname = "Lance en silex"
flintspear.equipmentdamage = 4
flintspear.equipmentdefense = 0
flintspear.equipmentdurability = 30
flintspear.equipmentcount = 0

DIM copperspear AS equipment
copperspear.equipmentname = "Lance en cuivre"
copperspear.equipmentdamage = 6
copperspear.equipmentdefense = 0
copperspear.equipmentdurability = 40
copperspear.equipmentcount = 0

DIM ironspear AS equipment
ironspear.equipmentname = "Lance en fer"
ironspear.equipmentdamage = 8
ironspear.equipmentdefense = 0
ironspear.equipmentdurability = 50
ironspear.equipmentcount = 0

DIM stoneaxe AS equipment
stoneaxe.equipmentname = "Hache en pierre"
stoneaxe.equipmentdamage = 1
stoneaxe.equipmentdefense = 1
stoneaxe.equipmentdurability = 20
stoneaxe.equipmentcount = 0

DIM copperaxe AS equipment
copperaxe.equipmentname = "Hache en cuivre"
copperaxe.equipmentdamage = 3
copperaxe.equipmentdefense = 2
copperaxe.equipmentdurability = 35
copperaxe.equipmentcount = 0

DIM ironaxe AS equipment
ironaxe.equipmentname = "Hache en fer"
ironaxe.equipmentdamage = 4
ironaxe.equipmentdefense = 4
ironaxe.equipmentdurability = 50
ironaxe.equipmentcount = 0

CASE 20 'Description des equipments 'case 20 of my SELECT CASE loop --- I can show each equipment attributes.
CLS
Print "Description de l'‚quipement"
print ""
If bonespear.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
bonespearcount& = _LOADIMAGE("bonespear.png", 32)
print "  Lance en os        :" bonespear.equipmentcount; "  Degats : " bonespear.equipmentdamage; "  Defense : " bonespear.equipmentdefense; "  Durabilite : " bonespear.equipmentdurability
_PUTIMAGE (X, Y), bonespearcount&
print ""
_FREEIMAGE bonespearcount&
Else
end if

If flintspear.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
flintspearcount& = _LOADIMAGE("flintspear.png", 32)
print "  Lance en silex      :" flintspear.equipmentcount; "  Degats : " flintspear.equipmentdamage; "  Defense : " flintspear.equipmentdefense; "  Durabilite : " flintspear.equipmentdurability
_PUTIMAGE (X, Y), flintspearcount&
print ""
_FREEIMAGE flintspearcount&
Else
end if

If copperspear.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
copperspearcount& = _LOADIMAGE("copperspear.png", 32)
print "  Lance en cuivre    :" copperspear.equipmentcount; "  Degats : " copperspear.equipmentdamage; "  Defense : " copperspear.equipmentdefense; "  Durabilite : " copperspear.equipmentdurability
_PUTIMAGE (X, Y), copperspearcount&
print ""
_FREEIMAGE copperspearcount&
Else
end if

If ironspear.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
ironspearcount& = _LOADIMAGE("ironspear.png", 32)
print "  Lance en fer        :" ironspear.equipmentcount; "  Degats : " ironspear.equipmentdamage; "  Defense : " ironspear.equipmentdefense; "  Durabilite : " ironspear.equipmentdurability
_PUTIMAGE (X, Y), ironspearcount&
print ""
_FREEIMAGE ironspearcount&
Else
end if

If stoneaxe.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
stoneaxecount& = _LOADIMAGE("stoneaxe.png", 32)
print "  Hache en pierre    :" stoneaxe.equipmentcount; "  Degats : " stoneaxe.equipmentdamage; "  Defense : " stoneaxe.equipmentdefense; "  Durabilite : " stoneaxe.equipmentdurability
_PUTIMAGE (X, Y), stoneaxecount&
print ""
_FREEIMAGE stoneaxecount&
Else
end if

If copperaxe.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
copperaxecount& = _LOADIMAGE("copperaxe.png", 32)
print "  Hache en cuivre    :" copperaxe.equipmentcount; "  Degats : " copperaxe.equipmentdamage; "  Defense : " copperaxe.equipmentdefense; "  Durabilite : " copperaxe.equipmentdurability
_PUTIMAGE (X, Y), copperaxecount&
print ""
_FREEIMAGE copperaxecount&
Else
end if

If ironaxe.equipmentcount >= 1 THEN
X = (POS(0) - 1) * _FONTWIDTH
Y = (CSRLIN - 1) * _FONTHEIGHT
ironaxecount& = _LOADIMAGE("ironaxe.png", 32)
print "  Hache en fer        :" ironaxe.equipmentcount; "  Degats : " ironaxe.equipmentdamage; "  Defense : " ironaxe.equipmentdefense; "  Durabilite : " ironaxe.equipmentdurability
_PUTIMAGE (X, Y), ironaxecount&
print ""
_FREEIMAGE ironaxecount&
Else
end if
SLEEP



[Image: eq.png]

Now I would like to start with the Equipment screen, I will need to think further on how to proceed properly. I'll share my findings soon.
Thank you in advance!
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 Delsus - 03-26-2024, 07:00 PM



Users browsing this thread: 1 Guest(s)