Advertisement
Dr_Davenstein

Untitled

Jan 8th, 2021
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. type item_base
  2.  
  3. positionX as integer
  4. positionY as integer
  5. sprite as any ptr
  6. name as string
  7.  
  8. end type
  9.  
  10. type potion_type extends item_base
  11.  
  12. health_val as integer
  13. str_val as integer
  14.  
  15. end type
  16.  
  17. type weapon_type extends item_base
  18.  
  19. head_val as integer
  20. chest_val as integer
  21.  
  22. end type
  23.  
  24.  
  25. dim potion as potion_type
  26.  
  27. potion.name = "Beer"
  28.  
  29.  
  30. dim weapon as weapon_type
  31.  
  32. weapon.name = "Broad sword"
  33.  
  34.  
  35. 'notice how they are different types, but they both have everything in the item_base type :)
  36. print potion.name
  37. print weapon.name
  38.  
  39.  
  40. sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement