Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
A3 Custom Pokemon

 
Post new topic   Reply to topic Printable version
 View previous topic  VS2008 Pro edition: For students Post :: Post My first VB program  View next topic  
Author Message
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sat Mar 15, 2008 12:09 am    Post subject: A3 Custom Pokemon Reply to topic Reply with quote

This is my biggest project that i made and has 1218 lines of code alltogether (not including bat, .a3 files)

Pretty much like a console version of Pokemon, but comes with Customize.exe which allows you to change pokemon names, their evolutions, font, and make settings default

It has allot of glitches and i tried to fix all of them but... Write here all the glitches you found..

Also it has a save, and load function which i made (didnt know how to make one so got creative..)

and yea thats pretty much it, took me 3 days to make, and i learned so much from it biggrin.gif


BTW: I'm trying to learn how to make application like windows APP style, like menu and using the mouse to click buttons instead of typing biggrin.gif if you know please post some good tutorials, and if there are good tutorials on 2d games biggrin.gif (ofcourse in c++)




Pokemon Game

PokemonGame.rar - 216.55 KB
File downloaded or viewed 29 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Bak
?ls -s
0 in


Age:23
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sat Mar 15, 2008 1:52 am    Post subject: Reply to topic Reply with quote

no source? icon_sad.gif
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sat Mar 15, 2008 11:52 am    Post subject: Reply to topic Reply with quote

crap i thought it was in that folder :S

so do you know any good tutorials on 2games or windows APPS?




PokemonGameSRC

