5:47pm - Man, today has sucked hard so far. First I slept in until three thirty, then I had my breakfast and that was okay, then I wanted to do some work but my anxiety and depression were flaring hard. I had a hard time doing anything and I ended up laying in bed until 5pm. I finally got up and got dressed and headed out to the McDonalds to work, which is where I am now, but on the way here my boot lace snapped! Geez! These boots are terrible for snapping laces but I've never had it happen while I was walking somewhere before. So I had to hobble the rest of the way to the McDonalds with one boot barely staying on.
Anyways I'm here now and I plan to make the most of it. I haven't heard anything from Zax since yesterday so I'm going to be working on World of Thardomhainn again.
6:06pm - Oh and of course there's a new version of Unity when I'm not at home. Argle-blargle...
Anyways, let's tak a look at World of Thardomhainn...
Gotta load up the TileGrid script and make it add the tilegrid to a list of some kind.
Ah, I see why I didn't do that in the first place now. The script creates tile grids in the editor, so the list wouldn't be saved for the gameplay. It'll need to make the list from the contents after the game starts, instead.
But first, what kind of list should I put the tiles in? They're complex objects so the most logical options are either a list of lists to make a two dimensional list, or a single list using the X and Y size parameters to divide up the list.
Well, a List is Serializable in Unity and a List of Lists isn't, I think, so I should probably go with just a list.
7:06pm - I did what I said then let myself get distracted by the Twitters for a bit. I actually feel a little more relaxed for a change, so maybe it was a good thing? Anyways back to work.
Right now I'm making the player and some of the general shared code for mobiles to move on and interact with the tilegrid.
8:05pm - I got distracted by some videos this time, but I'm back. Looking at the code I'm writing though, I'm not sure I fully understand what I'm doing, so I think it's time I sorted out the logic.
Basically, the mobiles will be completely seperate from the TileGrid object. They'll hold a reference to the tile they occupy, but sit on top of the tilegrid in virtual space. I'm thinking I'll have a component dedicated to keeping track of the mobile's location which is seperate from the component for moving and the other components.
When the player is instantiated, its components initialize and the MobileLocation component figures out what the tile underneath it is. Now, how does it do that? That's a question I haven't answered yet.
The MobileLocation component knows its location in world space but not in tile space. Hmm... Well, the tilegrid is located at 0,0 and if I keep it there, the tile will thus know the position of the tile underneath it, by dividing its location by the tile size parameters.
So, should the TileGrid have a function that returns the tile at x,y in world space? That makes sense I think. I'll try writing one for that.
10:01pm - Okay the TileGrid has the function I mentioned earlier, and then I went ahead. I made a TilePosition component for the tiles to track their position in tile space, and wrote some code to set up the x and y coordinates in the Awake function of the TileGrid.
Now I can make the MobileLocation retrieve the x and y from the tile it recieves from the TileGrid.
But that's enough work for today I guess. I'd like to stay and do more but it's a little after ten and I expect Robby wants dinner.
Anyways I'm here now and I plan to make the most of it. I haven't heard anything from Zax since yesterday so I'm going to be working on World of Thardomhainn again.
6:06pm - Oh and of course there's a new version of Unity when I'm not at home. Argle-blargle...
Anyways, let's tak a look at World of Thardomhainn...
Gotta load up the TileGrid script and make it add the tilegrid to a list of some kind.
Ah, I see why I didn't do that in the first place now. The script creates tile grids in the editor, so the list wouldn't be saved for the gameplay. It'll need to make the list from the contents after the game starts, instead.
But first, what kind of list should I put the tiles in? They're complex objects so the most logical options are either a list of lists to make a two dimensional list, or a single list using the X and Y size parameters to divide up the list.
Well, a List is Serializable in Unity and a List of Lists isn't, I think, so I should probably go with just a list.
7:06pm - I did what I said then let myself get distracted by the Twitters for a bit. I actually feel a little more relaxed for a change, so maybe it was a good thing? Anyways back to work.
Right now I'm making the player and some of the general shared code for mobiles to move on and interact with the tilegrid.
8:05pm - I got distracted by some videos this time, but I'm back. Looking at the code I'm writing though, I'm not sure I fully understand what I'm doing, so I think it's time I sorted out the logic.
Basically, the mobiles will be completely seperate from the TileGrid object. They'll hold a reference to the tile they occupy, but sit on top of the tilegrid in virtual space. I'm thinking I'll have a component dedicated to keeping track of the mobile's location which is seperate from the component for moving and the other components.
When the player is instantiated, its components initialize and the MobileLocation component figures out what the tile underneath it is. Now, how does it do that? That's a question I haven't answered yet.
The MobileLocation component knows its location in world space but not in tile space. Hmm... Well, the tilegrid is located at 0,0 and if I keep it there, the tile will thus know the position of the tile underneath it, by dividing its location by the tile size parameters.
So, should the TileGrid have a function that returns the tile at x,y in world space? That makes sense I think. I'll try writing one for that.
10:01pm - Okay the TileGrid has the function I mentioned earlier, and then I went ahead. I made a TilePosition component for the tiles to track their position in tile space, and wrote some code to set up the x and y coordinates in the Awake function of the TileGrid.
Now I can make the MobileLocation retrieve the x and y from the tile it recieves from the TileGrid.
But that's enough work for today I guess. I'd like to stay and do more but it's a little after ten and I expect Robby wants dinner.