3:42am - Well I'm up late working again and this time I'm at an unusual place; the Denny's at the other end of the road!
It's a little more expensive than my usual places but boy do they go out of their way to make it worthwhile. Yum!
Now, tonight I'll be working on World of Thardomhainn again.
Last time, I was about to make the MobileLocation poll its Tile reference for its X and Y coordinates in Tile Space.
Hokay that's in. Now let's figure out the logic for movement.
First the player presses one of the eight directions. This is read by the PlayerInput component. The PlayerInput calls the Move method on the MobileMover component. The MobileMover component then checks the tile in the direction indicated by the PlayerInput call, to see if it's locked or blocking. If it's not locked or blocking, the player moves into that tile. If it is locked or blocking, something else happens.
That's where it becomes fuzzy. ^.^;;
I'm not entirely sure what I want to happen then. I mean, if the player tries to walk into a blocking tile it'll probably make a bump sound, but what about if the player moves into an enemy, should it attack them? Push them? What about an NPC, should it talk to them? Push them? I'm thinking it's most likely that a player is bumping into these things by mistake, so I'll probably make it so that it just makes a bump noise if it's blocked or locked.
Hokay. So for now we'll do that. First I'll start in the middle and make MobileMover check the tile in the direction selected. But this check will be in tile space, not world space, so I need a tile space GetTileAt method on the TileGrid, and I also need the MobileMover to have a reference to the MobileLocation component so it knows where it is and what tile grid it's on.
4:18am - I wonder if I should combine MobileLocation and MobileMover? They're pretty tightly linked as it is. Though, it's possible later on I'll write a component that needs MobileLocation but not MobileMover, I dunno if that would even make a difference though...
For now I'll keep them seperate since I already made them that way. I'm just thinking, maybe I'm taking this 'everything a component!' strategy too far. ^.^;;
5:05am - Well, it looks like I've got a race condition of sorts, where one class is trying to access data from another before it's been set. Two different Awake() methods, in opposite order. I'm not sure why the MobileLocation needed to poll its location in Awake though instead of Start so I switched it around. We'll see if this makes any other bugs.
5:28am - Okay first I had to fix the first GetTileAt() method I created, that got the tile at given world position. It was broken. Logic didn't make any sense. Took me like twenty minutes to math out a solution. Felt like longer. Must've been thinking in bullet time. Heh.
Anyways now the player knows where he is on the tile grid. Next up, I go back to what I was doing before and make another GetTileAt method, but this time for Tile Space.
5:58am - Okay I've got some basic movement code in place, now I just need to handle the player input code to see if this movement code works!
But that'll have to wait for another time. Even though I've only been working about two hours, I told myself I'd go home and try to get some sleep at six, and that's in less than a minute now.
I'd like to come here again to work sometime late at night, but the prices are awfully high. I could get two McDonalds meals for the price of one here, and that's a fancy meal. I could get almost four of my mini-mc-meals for this price. Whew!
Still, the food was darn good, and I drank a lot of coffee, so I don't feel so bad.
Good night everyone!
It's a little more expensive than my usual places but boy do they go out of their way to make it worthwhile. Yum!
Now, tonight I'll be working on World of Thardomhainn again.
Last time, I was about to make the MobileLocation poll its Tile reference for its X and Y coordinates in Tile Space.
Hokay that's in. Now let's figure out the logic for movement.
First the player presses one of the eight directions. This is read by the PlayerInput component. The PlayerInput calls the Move method on the MobileMover component. The MobileMover component then checks the tile in the direction indicated by the PlayerInput call, to see if it's locked or blocking. If it's not locked or blocking, the player moves into that tile. If it is locked or blocking, something else happens.
That's where it becomes fuzzy. ^.^;;
I'm not entirely sure what I want to happen then. I mean, if the player tries to walk into a blocking tile it'll probably make a bump sound, but what about if the player moves into an enemy, should it attack them? Push them? What about an NPC, should it talk to them? Push them? I'm thinking it's most likely that a player is bumping into these things by mistake, so I'll probably make it so that it just makes a bump noise if it's blocked or locked.
Hokay. So for now we'll do that. First I'll start in the middle and make MobileMover check the tile in the direction selected. But this check will be in tile space, not world space, so I need a tile space GetTileAt method on the TileGrid, and I also need the MobileMover to have a reference to the MobileLocation component so it knows where it is and what tile grid it's on.
4:18am - I wonder if I should combine MobileLocation and MobileMover? They're pretty tightly linked as it is. Though, it's possible later on I'll write a component that needs MobileLocation but not MobileMover, I dunno if that would even make a difference though...
For now I'll keep them seperate since I already made them that way. I'm just thinking, maybe I'm taking this 'everything a component!' strategy too far. ^.^;;
5:05am - Well, it looks like I've got a race condition of sorts, where one class is trying to access data from another before it's been set. Two different Awake() methods, in opposite order. I'm not sure why the MobileLocation needed to poll its location in Awake though instead of Start so I switched it around. We'll see if this makes any other bugs.
5:28am - Okay first I had to fix the first GetTileAt() method I created, that got the tile at given world position. It was broken. Logic didn't make any sense. Took me like twenty minutes to math out a solution. Felt like longer. Must've been thinking in bullet time. Heh.
Anyways now the player knows where he is on the tile grid. Next up, I go back to what I was doing before and make another GetTileAt method, but this time for Tile Space.
5:58am - Okay I've got some basic movement code in place, now I just need to handle the player input code to see if this movement code works!
But that'll have to wait for another time. Even though I've only been working about two hours, I told myself I'd go home and try to get some sleep at six, and that's in less than a minute now.
I'd like to come here again to work sometime late at night, but the prices are awfully high. I could get two McDonalds meals for the price of one here, and that's a fancy meal. I could get almost four of my mini-mc-meals for this price. Whew!
Still, the food was darn good, and I drank a lot of coffee, so I don't feel so bad.
Good night everyone!