Questions tagged [text-based]
233 questions
0
votes
2 answers
Update loop inside game error from null/ Map generator generating null
Thanks for thanks the time to read my question. I am currently having trouble with a small text based adventure game I am developing. Right now I am getting this error message when I update my map:
Exception in thread "main"…

user2280906
- 53
- 3
- 9
0
votes
1 answer
Exporting a Java text-based program into an executable JAR?
I am using Eclipse as my IDE.
I have previously made and exporting my different programs in eclipse as executable jar files, but those were all programs involving frames. I was messing around with the classic text based programs I had and decided…

nkorea
- 1
- 1
0
votes
5 answers
C++ I cant access the functions i need to
I am trying to create a text based adventure game in c++ for my school project. The roblem i am having is that my gameover() function needs to be able to goto my begin() function. The problem is begin must be declared before before the gameover()…

Mako
- 131
- 4
0
votes
2 answers
text base programs in java
i want to create a terminal application in java, but i don't know how to replace text lines that are already printed (kind of "edit the lines that already printed"). \r only returns to the beginning of the last line, and i want to display a 2…

Bary12
- 1,060
- 9
- 23
0
votes
2 answers
I'm wanting to test which of two integers is closest to a third int in Java
I feel like this has an extremely obvious answer, so forgive me if I'm being stupid.
I'm creating a simple text-based game for elementary school kids in which the user, playing as a mage, needs to ward off mighty dragons by mixing together various…

othinolis
- 1
- 1
- 4
0
votes
2 answers
How to make enemies circulate randomly and follow player if withing certain distance? C++ Console game
I have been stuck on trying to make the Z's move around randomly for literally hours. What I am aiming to do;-
Make the Zombies's(Z) move around randomly around the map
Follow the player(M) if he is a certain distance away
I am a complete amateur…

user3399355
- 3
- 2
0
votes
2 answers
How to implement a randomized multi-response in C++
I am creating a text-based game in C++. I am wondering, however, if there is a way to randomize a a response from a set amount of responses.
Say I had a question, and the player answered incorrectly, I want the game to reply with a set response…

Halcyonixus
- 103
- 5
0
votes
3 answers
while loop not ending when required
So some background information, I'm new to programming and am still learning, so I apologize for my trivial error making. I am making my own text based game just to further practice etc.
Here is the link to everything on dropbox for more…

MrAsstastic
- 1
- 1
- 3
0
votes
2 answers
Creation of an Object that is inside of another object
I want to keep as many things in separate java files for code readability and for debugging issues.
I have a java class Called Actor. The Actor class is designed to be an object that holds all the players information, but also be used for other…

John Zamoider
- 35
- 4
0
votes
4 answers
I'd Like to know how to make an asterisk right triangle(S) in C++ using a loop
I want something like this:
**** ****
*** ***
** **
* *
I tried this:
void roadBound() {
for( int i = 1; i <= 10; i++ ){
for( int j = 0; j < i; j++ ){
cout << "*" ;
}
cout <<…

user3015519
- 23
- 1
- 5
0
votes
2 answers
Keeps giving me error message
The code below just keeps giving the else error message I don't know what's wrong..
Boolean loop2 = true;
userInput = scan.next();
while (loop2) {
userInput = scan.next();
if(userInput.toLowerCase() == "") {
out.println(
…

user2936661
- 1
- 1
0
votes
1 answer
Having problems moving car for text based pole position game in C++
So my project is to make a text based pole position game in c++. My counter does not seem to be working. it only counts up but never back down. Right now i am only worrying about moving side to side. This is my code:
void move(){
system("cls");
…

user3015519
- 23
- 1
- 5
0
votes
1 answer
if and if-else statements doesn't work with c++
so my friend and I are trying to make a text-based video game and I have been doing some research on how to get the programming down. Here is our c++ program so far:
#include
#include
char Choice;
using namespace std;
int…

TheAwesomElf
- 51
- 5
0
votes
1 answer
Text based game incorrectly displays '@' and '+' on grid of '#'s
#!/usr/bin/env python
import random
import time
import os
class vars:
running = 1
class ex:
placed = 0
y = 0
x = 0
loc = 0
def win ():
print("You escaped!")
time.sleep(2)
ex.placed = 0
def main ():
…

Glollum
- 31
- 6
0
votes
1 answer
Python for loop breaks text based game
#!/usr/bin/env python
import random
import time
import os
class vars:
running = 1
def win ():
print("You escaped!")
vars.running = 0
time.sleep(4)
return 0
def main ():
char_loc = 11 #The characters current co-ordinates…

Glollum
- 31
- 6