How do I create this enemy?

  • I hope this is a quite simple question.

    What is the easiest way to create a sprite that when it collides with the wall, it changes its direction either 40 degrees or a random direction the other way. Id like it to be consistent and somewhat easy to predict their direction so you can think out a path through multiple of these sprites.

    My goal is to create a little top down maze with random enemies you must run through, bouncing off the walls creating a random challenge to pass.

    What I know. I understand the basics but I am still quite new to the program so I wanted to ask the community for the fastest way for me to try and implement this into my game.

    Thank a million for any help <3

  • Sprite on collision with wall > set angle

    I'm not sure what you mean by having it both random and easy to predict at the same time.

  • Sprite on collision with wall > set angle

    I'm not sure what you mean by having it both random and easy to predict at the same time.

    What I meant by random and easy to predict are like certain parameters for example,

    When object his wall

    Angle changes between 30-50 degrees.

    I believe what I'm asking is if that's possible?

    Thank you for the answer, the first answer for me means I must have just done something wrong with my set angle action ill try and debug that.

    New question is, Can I set the angle to a range of numbers?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yep you can set angle to random(x,y) to pick from numbers between x and y.

  • Yep you can set angle to random(x,y) to pick from numbers between x and y.

    Thank you very much!

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