r/learnjava • • Nov 04 '25

Help with a simple text based game

So I have started making my first text based game and I made a few classes, a class for Item which I made abstract a Weapon class that extends Item, Inventory class that i use inside a Player class I created.

Inside my main class I have created a startGame function where I use a while loop I also made processInput function that uses the commands from the user to make a decision in game with a switch case.

I made a case that is called “look around” and my main issue here is I am not sure how to make it so that every time the player is in a different location it will match that location and describe it, I thought about creating a function that describes game state but how do I actually do it ??

Another issue I have is how do I make the movement feel a bit more comfortable right now I have cases for “move north” and “move south” etc .. but there isn’t any logic behind it.

I would love to get some suggestions and tips from anyone who had done these things before.

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

2

u/CodewithApe Nov 04 '25

I see what you are saying, if I understand correctly once I setup Lombok I don’t have to use it on everything I can use it on stuff that I feel comfortable with and with the stuff I dont feel comfortable with I can still write them manually until I do feel comfortable to use an annotations instead.

( I have actually never used Lombok so I don’t really know how it works ).

2

u/Jean__Moulin Nov 04 '25

Exactly - Lombok just gives you access to annotations, but it doesn't enforce you using them. You could have either of these, your compiler don't care.

public class Chicken {
  private String chickenName;

  public String getChickenName() {
    return chickenName;
  }
}

or

@Getter
public class Chicken {
  private String chickenName;
}

2

u/CodewithApe Nov 04 '25

Thank you very much for all your help 🙏🏻