hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Code for emery chasing you

    Scheduled Pinned Locked Moved Help and Support
    5 Posts 2 Posters 1.0k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SavageBuilderKidS Offline
      SavageBuilderKid
      last edited by

      I am attempting to make a RPG game on HyperPad, but I’m stuck trying to get the characters to chase me, can anyone screenshot the code to do that, or can someone walk me through it?

      1 Reply Last reply Reply Quote 1
      • RobinsonXR Offline
        RobinsonX
        last edited by

        Is your RPG top-down or side-view? They would have very different functionality. @SavageBuilderKid

        SavageBuilderKidS 1 Reply Last reply Reply Quote 0
        • SavageBuilderKidS Offline
          SavageBuilderKid @RobinsonX
          last edited by

          @RobinsonX it is side view

          1 Reply Last reply Reply Quote 0
          • RobinsonXR Offline
            RobinsonX
            last edited by

            @SavageBuilderKid You can have a timer in the enemy that would constantly trigger the following:

            • Get the position of enemy and player
            • If enemy's x position < player's x position:

            Move right. (You can use set velocity, apply force, move by, etc. depends on what you are doing.)

            • Otherwise, move left.

            This is a very simple method to emulate an enemy chasing the player. Let me know if you need more!

            1 Reply Last reply Reply Quote 0
            • RobinsonXR Offline
              RobinsonX
              last edited by

              If you wanted to, you can have the enemy jump. The code below would make the enemy jump if the player is at a higher position than itself.

              • If enemy's y position > player's y position:

              Jump (use the jump behavior)

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post