Hi everyone,
I have devised a little system through eventing, where the player must avoid rocks being thrown at them by an enemy standing higher on the map. The goal is to climb ladders in a Donkey-Kong like fashion high enough until the enemy retreats.
Everything is working well with the exception of the way the rocks damage the player. Most of the time, the player is clearly hit by the rocks and the damage sequence is activated. But sometimes, when a player is walking upward on the Y axis, they can quickly change tiles they are standing on even though the rock is clearly above them (the rock is constantly moving in a downward motion) and it doesn't register as a hit because the rock is technically on a different tile by that point.
Here is the eventing that dictates when the player is hit:
So, as you can see, all it is doing is checking whether the rock and the player share the same tile every 7 frames. What that doesn't address, is in the process of moving up a tile and the rock is in the process of moving down a tile - in spite of the rock moving straight over the player the damage will be avoided.
I think the wait at the very end is arbitrary as long as it's 10 frames or less. I'm not sure howmany frames exactly it takes the player to traverse a tile at the default speed.
Let me know your thoughts.
I have devised a little system through eventing, where the player must avoid rocks being thrown at them by an enemy standing higher on the map. The goal is to climb ladders in a Donkey-Kong like fashion high enough until the enemy retreats.
Everything is working well with the exception of the way the rocks damage the player. Most of the time, the player is clearly hit by the rocks and the damage sequence is activated. But sometimes, when a player is walking upward on the Y axis, they can quickly change tiles they are standing on even though the rock is clearly above them (the rock is constantly moving in a downward motion) and it doesn't register as a hit because the rock is technically on a different tile by that point.
Here is the eventing that dictates when the player is hit:
Code:
◆If:Y-rock2 = Y-player1
◆If:X-rock2 = X-player1
◆Change HP:Entire Party, - 45
◆Play SE:Flash1 (100, 100, 0)
◆Shake Screen:5, 5, 5 frames
◆Flash Screen:(255,85,34,170), 30 frames
◆Show Animation:Player, -45HP
◆Wait:10 frames
◆
:End
◆
:End
◆Wait:7 frames
So, as you can see, all it is doing is checking whether the rock and the player share the same tile every 7 frames. What that doesn't address, is in the process of moving up a tile and the rock is in the process of moving down a tile - in spite of the rock moving straight over the player the damage will be avoided.
I think the wait at the very end is arbitrary as long as it's 10 frames or less. I'm not sure howmany frames exactly it takes the player to traverse a tile at the default speed.
Let me know your thoughts.