This cart is still in progress. I just wanted to upload it to show a few people.
So at the moment, tapping Z will increase your run speed ever so slightly, but it returns to normal after a moment.
Later, running faster will be easier for wolves to hear, and attract their attention to you.
X is used to show the path finding grid, but path finding isn't fully implemented yet, though the methodology is commented out in the wolf state system tab in the "RESUME" state. The grid is generated each time you enter a new room, and the wolves will really only use it to investigate sounds, or to find their way back to their regular patrol paths.
Today, I got the bunny to hop, I removed moving backwards (as the down button will be reserved for throwing rocks), and I modified some of the sprites, and commented out the RESUME state.
I just finished this method for path finding that I will implement in my other projects.
This method is resizable and really easy to implement and understand.
I spent the last day concocting this.
Essentially it creates a heat map/height map of costs that can be traversed by agents by referencing the node list.
Press X to place walls or remove them.
Press Z to set the end node to the nearest node to the on-screen cursor.
Cursor controlled with arrow keys.
The method works this way:
Create an empty list for checked nodes. We will push nodes into and out of it. Any node inside is there only temporarily.
We start with the first node, set it to visited, and put its neighbors into the checkedNodes list.
While the length of list of checkedNodes is bigger than 0, check all neighbors of all nodes in list, and pop out nodes from list that were visited. Only new nodes get added in. Any node after checked is removed.
This creates a cascade effect that fills the entire possible connected set of nodes with costs.
To traverse it, simply find the nearest node in world space to your agent, and check the neighbors and find the one with the lowest cost, set that to your next movement target, and move to it. If you get to the end node, stop moving. If the node the agent is on has no neighbors, also don't do anything.
I made it so you can give it a grid size at the top of the code using the SIZE variable, and it will make it just work.
And there you go. Hope you like it.
Slight modification of my path finding method, except this method is now modified to allow an arbitrary size grid to be instantiated. I invite you to open it up and fiddle with the code.
The agent is the cat creature, and hopefully my code is readable enough. Simply changing the SIZE variable at the top should be enough to get a feeling for different grid sizes.
Z changes modes between drawing height for tiles, and simulating the water
X when pressed or released, toggles the control scheme.
In Draw mode, holding X allows you to change tile heights with the UP and DOWN arrows.
In Sim mode, you control the Log object with the arrows, but holding X allows you to change the water's base height.
The log will float up to meet the water level or fall with it. The log hasn't been programmed to interact with the tiles at the moment.
This whole thing is just a test to show how a more 2.5D feel could be achieved through using a mask to determine the height values in an image and using that to determine where to draw water.
You can download it and use up to 8 controllers to have a ouijia board party. Try try it out. The multiplayer voting stuff doesn't seem to work in the browser.
View Older Posts