5 Replies Latest reply on Aug 4, 2006 9:13 PM by kglad

    Need help with RPG

    RDG10
      Hi, I'm developing an RPG in Flash 8 Professional. It's from bird's eye view, the character only rotates, background is the one that moves (the character is always centered). I've designed the backgrounds but the character walks through the walls, I've gone through a lot of tutorials but all of them are the same (your character decreases its _xscale). I don't want that because my character is always centered. Can anyone tell me how to do this? And how to make my character not go through other stuff like desks?

      Thanks in advance
        • 1. Re: Need help with RPG
          kglad Adobe Community Professional & MVP
          use a loop that continually checks if you character is going to contact (use a hitTest() ) an object.
          • 2. Re: Need help with RPG
            RDG10 Level 1
            I'm relatively new to Flash, I do understan hiTest but I don't no how to use a loop.
            • 3. Re: Need help with RPG
              kglad Adobe Community Professional & MVP
              using a loop in computer programming is fundamental. loops allow you to execute code repeatedly (usually changing one or more parameters with each loop iteration) in a succinct manner.

              now, you probably are already using a loop to repeatededly check for a user's keyboard input to determine whether you character should walk left or right, up or down. in that loop you should execute another loop that checks if contact is made with an object.

              in your situation of a character (with instance name, say characterMC) and walls (with instance name, say wall1,wall2,...,wallN), you could use:

              • 4. Re: Need help with RPG
                RDG10 Level 1
                Yea that's the problem, I don't want that, for example: if (condition) _x -= 10 because my character is always centered. What do you suggest to put in "do sumthin, ur about to hit a wall"?
                • 5. Re: Need help with RPG
                  kglad Adobe Community Professional & MVP
                  i don't know what you're seeing that would cause you to say, "Yea, that's the problem. ..."

                  if a positive hitTest() will result from the movement of your walls, don't allow that movement. if you want your character to rebound, then code that rebound (of the walls).