Struggling with AI and collisions

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi there all,

    Im very new to construct and really enjoying the game making process. Most of my knowledge upskilling is from looking up forums or youtube vids on the function / feature im working on at the time.

    appreciating there is more than one way to achieve the same result with slightly different logic and coding, im finding my organising of groups starting to get a lil messy and some of my functions not quite doing what i'd like.

    I was hoping someone might be able to please help with the following 3 questions?:

    1) my AI (security guard) seems to be working pretty well, with the exception of 2 things:

    I'm trying to have the collision with the security guard only be allowed once every 0.5 seconds. i tried playing around with WAITs and STATE loops, but have yet to be able to find the code / logic to achieve this. Ultimately, I will apply the same logic on the PLAYER's attack.

    2) the Security guard has the LINE OF SIGHT behaviour and responds and moves well with it. I ended up using the SIMULATE CONTROLS as the MOVE TO didn't seem to work well (it kept stopping the sprite). Currently the guard does not jump over the building to track me? is this because im not using the MOVE TO? How can I get him to follow my character?

    3) when coding my attack collisions. is it best ot have my attack animation wider? so, i can use that extended collision boundary when trying to determine with and attack overlapped the enemy sprite? i noticed again, there are many ways people attack this (pardon the pun). some spawn and pin sprites after the attack button is pressed, other's just use the attacking player animation. some use boolen states changing into attack states, while others don't worry about this. it is difficult to know why some different techniques are used over others i.e is there an efficiency of resources / ease of reading code or is it it just a creative option by the programmer.

    any help on any of my questions would be greatly appreciated. thank you :)

    kind regards,


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. You would use a condition comparison with a variable, set it to false during the wait and back to true after the wait so it's possible to attack

    2. Not sure what you're doing here, I see only a move to action. I would use simulate control which includes the jump but you need to tell it when to do those

    3. It depends on your game, you could use any of these listed

  • thx lionz - I will investigate further. I really appreciate ur input. :)

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