Moving Map Damage

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:

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.
I think I've just fixed it.

Both waits are very important. The wait on the outside of the conditional branch should be set to as low as possible to allow all opportunity for the rock and the player to be on the same tile. I have set it to 1 to fix the problem I had.

What this caused was a new problem where the player could potentially be hit unfairly twice by the same rock if they chased the rock downward. By adding in a longer wait this eradicates the possibility of them getting damaged twice.
Sounds like you pretty much have it. I love this idea by the way, sounds like it would be fun.🙂 I had a thought that I don't know if it is plausible but I thought I would throw it out there just in case. What if the boulder used was made with a boss type sprite set, like the !$ size sprites. The thought was maybe it would have a bigger hit box range and would make it harder to get away. But really the idea was to find a way to increase hit box size. If the double hit thing is to much of a problem maybe there's something here. Anyway good luck with it I hope you get it dialed.

Edit whoops just reread your post and it sounds like the double hit was an old issue, oh well hehe. Happy it worked out

Original thread: https://forums.rpgmakerweb.com/threads/moving-map-damage.79714/