You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The small spider variant should be able to jump around platforms when chasing the player.
The first step here will be to add proper collisions to this small spider.
Then for the actual movement, I think we can copy the exact player jump, with variable jump height, but in this case the spider will be controlling when to jump and when to stop jumping in order to maximize the chances of reaching the player.
The spider will only be jumping when it's aggro'ed and chasing the player, but it cannot continue chasing normally due to either a wall blocking its path of a hole (end of platform).
So we can split the behaviour into these 2 categories:
There's a wall blocking spider's chase path:
In this case the spider should jump while also trying to move horizontally in the direction of the player. While this is happening it keeps checking its horizontal position. Once the horizontal position changes, then that means it was able to jump over the platform and start moving towards the player, so then the spider should stop the jump (using the variable jump height mechanic) and then go into a fall state until it touches ground. While falling it also keeps moving forward towards the player, using same velocity as during chasing.
After it touches ground it continues to chase normally, until another obstacle appears.
There's a hole (end of platform) blocking spider's chase path.
In this case there are 2 options:
If player's vertical position is above the spider, the spider jumps up while moving forward in player's direction, and ends the jump while it reaches a vertical position of 6 pixels above the player. Then it starts falling down, all while continuing to move towards the player horizontally using its chase velocity.
If player's vertical position is below the spider, then it doesn't jump at all but simply walk off of the platforms edge and starts falling, while moving towards the players horizontally using its chase velocity.
The jump should also have a maximum possible duration, same as player's jump, so if for example there's a wall higher than the spider can jump the spider will continue with jumping attempts without being able to jump over it.
If at any point during the jump/fall the spider gets into melee range of the player, it should use its melee attack while in air. The use of melee attack shouldn't affect the trajectory of the spider in any way.
If the spider collides with any other obstacle while in air, it should work exactly as if the same happened to the player.
I already added all the jump animations and script files.
The text was updated successfully, but these errors were encountered:
c12hz
changed the title
Small Spider Jump
Small Spider Jump [ $90 ]
Jan 7, 2025
The small spider variant should be able to jump around platforms when chasing the player.
The first step here will be to add proper collisions to this small spider.
Then for the actual movement, I think we can copy the exact player jump, with variable jump height, but in this case the spider will be controlling when to jump and when to stop jumping in order to maximize the chances of reaching the player.
The spider will only be jumping when it's aggro'ed and chasing the player, but it cannot continue chasing normally due to either a wall blocking its path of a hole (end of platform).
So we can split the behaviour into these 2 categories:
There's a wall blocking spider's chase path:
In this case the spider should jump while also trying to move horizontally in the direction of the player. While this is happening it keeps checking its horizontal position. Once the horizontal position changes, then that means it was able to jump over the platform and start moving towards the player, so then the spider should stop the jump (using the variable jump height mechanic) and then go into a fall state until it touches ground. While falling it also keeps moving forward towards the player, using same velocity as during chasing.
After it touches ground it continues to chase normally, until another obstacle appears.
There's a hole (end of platform) blocking spider's chase path.
In this case there are 2 options:
The jump should also have a maximum possible duration, same as player's jump, so if for example there's a wall higher than the spider can jump the spider will continue with jumping attempts without being able to jump over it.
If at any point during the jump/fall the spider gets into melee range of the player, it should use its melee attack while in air. The use of melee attack shouldn't affect the trajectory of the spider in any way.
If the spider collides with any other obstacle while in air, it should work exactly as if the same happened to the player.
I already added all the jump animations and script files.
The text was updated successfully, but these errors were encountered: