4:55am - Well I was feeling pretty down this morning and I didn't want to do anything, and I slept all day yesterday, so I'm not tired, and so I decided to come out to the McDonalds and work on my projects. I don't do my best work when I'm down but it keeps me busy and tends to improve my mood, so here I am.
Now last time I worked on my Roguelike Project I was about to implement a grid for tracking the positions of the tiles relative to oneanother. After having some time away from the project though I had a few questions and concerns pop up, including wondering if it was right to put that sort of thing in the Controller instead of the Model.
I'm going to look over the code a bit and make sure of where I want to put this.
5:07am - A-ha! I thought so. I hadn't looked at the Model last time, since I was so focused on the Controller, but the Tile class has position properties and the World class already stores the tiles in a two dimensional array, so I don't have to make a reference array.
5:34am - So I've suddenly hit a design snag. It's coming from the code I used to start myself off, and as I recall it was a split second decision by the fellow who wrote this bit originally. See, he made it so that each Tile can have an InstalledObject and that InstalledObjects have their own movement cost, and that if the movement cost is 0 then it's impassible. But, what about tiles with no InstalledObject? Or tiles with passable InstalledObjects? How do I determine the movement value to pass through them?
Well this is something I have to figure out on my own, since it wasn't implemented in the base code or even part of the design of that.
So, I could have the code figure out if there's an InstalledObject and use it's movement value or the tile's movement value if it's not present. But what if there's a passable InstalledObject in an impassible tile? Like a table in a lake? That would make a bridge I guess. Walls are installedObjects so there can't be anything placed on top of a wall.
When I think about it, I'm not sure there will be any impassible tiles, just impassible InstalledObjects, since that's where the walls come in, and for better or worse any floor tile can be entered, even if it's water or lava. Or can it? I was thinking of making this like a Mystery Dungeon game, and those don't let you walk on water by default. Well, I think I can make shallow and deep water tiles and have them passable but only under certain circumstances later on.
For now I'm going to make it so that it checks first if there is an InstalledObject, and if there is, it uses that's movement parameter. If there isn't, then it uses the tile's movement parameter.
6:51am - Okay I think I've got the code working for moving characters in the upwards direction. I'd like to test it before either copying it eight more times or making a function, but I can't properly test it since I still have to write the code to move the character in the view from square to square when the tiles update.
Also I got really distracted and spaced out for like a half hour...
7:19am - On closer observation, the code WAS in place to move the player's sprite, but it wasn't working right.
7:30am - Alright, now it's not working right in a different way. The function is running but the sprite isn't moving.
7:53am - Okay I figured out what was wrong, I forgot to add to the position for the movement, so it was effectively moving to where it started. Ah well at least I found it without too much hassle.
Now I have to make the other directions work.
7:58am - Alright I encapsulated the code in a helper method, and it works fine. So, I'll set it up for the other eight directions now.
8:03am - Alright I've got the inputs working but not correctly, for each direction. I think it's a problem with the InputManager though, not taking in the diagonal inputs properly. That's in a different domain of the program, though, and I'm tired and have to use the bathroom and I think I've done enough for today, so I'mma pack up and go and leave this problem for next time.
Now last time I worked on my Roguelike Project I was about to implement a grid for tracking the positions of the tiles relative to oneanother. After having some time away from the project though I had a few questions and concerns pop up, including wondering if it was right to put that sort of thing in the Controller instead of the Model.
I'm going to look over the code a bit and make sure of where I want to put this.
5:07am - A-ha! I thought so. I hadn't looked at the Model last time, since I was so focused on the Controller, but the Tile class has position properties and the World class already stores the tiles in a two dimensional array, so I don't have to make a reference array.
5:34am - So I've suddenly hit a design snag. It's coming from the code I used to start myself off, and as I recall it was a split second decision by the fellow who wrote this bit originally. See, he made it so that each Tile can have an InstalledObject and that InstalledObjects have their own movement cost, and that if the movement cost is 0 then it's impassible. But, what about tiles with no InstalledObject? Or tiles with passable InstalledObjects? How do I determine the movement value to pass through them?
Well this is something I have to figure out on my own, since it wasn't implemented in the base code or even part of the design of that.
So, I could have the code figure out if there's an InstalledObject and use it's movement value or the tile's movement value if it's not present. But what if there's a passable InstalledObject in an impassible tile? Like a table in a lake? That would make a bridge I guess. Walls are installedObjects so there can't be anything placed on top of a wall.
When I think about it, I'm not sure there will be any impassible tiles, just impassible InstalledObjects, since that's where the walls come in, and for better or worse any floor tile can be entered, even if it's water or lava. Or can it? I was thinking of making this like a Mystery Dungeon game, and those don't let you walk on water by default. Well, I think I can make shallow and deep water tiles and have them passable but only under certain circumstances later on.
For now I'm going to make it so that it checks first if there is an InstalledObject, and if there is, it uses that's movement parameter. If there isn't, then it uses the tile's movement parameter.
6:51am - Okay I think I've got the code working for moving characters in the upwards direction. I'd like to test it before either copying it eight more times or making a function, but I can't properly test it since I still have to write the code to move the character in the view from square to square when the tiles update.
Also I got really distracted and spaced out for like a half hour...
7:19am - On closer observation, the code WAS in place to move the player's sprite, but it wasn't working right.
7:30am - Alright, now it's not working right in a different way. The function is running but the sprite isn't moving.
7:53am - Okay I figured out what was wrong, I forgot to add to the position for the movement, so it was effectively moving to where it started. Ah well at least I found it without too much hassle.
Now I have to make the other directions work.
7:58am - Alright I encapsulated the code in a helper method, and it works fine. So, I'll set it up for the other eight directions now.
8:03am - Alright I've got the inputs working but not correctly, for each direction. I think it's a problem with the InputManager though, not taking in the diagonal inputs properly. That's in a different domain of the program, though, and I'm tired and have to use the bathroom and I think I've done enough for today, so I'mma pack up and go and leave this problem for next time.