Dungeon Crawler - feedback please

After what feels like forever, I think I’m about done with my dungeon crawler. I would really like some feedback on this project before I submit it. Here is the link:
Crawler - ver 1.0
I should warn you that this is not mobile friendly, you will need a keyboard to play. Also it is kinda hard to win, but it is possible. Please let me know what you think of the game and my code if you can. Thanks :slight_smile:

1 Like

I like the layout and the styling of the dungeon & didn’t see anything going wrong. One thing I would say is if you hold a key down it would be better to continue moving in that direction.

2 Likes

Thanks for taking a look :slight_smile: . I did originally have it to where you could hold down a key and keep moving in the same direction but it caused issues. The problem was that since the game logic and screen are updated after each key stroke, instead of moving a fixed rate it would just lock up until you released the key, then after some lag, would jump forward. I think I know how I can work around that tho, so I will add that in after I get off work tonight. Again thanks for the feedback

Okay I added in the ability to hold down the key and keep moving. :slight_smile:

real nice looking! respect!
i dont wanna bash but…the room setup is not random. i see the item setup is random.

Thanks for having a look. Glad you liked it. As far as the “room setup” goes, a random dungeon generator was not part of the user story, although they did implement one in the example. The rule about randomness reads:
6. User Story: All the items and enemies on the map are arranged at random.
That being said, I do think this game would benefit from implementing one. :wink:
Thanks again for the feedback.

:open_mouth: I’m impressed! I want to learn to stuff like that! My only suggestion is make WASD also movement keys! I lack arrow keys without using the FN key and it was annoying to play for me :(</3

Great suggestion :slight_smile: just added in the support for WASD. Thanks for the feedback.

sorry, ur right.
i srs thought it was a user story. i should read better. could have saved me a lot of work!

Lol, no problem. Truth be told I had originally planned on implementing a generator but I was having a lot of trouble coming up with an algorithm that didn’t leave the map with big empty spaces or something very repetitive. In the end I figured that since it was not a requirement and not the real focus of the challenge that it was better to just focus on the React code, and not let myself become sidetracked.

Much easier to play now! :slight_smile: I can’t wait to hit this project now. Ha.

Hi Josh, I’m stuck on the same issue. I hold down the arrow keys to move the player and it stalls/lags and jumps across the map. How did you solve this issue. I know its been a while, but this is the first forum I’ve seen with my same problem. Any help would be appreciated :slight_smile:

@cryder9898
Ok, I had to go read through my code again, but here is how I did it.

handleKeyDown(e)
    {
      if(this.state.hold){ return; } //If the button is held down and "hold" variable is already set, just return
      //else ....
      // set delayVar = timer that calls handleKeyUp, and set hold to true
      this.setState({ delayVar:setTimeout(this.handleKeyUp.bind(this),100), hold:true });
    //.....
}

    handleKeyUp(e)
    {
      if(this.state.delayVar!==undefined) //if the timer variable is set
        {
          clearTimeout(this.state.delayVar); //clear it
          this.setState({ delayVar:undefined, hold:false });  //update state
        }
    }

So basically I just set a state variable when a key is pressed and a timer to control how often the update can happen. The main problem is that the move / update functions happen so fast that it is not able to keep up, creating the lag / jumping problem. So you just need to make sure that it can only update so many times per second and for that you just need a timer and a variable.
I hope that helps. If not hit me back and I will try to help a little more :slight_smile: