Translate

Wednesday, 19 March 2014

A simple " Text based game " can refer to as a basic Rpg type game, made using simple steps and choices.

Source Code :

#include<stdio.h>
#include<conio.h>
void main(void)
{
int a,b;
clrscr();
printf("You see a door , a voice calls ........ do you want to ent..e..r..The voice \nslowly fades away..\nwhat would you like to do .? press 1 to enter and press o to ignore\n\n press 0 and enter, the if condidtion for 1 is still in making by sami");
scanf("%d",&a);
clrscr();
if(a==1)
b=printf("\nYou entered and a text is written on the wall , ... \n would you like to read it . if you want to read it press 2 otherwise 3. to \nignore and move forward");
else
{
a==0;
printf("\n....You went back home and tried to forgot about that strage voice\npress o and enter to continue\n\n then when you done compile again repeat till this step and press any other \nnumber other then 0 :) ");}
scanf("%d",&a);
clrscr();
if(a==0)
printf("\n\n This is the End\nprogramm under contruction, thanks for checking ^^");
else
{
clrscr();
printf("\n\n\n\n\n  do as you are told , i told you to press 0 .-----. "); }
getch();


}



Simple steps to show how this little text based game work. basically its takes input as a number, 

i have predefined the coding that what will the the effect of the key pressed 





No comments:

Post a Comment