Controls, Expectations, and What is Possible


Author: Marie Halper

Posted on 6/7/2024

This week, my main focus was on two things: fleshing out how cards work, and making controls understandable. From our cross-studio testing, a major bit of feedback we got was not understanding the controls for Trading Card Dungeon. This was understandable, as until now we hadn't really made an effort towards explaining the controls to the player. This is obviously an issue if we want anyone to enjoy the game outside of the main menu. This caused me to take a look back at the game as a whole and think. How would someone control this game from just a glance? I thought about it for a good while, with the first obvious thought being with a mouse. However, hypothetically, how would the game work with a keyboard? I had already had the basic card attack using 'E' and having the end turn button be 'R' but with a full field of cards how would that look? I looked to what most games use for controls, which brought me to using WASD, however that only covers 4 cards. Then I thought, why not add 'Q' and 'E' for the other two. I drew a very rough visual guide for this control scheme, and asked one of my friends for his thoughts on the layout.


Obviously, there are still some controls that I would need to add, like accessing the hand, drawing from the deck, and a proper button for ending turn. But for the cards themselves, it works pretty well. I set out a day to implement these new controls, as well as reworking how the cards themselves work, making them into their own script instead of just variables inside of the GameManager. As I made the script I thought about what goes into each card, those things being the card's Attack score, Boost score, name, some indexes for later mechanics, such as card skills, and if the card is used, or tapped. 


After setting this up, I decided to properly focus on the controls for the cards once they are played. In the GameManager's update method, it checks for if it is currently the player's turn, and if so, checks for input regarding the cards, so in this case, Q, W, E, A, S, or D. Upon being pressed, and if the respective card exists currently, the card will check if it has already attacked this turn, and if not it will attack the enemy, and then rotate, visibly showing that it is "tapped" and sets the appropriate variables. 

As you can see, there is a bit more to the check, which was implemented when I decided to add mouse controls as well to the game. There are extra variables in the card script for mouse controls as well, such as a boolean that states if the card is being clicked on or not for other scripts to access, and a method that activates whenever the card is clicked on.


The new boolean is used in the GameManager to tell when the card should activate, as instead of just checking for the respective key, it also checks for if the boolean is true, and will enter the if statement if either of those are true, meaning both methods of control work. Within the if statement, it reverts the selected boolean back to false as well. After setting this up for every card, I decided to test to make sure it worked, and to my surprise, it did! At least, it did for the most part. Once I ended turn, I would instantly lose. After some searching through methods to make sure it all worked as intended, I noticed that when redoing the card controls, I accidentally forgot to add a call to the method that gives the player their turn back.

 

After adding the method back in, and adjusting said method to untap the cards properly, it was all fully functional! The last steps that I had to do was make a proper button for ending turn, which was pretty simple, and worked closely to how the buttons in the pause screen and main menu worked, and put the controls somewhere on the screen so the player can actually know how to play. Honestly, this should have been implemented a while ago, but the human mind is silly and sometimes assumes everyone can read minds. Oh well, it is there now at least, with the current state of the game board looking like this, with all cards fully functional via mouse or keyboard!


Leave a comment

Log in with itch.io to leave a comment.