Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Code for emery chasing you

Code for emery chasing you

Scheduled Pinned Locked Moved Help and Support
5 Posts 2 Posters 1.0k Views 1 Watching
  • 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
    SavageBuilderKidS Offline
    SavageBuilderKid
    wrote on last edited by
    #1

    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
    1
    • RobinsonXR Offline
      RobinsonXR Offline
      RobinsonX
      wrote on last edited by
      #2

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

      SavageBuilderKidS 1 Reply Last reply
      0
      • RobinsonXR RobinsonX

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

        SavageBuilderKidS Offline
        SavageBuilderKidS Offline
        SavageBuilderKid
        wrote on last edited by
        #3

        @RobinsonX it is side view

        1 Reply Last reply
        0
        • RobinsonXR Offline
          RobinsonXR Offline
          RobinsonX
          wrote on last edited by
          #4

          @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
          0
          • RobinsonXR Offline
            RobinsonXR Offline
            RobinsonX
            wrote on last edited by
            #5

            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
            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Search