A more elegant way of restricting player movement at certain points?

  • #1, by RadicaaTuesday, 10. February 2015, 22:52 9 years ago
    So when making my game I've pretty much been changing the waysystem to a pixel precise wayborder everytime I've needed to restrict the player's movement in a scene. For example, I have this scene where the player is unable to move and needs to use an item from the inventory, so I just changed the wayborders to so small that moving the character should be impossible. I still got this nagging feeling that this might bug horribly at some point if the player clicks around like crazy, or something like that. Is there a more simple and elegant solution to do this?

    Newbie

    25 Posts


  • #2, by FantozziTuesday, 10. February 2015, 23:11 9 years ago
    If I don't want my character to move for a period of time I switch to an invisible character and change the walking sound to no sound.

    Newbie

    31 Posts

  • #3, by afrlmeTuesday, 10. February 2015, 23:24 9 years ago
    Here's what I would probably do...

    1. Get the playable characters current position & store into a variable via a function I had written.

    2. Hide the character or send them to another scene while bringing in an NPC version of the character & setting them to the position we stored in step 1.

    It doesn't matter if your playable character is on scene or not. The interfaces assigned to your playable character should still be visible / accessible.

    Ideally I wish they would add an option or at least a boolean field to the data structure which allows us to toggle destination / movement on & off.

    Imperator

    7278 Posts