What Do I Do?

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 22, 2009, 07:32 AM
430691 members and 297827 Topics
Latest Member: sxcbum10
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  What Do I Do?
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: What Do I Do?  (Read 273 views)
gameaddict (m)
What Do I Do?
« on: October 03, 2009, 11:53 PM »

I've been learning C++ and java on my own for about three months and all the while loving it. It's difficult learning these languages at the same time so i create space sometimes and usually dedicate a few days of the week to a particular programming language. It has helped me a lot and i've sometimes been able to identify important differences that would surely be important when i decide to use any language for any task.

Now the real issue is that although i am getting a good grasp of both languages, i haven't been able to create anything yet except a few simple programs which are sometimes exercises from the textbooks i use. I would like someone to advise me on books to find simple examples, exercises and tutorials on this languages especially based on games to broaden my knowledge and skills. I would prefer text based games for now unless you can give me a good reason to dive into learning about any graphic library right now(note i'm not very good yet).  Grin

I would also like to meet other programmers(both beginners and experts alike) especially those into game programming to gain knowledge and know the way forward in Nigeria. Although i am not learning this at school(i'm reading economics), i am  very determined and open to any suggestion and criticism.  Grin

I aim to make the best Game ever with an expansive African storyline good enough to make Sony corp's jaws drop.  Wink They are idiots, believe me and i may never forgive their "Nigerian millonaire" comment. expecting your replies.  Grin
pc guru (m)
Re: What Do I Do?
« #1 on: October 04, 2009, 05:56 PM »

jumpin into gaming is a bit too soon.best bet is to start with simple 2d.there are many tuts online.and dueal cud help me.
gameaddict (m)
Re: What Do I Do?
« #2 on: October 06, 2009, 01:25 AM »

I am doing any serious game coding yet, so i dont do any graphic. The games i'm trying to create for now are text based adventures. I am doing this because i'm sure it will help me learn to control my programs better and give me a good grasp of the various topics because i'm trying to implement what i learn from every topic. Please help me get links to tutorials related to text based games to aid me. Thanks.
dueal (m)
Re: What Do I Do?
« #3 on: October 10, 2009, 04:42 PM »

@gameaddict. Good thing you are learning C++ and 'Java' as your first programming languages. As pc_guru rightly stated, it's a bit too soon to try your hands on game programming even if it's just text based, I'll advice you stick with learning C++/Java and once you have gotten to a certain piont where you live and breath the language and programming, then you can jump to creating what ever program you mind can think of. It takes time an practise.Keep coding.
segsalerty (m)
Re: What Do I Do?
« #4 on: October 10, 2009, 05:15 PM »

Nice Determination , 
Just keep on ! dont stop ! dont let anything/ anyone depress / discourage u in anyway !
keep looking at where u wanna be and keep working towards it , 
Discover yourself and discover your personal way of learning !
what works for u might not work for me and vice versa.
Good luck bro
gameaddict (m)
Re: What Do I Do?
« #5 on: October 11, 2009, 02:37 AM »

Thanks guys, i really appreciate your help.
One more thing,  Could you direct me to any good place in lagos where i can get new programming books(i'm tired of ebooks. My eyes are beginning to hurt) just in case i happen to have any money while passing by. I recently passed through yaba market but didn't know any good places. In my haste to get home i found a roadside bookseller who suggested getting me a few books. I bought the black art of java game programming from him and told him i'd buy the deitel c++ book if i passed by which is next wednesday. I got home and discovered that the book was a few years old(real old. It was based on jdk 1 .0.2) and examples it used contained some deprecated methods. Moreover, the cd containing some source codes was missing. Gosh.
sweet_pawn
Re: What Do I Do?
« #6 on: October 19, 2009, 08:44 AM »

gameaddict!
Seems you and I have many things in common!
Like you I went into programming because of games.
I wrote my first game in qbasic and perfected it much later with visual basic.
My latest game project is an online chess game for which I developed a website to download the game @ www.chessmate.tk
You can check it out some time.
Now,in my time,there was no google but I did what I had to do.
You dont need 100 text books to build a game. You need your ideas and good algorithms. .  . 
sweet_pawn
Re: What Do I Do?
« #7 on: October 19, 2009, 08:58 AM »

The code is simply a tool used to implement your algorithm, just as words are tools that mirror our thoughts. So you dont have to learn the whole coding vocabulary to write a good program much in the same way a child can talk sense with out having a masters degree in english.
If you know your if statements,for loops, variables and string manipulation dude, we can start a text based game right now!
Let me be your tutorial and material !
If you agree to that, we will make your first text based game. . .
sweet_pawn
Re: What Do I Do?
« #8 on: October 19, 2009, 09:04 AM »

.  .  .
sweet_pawn
Re: What Do I Do?
« #9 on: October 19, 2009, 09:04 AM »

We will use c++ as the language.
Do you have any game in mind. If so post about it so we can see how we'll make an algorithm for it and code it.
If not, I have a couple of games we can design.

I will be waiting for your response  my potential game developer to-be !
gameaddict (m)
Re: What Do I Do?
« #10 on: October 23, 2009, 07:44 AM »

@ sweet_pawn
I'm sorry i did not reply earlier.
I just got into unilag's diploma programme and i'm currently being bombarded with lectures but thanks for the posts. Time isn't on my side right now as i'm yet to find accomodation and settle into the enviroment.
Anyway, my email is adamsibrahim@gmail.com. Please send me yours cuz i'd like to learn from you.
PS: A few weeks back, i was making a prototype battle function for the text based adventure i was making but when i used the c++ rand() in it, i notice the outcome was the same each time i ran the program. Is there any solution to it and how can i make the program sleep for a few secs before printing each output?
Thanks again.
sweet_pawn
Re: What Do I Do?
« #11 on: October 23, 2009, 09:51 AM »

hi gameaddy,
I will send you my mail.
I see you have got some project going on and it sounds interesting! You could mail me the details of what the games all about.
Now lets tackle your problems,
sweet_pawn
Re: What Do I Do?
« #12 on: October 23, 2009, 09:52 AM »

To create random numbers every time you run:
#include< time.h >
srand(unsigned(time(NULL)))
//the above code and include will allow you to generate new random numbers when you use the rand function. . .
sweet_pawn
Re: What Do I Do?
« #13 on: October 23, 2009, 09:52 AM »

To delay your program:
#include(windows.h)
// add the above include
Sleep(1000)
// add the line above to where you want the delay to start. This will delay for 1 sec
sweet_pawn
Re: What Do I Do?
« #14 on: October 23, 2009, 09:53 AM »

. . .
sweet_pawn
Re: What Do I Do?
« #15 on: October 23, 2009, 10:03 AM »

. . .
sweet_pawn
Re: What Do I Do?
« #16 on: October 23, 2009, 10:03 AM »

. . .
gameaddict (m)
Re: What Do I Do?
« #17 on: October 24, 2009, 02:27 AM »

Thanks for the suggestions.
The sleep() worked fine but i used some variables and a formula to create a limit of 1 to 10 for the rand() cuz i wanted to use it to determine turns for first attack and also if the cpu dodges or is hit by the attack. I'll make sure i post it from my PC later(currently posting from mobile).
Thanks.
Lovegame
Re: What Do I Do?
« #18 on: October 24, 2009, 03:03 AM »


java is system independent language but is a little heavy because it uses
java virtual machine to run on
web applications are small and had to be supported on multiple OS
so java is used

c++ although platform dependent uses Little system resources
games run many programs at a time so they are made in c++
if they would be made in java they would have required a lot of ram and CPU resources

see it really depends on the platform you are using
for eg.if you are making a game for a console like PS3,XBOX 360 or Wii
memory is limited they have ram in range of 256-512 MB
so c/c++ is used and java is avoided

for computer games where ram is available in plenty say 2GB
many online games are java based (also consider they are focused on all browsers and operating systems)

java games are also common on mobiles because in this field there are many architectures many operating systems
so to have maximum profit application are made in java so it can be played on most models although these applications are terribly slow

here a nseries or s60 platform phones give an edge
because 25% of world phones are powered by s60 devices NOKIA provides s60 platform with carbide c++
making these devices run c++ applications based on arm processor architecture that perform faster than java applications
c++ applications are 60-80% faster and use 40-60% less ram!!




visit www.naijavine.com,  your sure money nigeria social bookmarking and blogging
Lovegame
Re: What Do I Do?
« #19 on: October 24, 2009, 03:07 AM »

java is system independent language but is a little heavy because it uses
java virtual machine to run on
web applications are small and had to be supported on multiple OS
so java is used

c++ although platform dependent uses Little system resources
games run many programs at a time so they are made in c++
if they would be made in java they would have required a lot of ram and CPU resources

see it really depends on the platform you are using
for eg.if you are making a game for a console like PS3,XBOX 360 or Wii
memory is limited they have ram in range of 256-512 MB
so c/c++ is used and java is avoided

for computer games where ram is available in plenty say 2GB
many online games are java based (also consider they are focused on all browsers and operating systems)

java games are also common on mobiles because in this field there are many architectures many operating systems
so to have maximum profit application are made in java so it can be played on most models although these applications are terribly slow

here a nseries or s60 platform phones give an edge
because 25% of world phones are powered by s60 devices NOKIA provides s60 platform with carbide c++
making these devices run c++ applications based on arm processor architecture that perform faster than java applications
c++ applications are 60-80% faster and use 40-60% less ram!!




visit www.naijavine.com,  your sure money nigeria social bookmarking and blogging
Kobojunkie
Re: What Do I Do?
« #20 on: October 24, 2009, 04:28 AM »

@Poster, spend more time honing your algorithm skills. I happen to be working myself on creating more complex applications but figured out early that it is all about bettering one's ability to handle algorithms and I am not talking simple but very complex, mathematical cases. So, work on your math skills as you learn or you will find that all the simple chess games and ludo games no longer accepted as talent games in months to come.
aquastar (m)
Re: What Do I Do?
« #21 on: October 24, 2009, 02:59 PM »

Your can read Killer Game programming in Java but that is after you are comfortable in the java language itself
gameaddict (m)
Re: What Do I Do?
« #22 on: October 31, 2009, 05:00 PM »

Thanks guys.
This is the test version battle function. I added the class and the main function so anyone could test it. Its not well documented yet but i hope you understand it.
Note: attack and defence are not used.  health is the only integer i initialised and I use Dev c++.
         
          Also note: I used SorD to determine if the attack is parried or attack suceeds

Please  comment on the function and if you wish to suggest any modifications please do.



#include <iostream>
#include <cstdlib>
#include "windows.h"

using namespace std;

class Character
{ public:
      Character(int h=100, int a=50, int d=50) { health = h; attack = a; defence = d;}
      int health, attack, defence;
};

Character me, enemy;

int battle(int &x, int &y){
    while(x !=0 || y !=0){
    Sleep(1000);
    cout <<"\n your health = "<<x<<", Enemy health = "<<y;
    int min = 1, max = 11, range = max - min + 1;
    int firstBlow = rand()/100%range + min; //first attack and subsequent attacks;
    int SorD = rand()/100%range+min; // if the attack suceeds or is defended;
    if(firstBlow <= 1 || firstBlow >= 5 ){
    Sleep(1000);
    cout<< "\n You attack!"<<endl;
       if(SorD <= 1 || SorD <= 6){
       Sleep(1000);
       cout << " You hit!"<<endl; y -= 20;
       Sleep(1000);
       cout<<" Enemy Health = " << y <<endl;
       Sleep(1000);
       cout<<" Your health = "<<x<<", Enemy health = "<<y<<endl;
          if(y <= 0) break;}
       else if(SorD <= 7 || SorD <= 11){ Sleep(1000); cout<<"\n Enemy parries!"<<endl; }}
    else if(firstBlow <=6  || firstBlow >= 11){Sleep(1000); cout<<"\n Enemy attacks!"<<endl;
      if(SorD >= 1 || SorD <= 6){
      Sleep(1000);
     cout << " Enemy hits"<<endl; x -= 20;
     Sleep(1000);
     cout<<" Your health = " <<x<<endl;
     Sleep(1000);
     cout<<" Your health = "<<x<<", CPU health = "<<y<<endl;
          if(x <= 0) break;}
      else if(SorD >= 7 || SorD <= 11){ Sleep(1000); cout<<"\n you parry the attack!"<<endl;}}
//while;
}
   if(y <= 0){
        cout<<"\n Enemy stamina = "<<y; return 1;}
   if(x <= 0){
        cout<<"\n Your Stamina = "<<x; return 2;}
}

   

int main()
{
    while(true){
    cout<< "\n Do you want to fight? (y or n)";
    char decision;
    cin>>decision;
    if(decision == 'y' || decision == 'Y'){
    cout<< "\n You decided to fight get ready!"<<endl;
    system("PAUSE");
    int outcome = battle(me.health, enemy.health);
    if(outcome == 1){cout<<"\n You win!";
    cout<<" enemy health = "<< enemy.health<<endl;}
    if(outcome == 2){cout<< " \n your stamina is finished , cpu wins!"<<endl;
    cout<<"\n Thanks for playing.";}
    char play;
    cout<<"\n continue? (y or n): ";
    cin>>play;
    if( play == 'y' or play == 'Y'){
    enemy.health = 100; me.health = 100;}
         else{cout<<"\n Goodbye!"<<endl;
                system("PAUSE");
                exit(0);}}
    if(decision == 'n'){
                cout<<"\n Goodbye!"<<endl;
                system("PAUSE");
                exit(0);}
    }
}
joyblinks (f)
Re: What Do I Do?
« #23 on: November 02, 2009, 07:46 AM »

@sweet_pawn 

Please can i have your mail address? will need to share some words with you.
sweet_pawn
Re: What Do I Do?
« #24 on: November 02, 2009, 08:06 AM »

gameaddict (m)
Re: What Do I Do?
« #25 on: November 03, 2009, 12:18 PM »

Hey guys!

Anyone checked the codes yet? patiently waiting,     Grin
 Ebook On Java Pgramming  This School Will Train You On I.t. And Provide You A Job In North America & Eu  Help On How To Configure Jdk On Windows Os  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.