Hi I am writing a text adventure as a way of relearning coding and am currently reworking the way I handle objects, and indeed rooms by combining them. Thus objects and rooms are now just 'things', the player is just a 'thing' in another 'thing', which just happens to be a 'room', but could just as easily be a box, a boat or whatever.
The below (deliberately) does not work as I am (stupidly) trying to create a pointer to a type that has not been declared which needs the previous type to be declared first :/.
Code: Select all
Type _thing
name as string
long_name as string
description as string
plurals as string
additional_desc as string
position as string
init_player_stance as string
init_player_position as string
room_start_words
as _thing ptr parent
as _thing ptr contents
as _thing ptr _next, _prev
as _d_links ptr directions
end type
type _d_links
as _thing ptr n,s,e,w,up,down,in,out,ne,se,sw,nw
end type
dim objects(100) as _thing
dim directions(50) as _d_links
Code: Select all
dim direction as string
.
.
.
.
objects(1).directions=@direction