GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Oct-2005, 15:19
twirl twirl is offline
Junior Member
 
Join Date: Oct 2005
Posts: 32
twirl is on a distinguished road
Cool

Games programming?


Hi,

I would like to port an old amiga bbs door game to linux. (i will upload the pictures when i can so you can see what it is) called Daves Space Empires. It was a bbs door game for the amiga. Now i would like to turn it into a door game on linux. Im just wondering what would be the best method for this? As far as i can tell the game is fairly basic and just requires input and output. Also is there any other linux game programmers here? Thankyou

Andy
  #2  
Old 13-Oct-2005, 20:15
twirl twirl is offline
Junior Member
 
Join Date: Oct 2005
Posts: 32
twirl is on a distinguished road

Re: Games programming?


Hi,

Ok i have uploaded the pics to an ftp where you can d/l images of the original game of what i would like to make but not the same, some of you may know of this game quite well. Anyway the details are :-

ftp://208.53.170.48
user:twirl
pass:zerocool

and use get spaceempires.zip when connected or spaceempire.zip

P.s if you don't know what a bbs is telnet to basex.bbs.us or pm me .

Thankyou

twirl aka Andy
  #3  
Old 15-Oct-2005, 22:58
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,548
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: Games programming?


Well, I wasn't able to get the file from the FTP server; it never asked for a password and the two directories (Mail and Pub) didn't show the file.

Anyways, do you know what language it's coded in? Might make a difference in how to proceed. Could be as simple as tweaking it and recompiling it or you might have to rewrite large chunks that were written expressly for the Amiga h/w.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #4  
Old 15-Oct-2005, 23:39
randomi randomi is offline
New Member
 
Join Date: Oct 2005
Posts: 4
randomi is on a distinguished road

Re: Games programming?


