text game

Started by
19 comments, last by GameDev.net 17 years, 9 months ago
Quote:
(S)He only THINKS he has the necessary knowledge to make a simple text-based game and you want font-shaking?! Haha! Remind me never to work for you :p


LOL yah its too much for a text based game but I was only givn an example(bad example, ok lol), yes that is far out there and overkill.
Advertisement
It's probably also impossible unless you wrote your own console... Hmmmmm.

That gives me an idea.
If you allowed the shaking to mean 'move the entire block of letters over one character space' then it should be possible with the right functions. Eg:
 Screen1     Screen2     Screen3     Screen4+-------+   +-------+   +-------+   +-------+| Hello |   |       |   |  Hello|   |Hello  ||       |-->|  Hello|-->|       |-->|       ||       |   |       |   |       |   |       |+-------+   +-------+   +-------+   +-------+



And just time it correctly. Also you can, instead of writing onto the screen, write to a buffer and then 'flip' the buffer to the screen directly. You could also write blitting functions to more easily display 2D ASCII designs. There's quite a bit you can do with creative ASCII usage.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

can 1 of u guys give me some a code to a text game u guys have made so i can look at it and like follow it a bit not copy but just see what i need in it you know as a guide
I would stick with DevC++ if you are just starting, it is easier in my opinon, and you dont have to worry about extra stuff with options as you would in MVC++.
I have MVC++ .NET and to tell you the truth, I like Bloodsheds lovely gem compiler ( which is also free like MVC++ 8 and unlike MVC++ .NET (unless you are a pirating bastard)); anyway , almost as much!!
Dont need one.... i'm so cool, dont ask me just do what you do..... meet me in the trap its going down....
I'll give you some code from a text game.

void Server::PlayerInput(const std::string& text, Database::ObjectPointer player){	assert(State::empty() && "[PLAYERINPUT] State stack was not empty");	assert(!text.empty() && "[PLAYERINPUT] Text was empty");	assert(player && "[PLAYERINPUT] Bad player objectpointer");	State st;	State::sender() = player;	std::list<std::string> words;	SU::Tokenize(text,words);	if (words.empty()) 	{		player->send("Don't do that.\n");		return;	}	std::string cmd = boost::algorithm::to_upper_copy(words.front());	words.pop_front();	std::string script;	std::string func;	jisp::type_list pi;	if (!search_command_set(cmd,words,cmds,player,player,script,func,pi))	{		if (!player->location || !search_command_set(cmd,words,														player->location->commands,														player,														player->location,														script,func,pi))		{			player->send("I don't recognize that command.\n");			return;		}	}	ScriptInterface::ContextWrapper ctx;	int func_id = ScriptInterface::FetchFunction(script,		std::string("void ")+func+"(type_list)");	if (func_id < 0) 	{		player->send("[Command definition error]\n");		return;	}	ctx->Prepare(func_id);	ctx->SetArgObject(0,&pi);	ctx->Execute();	return;}


Oh, wait, that wasn't helpful at all.
I'll have to dredge up one of my old text games. Of course, now that I know about the wonderful world of std::string I could probably build a better one.

Maybe I'll do that.
I should get working on my mud again. Looking at that terrible code really made me miss it. It parsed natural english. It just had a very limited vocabulary...
so any 1 got a one of their text games code i can use as a guide
I think text game is fine to start, and can be a very good kind of pratice . Just do it like a real project and not like if if was "only" a small not-fun project .
Build a script engine, some AI and maybe a small level editor .
[ script engine will be your main focus IMHO ]
Good luck .

This topic is closed to new replies.

Advertisement