PokemonGameSRC.rar - 242.83 KB
File downloaded or viewed 29 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
doc flabby (away)(
Guest


Offline

PostPosted: Sat Mar 15, 2008 2:12 pm    Post subject: Reply to topic Reply with quote

http://www.meandmark.com/opengl2dbook.html
Back to top
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sat Mar 15, 2008 2:31 pm    Post subject: Reply to topic Reply with quote

thanks this is exactly what i needed, googled for a while and couldn't find anything good biggrin.gif
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Bak
?ls -s
0 in


Age:23
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sun Mar 16, 2008 3:51 am    Post subject: Reply to topic Reply with quote

In my opinion SDL is much easier to work with than openGL... and you can use openGL inside SDL if you really want to. There's also lots of great tutorials specifically for game development:

http://lazyfoo.net/SDL_tutorials/index.php
http://www.libsdl.org/index.php
http://www.libsdl.org/tutorials.php
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Bak
?ls -s
0 in


Age:23
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sun Mar 16, 2008 3:59 am    Post subject: Reply to topic Reply with quote

looks good.

Code: Show/Hide
font.open("bin\\font.bat");
    if (!font)
    {
             ...
    }
    font.close();
i'm not sure that this handles the case where the file doesn't exist correctly. It might, test it out and tell me.

Also in some places you don't test if a file opened correctly (customize.cpp)
Code: Show/Hide
pok.open("bin\\pokemon.a3");


but other than that it looks good. Once you learn loops and functions you'll be kicking yourself for writing so much code icon_smile.gif

one more thing, in generally it's a bad idea to call main in your code
Code: Show/Hide
return main();

what you want to do (start over) should be done using a loop, although it doesn't look like you use those yet.

good work (I like the custom file io)
Back to top
View users profile Send private message Add User to Ignore List AIM Address
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sun Mar 16, 2008 10:55 am    Post subject: Reply to topic Reply with quote

Code: Show/Hide
    if (!font)
    {
             ...
    }
    font.close();
yup your right (!font) says if what ever file variable font opens could not be found then do the following biggrin.gif i learned it few days ago biggrin.gif



Also i have this question, how do you make your program return to the part like where it says "Enter your choice: " in the source code bellow

Code: Show/Hide
                       int newpokchoice;
                         
                         cout<<"\n\nCongratulations!! "<<mpn<<" has beat "<<p3<<"!\n";
                         system("pause");
                         cout<<"\n\nWould you like to make get a new pokemon,\n";
                         cout<<"or just level up "<<mpn<<"? (1 = new pokemon, 0 = lvl up)\n\n";
                         cout<<"Enter your choice: ";
                         cin>>newpokchoice;
                         
                         if (newpokchoice == 1)
                         {
                                         
                                          cout<<"\n\n\n\nYou decided to get a new pokemon, and you got a \n";
                                          cout<<"lvl "<<dmg4<<" "<<p4<<" who has "<<hp4<<"!\n";
                                          cout<<"And will evolve into "<<evol4<<"!\n\n";
                                          system("pause");
                                          cout<<"\n\nWhat nickname would you like to give your "<<p4<<"?";
                                          cin>>mpn;
                                          cout<<"\n\nYou nicknamed your "<<p4<<" "<<mpn<<"!\n";
                                          system("pause");
                                         
                                          ofstream sgame;
                                          sgame.open("bin\\savedgame.a3");
                                          sgame<<p4<<endl;
                                          sgame<<hp4<<endl;
                                          sgame<<dmg4<<endl;
                                          sgame<<evol4<<endl;
                                          sgame<<mpn<<endl;
                                          sgame<<trainername<<endl;
                                          sgame.close();
                                         
                                          cout<<"\n\nGame was saved with your new pokemon...";
                                          system("pause");
                                         
                         }
                         
                         else if (newpokchoice == 0)
                         {
                             
                              cout<<"\n\n\n\nYou decided to lvl up your "<<mpn<<".\n";
                              system("pause");
                             
                              dmgmp = dmgmp + 1;
                              hpmp = hpmp + 5;
                             
                              cout<<"\n\n Your "<<mpn<<"("<<mp<<") leved up to lvl"<<dmgmp<<"!";
                              cout<<"\n\nWholy Shit! Your "<<mp<<" evolved into "<<evolmp<<"!\n";
                             
                              mp[80] = evolmp[80];
                             
                              cout<<"\n\nWhat nickname would you like to give your "<<mp<<"?";
                              cout<<"\nAnswer: ";
                              cin>>mpn;
                              cout<<"\n\nYou nicknamed your "<<mp<<" "<<mpn<<"!\n\n";
                              system("pause");
                             
                              ofstream sgame2;
                              sgame2.open("bin\\savedgame.a3");
                              sgame2<<mp<<endl;
                              sgame2<<hpmp<<endl;
                              sgame2<<dmgmp<<endl;
                              sgame2<<"(OOPS CANNOT EVOLVE ANYMORE, WILL JUST LVL UP)"<<endl;
                              sgame2<<mpn<<endl;
                              sgame2<<trainername<<endl;
                              sgame2.close();
                             
                              cout<<"\n\nGame Saved...";
                              system("pause");
                             
                         }
                                     
                         else
                         {
                             
                             cout<<"\n\n\a\aPokeshit: You must enter only 2, 1 or 0 as your choice!!";
                             cout<<"\n\tSorry but in A3 Custom Pokemon if you enter wrong value game exits...\n\t";
                             cout<<"Hopefully in the next version this will be fixed...";
                             system("pause");
                             return 0;
                             
                         }



i tried many times but nothing happened ( I did
Code: Show/Hide
return newpokchoice;
and
Code: Show/Hide
return newpockchoice();
but neither worked



Quote:
Also in some places you don't test if a file opened correctly (customize.cpp)
Code: Show/Hide
pok.open("bin\\pokemon.a3");


In pok.open("bin\\pokemon.a3") it doesn't read from pokemon.a3, it creates pokemon.a3, so if i would do the (!pok){} then it would show up with errors since the file wasn't created yet
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Sun Mar 16, 2008 1:26 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
int choice;
do {
    cout << "1 = bla" << endl;
    cout << "9 = exit" << endl;
    cout << "your choice: ";
    cin >> choice;

    /* more stuff here */

} while (choice != 9);


for example.

Maybe the "int choice;" can be moved into the loop... but I didn't try if that works.
I worked in Java for almost a year now, and I can't tell the scopes apart.
_________________
It's a shark! Oh my god! Unbelievable!
Back to top
View users profile Send private message Add User to Ignore List
baseball43v3r
Seasoned Helper


Joined: Jan 02 2006
Posts: 102
Offline

PostPosted: Sun Mar 16, 2008 1:38 pm    Post subject: Reply to topic Reply with quote

isnt his first method of doing so, ie returning newpokchoice an example of recursion? which in his case wouldnt work so well i would think. would just a simple loop work better?

edit: oh he hasnt gotten to that yet.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Bak
?ls -s
0 in


Age:23
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sun Mar 16, 2008 1:45 pm    Post subject: Reply to topic Reply with quote

yeah kozy is right with the loop thing. (and your current method is recursion, but you don't need to know that yet icon_wink.gif )

As for
Quote:
In pok.open("bin\\pokemon.a3") it doesn't read from pokemon.a3, it creates pokemon.a3, so if i would do the (!pok){} then it would show up with errors since the file wasn't created yet


It knows it's not trying to read from pokemon.a3 since pok is of type ofstream (output file stream). You still need to check if it opened the file correctly for writing. Reasons it might fail include being out of disk space or not having permission to write in that location. More commonly though, if the file already exists and is open in another program you won't be able to overwrite it.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sun Mar 16, 2008 1:56 pm    Post subject: Reply to topic Reply with quote

[quote="Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole...."]
Code: Show/Hide
int choice;
do {
    cout << "1 = bla" << endl;
    cout << "9 = exit" << endl;
    cout << "your choice: ";
    cin >> choice;

    /* more stuff here */

} while (choice != 9);


crap im retarted, i knew the do while and i actually used it for something similar, but never put the two together :\

Quote:
It knows it's not trying to read from pokemon.a3 since pok is of type ofstream (output file stream). You still need to check if it opened the file correctly for writing. Reasons it might fail include being out of disk space or not having permission to write in that location. More commonly though, if the file already exists and is open in another program you won't be able to overwrite it.
oh i never thought of that
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Mon Mar 24, 2008 12:04 pm    Post subject: Reply to topic Reply with quote

crap i realized its impossible to win in this game, your opponent will never die and his health goes to like -250000 something like that I'll try fix that
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 60 page(s) served in previous 5 minutes.

phpBB Created this page in 0.099579 seconds : 40 queries executed (47.3%): GZIP compression disabled