If you were trying to connect from a webbrowser it probably logged you in under anonymous. Try connecting to
Code:
ftp://twirl@208.53.170.48/spaceempires.zip
and putting the password in then. (tried to link, doesn't like ftp with a username apparently.)
  #5  
Old 16-Oct-2005, 00:04
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: Games programming?


Hello randomi,

That's ingenious -- the way you got the url into your message! I will have to fix that "hole" very soon...

The reason why [url=ftp://twirl@208.53.170.48] didn't work for you is because you've just registered and still at Level I. Once you get to the next level, urls in your posts will turn into links as usual.
  #6  
Old 16-Oct-2005, 09:36
twirl twirl is offline
Junior Member
 
Join Date: Oct 2005
Posts: 32
twirl is on a distinguished road
Cool

Re: Games programming?


Hi,

Thankyou for your replys.

If you still have problems getting to my ftp use a command line ftp from either a ms dos prompt or bash shell. e.g

ftp 208.53.170.48 and it will ask for username/pass

As for what the original code is written in have no idea, i have tried emailing the author but no response. I was hopeing the pictures would give some of you an idea of what it lookes like. Thankyou

Andy
  #7  
Old 17-Oct-2005, 19:03
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,548
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: Games programming?


I finally got the screen caps. It looks like a standard text adventure; there's a good chance it was written in BASIC. I don't know if there's an "Amiga-only" language.

It appears fairly simple to create. Minimal logic and basic user I/O. I'd think a simple scripting language like Perl or Python would be easiest. There doesn't appear to be anything requiring the "low-levelness" of C or C++ (unless that's what you're comfortable with). Are there any specific questions you have about it?

As an aside, I don't know if this qualifies me as a "linux game programmer" but the game I'm working on (www.colonialmarinesrpg.com) is being developed on OS X and GNU/Linux for cross-platform use using Python.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #8  
Old 17-Oct-2005, 19:23
twirl twirl is offline
Junior Member
 
Join Date: Oct 2005
Posts: 32
twirl is on a distinguished road
Exclamation

Re: Games programming?


Hi,

Thankyou for your reply i will check out your game in a bit :-)

Please note this is my first attempt at writing a game (as i have only done applications before). Im using c++ because i will be converting it with opendoors ( allows linux c,c++ programmers to turn there games into online bbs doors) to turn it into a bbs door game after i have got the game working in original c++ first.

Anyway my problems are below with code so far :-

1. The menu is very messy and i do not know how to center the text.

2. y or n dont work the way they should do (how do i fix it so user can enter y/Y/YES/yes and n/N/NO/No Please?

3. If user starts the game it will ask for there handle they wish to use, the problem is once asked if they wish to use that handle yes or no will appear the only option that will work is n for no. As the user should get some text output for when they press y. Please help me fix

Also i know about the ostream files that i can't do it that way, i will fix that after i get this problem solved first. Also note this game is incomplete as i am still working on it.

Thankyou

Andy

My code is below :-

CPP / C++ / C Code:

// Space Empires BBS Door By Andrew WIlkie

#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>

using namespace std;

int main() {
  char choice='\0';//NULL;      // set choice to zero           
 bool finished=false;          

 std::string p;
 std::string n;
 std::string r;
 std::string f;
 std::string y;
 std::string d;
 std::string h;

 p="Play Space Empires";
 n="Space Empire News";
 r="Space Empire Rankings";
 f="Space Empires Hall Of Fame";
 y="y";
 d="n?";
 h="What name shall the galaxy know you by?";

ofstream outfile("player.dat,news.dat,names.dat,ranks.dat,hof.dat,ios::app");//create data files
std::ifstream infile; 

// exit program if unable to create program

 if ( !outfile ) { // overloaded ! operator
   cerr << "File could not be opened" << endl;
 exit( 1 );

 } // end if

int i=0;

 while (finished != true)      // keep program to run till users wishes to exit   
  {

// Start main menu
  

    cout << "Welcome To Space Empires";
    cout << "   By Andrew Wilkie 2005";
    cout << "   \n\n";
    cout << ".1"  << p;   
    cout << ".2"  << n;                
    cout << ".3"  << r; 
    cout << ".4"  << f; 
    cin>>choice;
    cout<<"\n\n";       
 
 switch(choice)
   {
   case '1':cout << p << endl; 
            cout << y << d << endl; // ask user yes/no?
            cin >> y >> d; // get user input
    
   if(choice =='d') // check choice = d then return to main menu
    {   
    cout <<"Welcome To Space Empires";
    cout <<"By Andrew Wilkie 2005";
    cout << "1." << p;  
    cout << "2." << n;
    cout << "3." << r;
    cout << "4." << h; 
    cout <<"\n";      
    cin>>choice;
    cout<<"\n\n";
    }

// Playing Of Space Empire's Begins Here

    else if(choice=='1') {        
    cout << "Hello, You must be new in the galaxy.";
    cout << h << endl;
    cin >> h;
    outfile << h << "names.dat"; // store name into names.dat
    cout << h; 
    cout <<"Use this name yes/no?" << endl;
    cin >> h >> d; // ask user yes or no? 
    }
 
    if(choice =='y') // check choice = y then start game
    {   
    cout << "Well...Here you are. Just another new" << endl;
    cout << "emperor with a hoard of cash, some" << endl;
    cout << "food, and the massive population" << endl;
    cout << "your father left you on these three" << endl;
    cout << "measly planets, what are you waiting for?" << endl;
    cout << "Start buying some weapons! Do what" << endl;
    cout << "nobody in your family has done before!" << endl;
    cout << "CONQUER! DESTROY! YOU can rule" << endl;
    cout << "the universe if you TRY!" << endl;
  
    cout << "Please press enter to continue:" << endl;      

     }
    }   

   }
  }
Last edited by LuciWiz : 18-Oct-2005 at 00:24. Reason: Please insert your C++ code between [c++] & [/c++] tags
  #9  
Old 19-Oct-2005, 18:41
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,548
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: Games programming?


I'll admit upfront that my c/c++ skills are weak; I haven't practiced since last year so I'm sure someone else around here can do better than me. But I'll see what I can do.
Quote:
Originally Posted by twirl
1. The menu is very messy and i do not know how to center the text.
Probably the easiest way to center the text is to manually put spaces inbetween the quotes. It will take a little bit to get it all looking good. The only other thing I can think of is to try and create a table with tabs ("\t").
Quote:
2. y or n dont work the way they should do (how do i fix it so user can enter y/Y/YES/yes and n/N/NO/No Please?
You might be able to make a switch statement or you could make each of them as a boolean true/false. Each value will have to be coded so the program knows what to do for each case.
Quote:
3. If user starts the game it will ask for there handle they wish to use, the problem is once asked if they wish to use that handle yes or no will appear the only option that will work is n for no. As the user should get some text output for when they press y. Please help me fix
Is this the section you're referring to:
CPP / C++ / C Code:
else if(choice=='1') {        
    cout << "Hello, You must be new in the galaxy.";
    cout << h << endl;
    cin >> h;
    outfile << h << "names.dat"; // store name into names.dat
    cout << h; 
    cout <<"Use this name yes/no?" << endl;
    cin >> h >> d; // ask user yes or no?
If so, then I believe you're using the wrong string substitution. Shouldn't "yes" be listed as a "y" instead of "h"?

Several questions I have (excuse my ignorance, I probably just haven't seen this way of doing it):
  • If you have already declared "using namespace std;", then why do you have
    Code:
    std::string p; std::string n; std::string r; std::string f; std::string y; std::string d; std::string h; std::ifstream infile;
  • Why are you making string substitutions for yes and no? Wouldn't it just be easier to cout << "y" instead of using these:
    Code:
    y="y"; d="n?";
    It would seem to me that it's easy to get confused as to what character applies to which string, similar to your question #3.

    Additionally, I would think (for clarity) it would be better to use a word instead of a single letter for your string substitutions.
As I said, I don't have much experience w/ c/c++ so my questions and answers may be naive, but I'm learning. At a minimum, there's much smarter people on the forums who can show you (and me) the errors of our ways.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #10  
Old 20-Oct-2005, 10:19
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,244
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Games programming?


Quote:
Originally Posted by twirl
2. y or n dont work the way they should do (how do i fix it so user can enter y/Y/YES/yes and n/N/NO/No Please?
Read a buffer that can hold the length of a possible input, like YES (IOW 3 or more characters)
Then you can test just the first character for 'y' or 'Y'. Also look into the toupper() function.

Also, you have been asked to use code tags every single time you've posted code. Read the GUIDELINES! They are easy to find...
__________________

Age is unimportant -- except in cheese
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 3) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help getting old games to run? pcxgamer Computer Software Forum - Games 23 17-Sep-2007 16:11
Read/ Write EXCEL files using C/C++ programming confused_pig C++ Forum 4 25-Nov-2005 00:27
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 15:41
GUI programming crystalattice C++ Forum 5 14-Sep-2004 12:17
Tip when buying new games pcxgamer Computer Software Forum - Games 0 28-Dec-2003 11:18

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 12:17.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.