Delayed response to object stimuli

0 favourites
  • 2 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • C3 game file

    In my game, enemies move around, advancing 24 pixels up, down, left, or right (all movement and character and level design is regulated to this "grid"). During each move segment, it will move a certain number of 24x24 blocks (Pathfinding is not used). Contained with each enemy are four sprites - I call them "MoveChecks" - that represent one of those four directions. MoveChecks also hold the Line Of Sight behavior with a 1* cone which faces one of the four directions.

    I'm using the MoveTo addon behavior, but even when the enemy moves exactly side-by-side to a solid wall object (no overlap), it causes the enemy to stop even though there's no direct collision. So the MoveCheck objects check if they are overlapping a wall and prevent further movement in that direction.

    When a MoveCheck catches sight of the main character, Buster, it is supposed to charge ahead in that direction (later I will restrict LOS to only the direction the enemy is facing).

    If Buster is more than a single block away and the enemy moves into the same row or column (establishing LOS), then the enemy moves quickly in the direction of Buster.

    However, if Buster is exactly one square away to an enemy's corner (ie: top-left) - so, 24-pixels up and 24-pixels left - and the enemy moves up or to the left so to be in direct linear alignment with Buster, the state of the enemy will change to its proper "Attack" state, but won't actually charge in the proper direction until it is one cell father in the direction it was moving when it first caught LOS of Buster.

    So if the enemy is moving to the left and is DIRECTLY below Buster, establishing LOS, it will continue to move one more cell to the left THEN dash upwards towards (rather, PAST) Buster.

    I have tried adjusting the Pin position of my MoveCheck objects relative to the enemy they're contained with. I've resized them. But this is the one issue I cannot overcome. It works EXCEPT for close proximity. I have a feeling that it has to do with how LOS behavior checks for actual LOS of an object but I'm not sure.

    Can someone please examine my event lines and help me identify (or even solve) the problem area?

    Thank you so much. (And sorry for the lengthy explanation. I was trying to make the case understandable.)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • After a longshot whim, I changed the LOS cone to 2* instead of 1. PROBLEM SOLVED!

    Thank you to anyone who took the time to read my (clearly) long post and who was willing to try to offer help! But I think I got it now.

    If you see any suggestions, though, to help improve what I have here, PLEASE, I could use all the help I can get!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)