Simple RPG movement coding

0 favourites
  • 5 posts
From the Asset Store
5 levels with simple coding Source-code (.c3p) + HTML5 Exported
  • Hey guys. I've got almost no past coding experiences so I'm having a difficult time thinking a solution for this.

    This is how my character moves (WASD movement)

    <img src="http://i.imgur.com/r5MQf.png" border="0" />

    Now this works pretty well, except for 2 things I can't figure out.

    1. When two buttons are pressed at once (ex. W and D) the character flies at a 45 degree angle. I want the player only to be able to press one button as once so I need a way to prevent this.

    2. I can't for the life of me let my character stop moving when he hits an object.

    Here is the capx if you wanna take a look.

    mediafire.com

    Thanks a bunch!

  • Hey guys. I've got almost no past coding experiences so I'm having a difficult time thinking a solution for this.

    2. I can't for the life of me let my character stop moving when he hits an object.

    Here you are:   

    Bumping into the table from the Right side

    go around to the right side of the table with your character, keep a 1-2 meters distance, then press "A" and go toward the table, bump into it.

    To add another stop-command for the "S" key:

    1. Click on the thin purple space under the event that says "S is DOWN" so the whole event _and_ the thin space below gets orange

    2. Right-click that thin orange space

    3. Select "Add sub-event"

    4. Select your character sprite

    5. Click Next

    6. Select "Is overlapping another object"

    7. Next

    8. Click to chose select the sprite "Pokedesk"

    9. Done

    10. Add Action

    11. Select your Main character sprite

    12. Instance variables---> Set value Front 0

    13. Press and hold CTRL and click on the "Set animation to Front_Stop below", drag it above--> under the new "Set value Front 0" command.

    14. continue with the other directions.

    Nice graphics, by the way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, i saw both of your examples. The problem if you add that condition to all the directions is that once that overlaps the table no key is going to work, so the player get stock.

    Adding a simple comparison between both positions will solve that.

    Example: http://dl.dropbox.com/u/23880596/rpgtest2.capx

  • Whoa guys! Thanks so much.

    Love this community, you guys are amazing :)

  • How about implementing a directional attack - say with a non-shooting weapon?

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