Thanks tonyg
Im sorry I didnt explain clearly enough what Im trying to do..
I have looked at Gridwars 2 Code by Mark Incitti,and while it is not my
intention to copy other peoples code, I DO wish to learn from it and the
one enemy (Nme) type that features in his game that puzzles me is the snake.
The old way to create these was to create an array ( a list!) of coords for each part, which I used to do as long ago as 1982!
(add 1 to head,delete the tail),but as Im not 16 anymore Im finding it hard to get my head around the new oop constructs in blitzmax. ;)
I do understand that an object can be a number,string,etc but I had no idea that a type could contain fields REFERING TO THE PARENT TYPE FIELDS as it seems to do in this instance.
The line of code ,
n.tail.head= n
was the most confusing part as I have not seen this before , but like you suggest EACH INSTANCE (n) has a HEAD and a TAIL type instance contained therein.
It was just the way in which the following tail could *point* to the *head*
in front of it (or tail section!).
After reading through Waves excellent tut on OOP I worked out that
n.tail.head=n
means
n step into tail step into head = n (where n was the previous n.tail instance?
Thanks for your help I shall look into this further
Im sorry I didnt explain clearly enough what Im trying to do..
I have looked at Gridwars 2 Code by Mark Incitti,and while it is not my
intention to copy other peoples code, I DO wish to learn from it and the
one enemy (Nme) type that features in his game that puzzles me is the snake.
The old way to create these was to create an array ( a list!) of coords for each part, which I used to do as long ago as 1982!
(add 1 to head,delete the tail),but as Im not 16 anymore Im finding it hard to get my head around the new oop constructs in blitzmax. ;)
I do understand that an object can be a number,string,etc but I had no idea that a type could contain fields REFERING TO THE PARENT TYPE FIELDS as it seems to do in this instance.
The line of code ,
n.tail.head= n
was the most confusing part as I have not seen this before , but like you suggest EACH INSTANCE (n) has a HEAD and a TAIL type instance contained therein.
It was just the way in which the following tail could *point* to the *head*
in front of it (or tail section!).
After reading through Waves excellent tut on OOP I worked out that
n.tail.head=n
means
n step into tail step into head = n (where n was the previous n.tail instance?
Thanks for your help I shall look into this further