9:52am - Now it's Thanksgiving Proper and I'm working in the morning at the McDonalds. I have a sore throat and a pink eye so that's not good; I'm having some tea with honey and trying very hard not to touch my eye so it can calm down and hopefully go back to normal.
Anyways, LAST TIME ON DRAGON BALL WORK POST!
Now to figure out what happens when movement is blocked.
9:59am - So, I figure it'll return false instead of true, since it couldn't move the actor. But it also has to do something or initiate some process to handle the collision.
10:49am - I ended up checking out Reddit for a while but I still have an hour or so before Thanksgiving so I'm going to keep working!
Now, I'm not sure if there should be 'One Collision Method To Rule Them All' or two depending on if the player collided with an InstalledObject or another Actor. Oh yeah and there can be blocking tiles too can't there? So that would be three ways to be blocked.
11:02am - Alright for now I think I'm going to try and make 'One Collision Method To Rule Them All' and it'll be a callback function. The Actor will call the callback anytime it collides with something, and the WorldController will process the collision instead of the Model's objects.
The Actor will send the object it collided with as a parameter of the callback, as an Object. Then using the GetType() method I should be able to figure out if it collided with an Actor, an InstalledObject, or a Tile, and respond appropriately.
So first thing, I'll make the callback function handling.
11:15am - Okay I've got the onCollisionCallback in there, I should be able to code with it in Actor to make it call that at the correct times and pass the correct object. Then I'll work on the WorldController onCollisionCallback method.
11:57am - Okay now I've got it so that every situation of blocking results in the callback being called, with one of the three types of blockers, depending on which one takes precedence. Actor, InstalledObject, Tile.
It's almost noon so I should get going to Thanksgiving soon, but I don't want to be there on the dot so I'll work just a bit longer.
The next step of this mad endeavour is to create the OnCollision handler in the WorldController class.
12:10pm - Okay that seems to be working with no errors. Next up, I want to test the method of determining the type of object collided with, before going to Thanksgiving.
12:16pm - I've got a bug; the collisions aren't registering. Gotta track it down...
12:22pm - Ah, I think I figured it out. I still have that code preventing the movement code from being called in the first place if it's an illegal move. I'll take that out and let the Actor determine if it's an illegal move.
12:25pm - Okay collisions with actors are detected right as rain. Collisions with walls nolonger works. XD
I think I have to make sure the wall has a 0.0f movementCost.
12:27pm - No, that's not it. It's already set to 0.0f. I guess my code must be skipping it somehow. I'll check the if tree.
12:39pm - Okay it's working now, I fixed the if tree. Now it's time to go to Thanksgiving.
Happy Thanksgiving Everyone! At least the Canadian folks anyways.
Anyways, LAST TIME ON DRAGON BALL WORK POST!
If the tile doesn't contain an actor and is not blocking and doesn't contain an installedObject, then move the actor.
Else, If the tile doesn't contain an actor and is not blocking and contains an installedObject which is not blocking, then move the actor.
Else, If the tile contains an actor, ...
Else, if the tile doesn't contain an actor, and is blocking, and doesn't contain an installedObject, ...
Else, if the tile doesn't contain an actor, and is not blocking, and contains an installedObject which is blocking, ...
Else, if the tile doesn't contain an actor, and is blocking, and contains an installedObject which is blocking, ...
Else, If the tile doesn't contain an actor and is not blocking and contains an installedObject which is not blocking, then move the actor.
Else, If the tile contains an actor, ...
Else, if the tile doesn't contain an actor, and is blocking, and doesn't contain an installedObject, ...
Else, if the tile doesn't contain an actor, and is not blocking, and contains an installedObject which is blocking, ...
Else, if the tile doesn't contain an actor, and is blocking, and contains an installedObject which is blocking, ...
Now to figure out what happens when movement is blocked.
9:59am - So, I figure it'll return false instead of true, since it couldn't move the actor. But it also has to do something or initiate some process to handle the collision.
10:49am - I ended up checking out Reddit for a while but I still have an hour or so before Thanksgiving so I'm going to keep working!
Now, I'm not sure if there should be 'One Collision Method To Rule Them All' or two depending on if the player collided with an InstalledObject or another Actor. Oh yeah and there can be blocking tiles too can't there? So that would be three ways to be blocked.
11:02am - Alright for now I think I'm going to try and make 'One Collision Method To Rule Them All' and it'll be a callback function. The Actor will call the callback anytime it collides with something, and the WorldController will process the collision instead of the Model's objects.
The Actor will send the object it collided with as a parameter of the callback, as an Object. Then using the GetType() method I should be able to figure out if it collided with an Actor, an InstalledObject, or a Tile, and respond appropriately.
So first thing, I'll make the callback function handling.
11:15am - Okay I've got the onCollisionCallback in there, I should be able to code with it in Actor to make it call that at the correct times and pass the correct object. Then I'll work on the WorldController onCollisionCallback method.
11:57am - Okay now I've got it so that every situation of blocking results in the callback being called, with one of the three types of blockers, depending on which one takes precedence. Actor, InstalledObject, Tile.
It's almost noon so I should get going to Thanksgiving soon, but I don't want to be there on the dot so I'll work just a bit longer.
The next step of this mad endeavour is to create the OnCollision handler in the WorldController class.
12:10pm - Okay that seems to be working with no errors. Next up, I want to test the method of determining the type of object collided with, before going to Thanksgiving.
12:16pm - I've got a bug; the collisions aren't registering. Gotta track it down...
12:22pm - Ah, I think I figured it out. I still have that code preventing the movement code from being called in the first place if it's an illegal move. I'll take that out and let the Actor determine if it's an illegal move.
12:25pm - Okay collisions with actors are detected right as rain. Collisions with walls nolonger works. XD
I think I have to make sure the wall has a 0.0f movementCost.
12:27pm - No, that's not it. It's already set to 0.0f. I guess my code must be skipping it somehow. I'll check the if tree.
12:39pm - Okay it's working now, I fixed the if tree. Now it's time to go to Thanksgiving.
Happy Thanksgiving Everyone! At least the Canadian folks anyways.