Psycho_666
Member
Hey.
Uhm... It is as convoluted as it can be an my brain hurts, so bear with me...
I have this 10x10 tiles map.
I have the map controller object, I have each tile as an object (1 tile object and all instances) and I have a database object, basically storing all the data about the map.
Then I have the card system.
I have a card object, I have a card controller object and I have database object that stores the data for each card.
Now here comes the complicated part:
When I play a card, I pull data from the card database, I compare some variables from the map controller, the map database and the tile objects, then set new data in the map database and tile objects.
It becomes a nightmare, because I end up with code like
global.tileatatus[global.mouseover.row,global.mouseover.col] = status_index
And as we all know this doesn't work. But I need to call data from the map database object through the tile I'm pointing my mouse at...
Help me out here...
How can I call variables from one object through another object without ending with multiple global.thing.anotherthing situation...
My brain hurts. I have been thinking about this for a week without writing a single line of code. I have reached the point where I set 7 variables before I reach the point I even call the one thing I must actually change...
Uhm... It is as convoluted as it can be an my brain hurts, so bear with me...
I have this 10x10 tiles map.
I have the map controller object, I have each tile as an object (1 tile object and all instances) and I have a database object, basically storing all the data about the map.
Then I have the card system.
I have a card object, I have a card controller object and I have database object that stores the data for each card.
Now here comes the complicated part:
When I play a card, I pull data from the card database, I compare some variables from the map controller, the map database and the tile objects, then set new data in the map database and tile objects.
It becomes a nightmare, because I end up with code like
global.tileatatus[global.mouseover.row,global.mouseover.col] = status_index
And as we all know this doesn't work. But I need to call data from the map database object through the tile I'm pointing my mouse at...
Help me out here...
How can I call variables from one object through another object without ending with multiple global.thing.anotherthing situation...
My brain hurts. I have been thinking about this for a week without writing a single line of code. I have reached the point where I set 7 variables before I reach the point I even call the one thing I must actually change...