Questions tagged [text-based]

233 questions
1
vote
3 answers

Why is my global variable not working? (Python)

I am making a text-based game for school, and I want it to have a personalized name feature, but whenever I get past the function where the variable is defined, the other functions only use the original value, which is 0. Here's an example: global…
Rene707
  • 31
  • 5
1
vote
0 answers

Code duplication java object in two classes

I'm writing a text based rpg in java. The problem is that I have a class which manipulates the map (2d character array) for in multiple classes. Since I want to have multiple maps (2d character arrays) and different methods to handle each character…
Delacrank
  • 31
  • 3
1
vote
4 answers

efficiently searching arrays without using index?

So I am making a text based rpg for a class. Currently the functionality is working for one room which is all I currently want. However I want a more efficient way of doing this. I want to do this without indexes. I want to print a list of elements…
1
vote
2 answers

Can I use variables from main.py in other files?

I'm making a text-based adventure game which I plan on being quite long. Naturally, instead of having all the code in main.py I decided to split the chapters into different files to be run in if blocks according to the choices the player makes.…
Arcat
  • 11
  • 1
1
vote
1 answer

Ascii text printing out of order in my Text Based Game?

Edit: This was solved by changing my print statements to print(r""" """) the "r" prints Raw Text and ignores symbols such as "/" I'm making a Text Based game using ASCII Graphics for my High School AP Comp Sci class. The issue I am having is that…
1
vote
1 answer

How can I create a text based game like Zork in PHP?

I'm interested in creating a text-based game similar to Zork. The source code doesn't give away much, it's clear that the text input is submitted by php using the post method and the page is reloaded. Where should I start?
Ambo100
  • 1,185
  • 3
  • 15
  • 28
1
vote
0 answers

(JAVA) Text Based Game with possible Thread.sleep() problems

currently I am making a final project for my Advanced Programming class. The idea behind it was a text based version of the game Kingdom Hearts. In making this game I ran upon a big issue. The issue is the lag (which I presume is caused from using…
iFruit 9iX
  • 11
  • 1
1
vote
1 answer

How can I create a dynamic instance of a class for a text based grid?

I'm trying to make a 10x10 grid for a map for a basic text-based game in python. I managed to create a MapTile class and a player class that can move about an (x, y) grid. I'm not sure however, how to create the instances of the class to have…
1
vote
0 answers

Monodevelop C# user input

Sorry if this is a dumb question (I just started doing this) but I am currently trying to make a simple text-based RPG game in C# on Monodevelop. I want it to be that if you press 'Q' a block of text opens, ending the game. To give a little more…
1
vote
5 answers

Python: How to end a while loop while it is running if the while condition changes during the loop?

I need some help with code in a text based game I am trying to make. My game uses health, and the code starts off with "while health>0:", and in another point in the game, when health eventually =0, the loop still continues. How do I make the loop…
Danyal Rana
  • 33
  • 1
  • 4
1
vote
0 answers

Having Issues with Text-based Java Game in DrJava

Menus aren't linking, after the first menu, it goes back to the beginning, also trying to figure out how to turn it into a wave system where only a few enemies come at a time, once those enemies have been defeated you can move onto the next wave and…
Craser G
  • 11
  • 4
1
vote
0 answers

HTML5 / JS text based game, should I Load json objects on the fly or store them in the main js file?

I am working on an HTML5/JS text based game, which is single page and uses jquery and handlebars. What would be the best way to handle the loads of texts that each character and scenario would have? should I store them in separate JSON files and…
Baruch
  • 1,618
  • 5
  • 23
  • 42
1
vote
3 answers

Can I create an RPG-esque save & quit, and then reload progress?

So I'm creating a basic text-based RPG styled game. It utilises Rock-Paper-Scissors match-ups and level-based progression. Because this game is so grindy to get anywhere, and to aid in my black box testing I would like to create a save & load…
Obahar
  • 107
  • 1
  • 1
  • 10
1
vote
1 answer

Taking an item from a room and adding it to inventory

In my text-based adventure game I am currently having a little trouble. I have a list of items (key, flashlight, battery, and map) and I have placed these items in certain rooms in the Locale array I have created. Using the command T, when this key…
Katie
  • 19
  • 5
1
vote
4 answers

My function in python is being called, even though I'm only defining it

I have a function called attack: def attack(name,minmultiplier,maxmultiplier,critchance,attacker,attackee): print(attacker[0],"used",name) multiplier=random.randint(minmultiplier,maxmultiplier) crit=random.randint(critchance,100) if…
partben
  • 25
  • 9
1 2
3
15 16