Jump to content

  • Log In with Google      Sign In   
  • Create Account

Meerul264

Member Since 01 Jan 2013
Offline Last Active Aug 12 2013 11:08 AM

Topics I've Started

Forward declaration, how and when do we use it?

30 July 2013 - 08:21 AM

Now I know they're already a lot of threads talking about this. But no matter how much I read, I still can't seem to understand! So I decided to give it a try here - plus, I can ask a question myself here.

 

Suppose I have 2 classes; class A and class B. Both Have their own .cpp and .h files. I heard that if two classes need to use each other's member variables (quite often in game programming, I've come across a lot, but don't know how to.)

 

So how do I do forward declaration so that class A can access class B, and class B can access class A?

I might want to implement this on inventory - item class for my game.

 

Note that class A and class B are NOT declared and defined in the same .cpp file. Thanks :)

 


Want to be a game programmer/developer - but no background in computing.

28 July 2013 - 02:15 AM

What I always wanted to be is to do what I like to do best. After finished my O-level course and the CIE examination, I had a whole 3-4 months holiday. I got nothing to do except for waiting for my O-level result (2012), and playing computer games all day.

 

One day I found out this game called 'To The Moon', developed by Freebird. The game was awesome, yet simple (kind of), as if its not made by a huge company, but rather some small group of people. I began to google this game. I wanted to find out who is the director of this game, how it was made, is it famous ( and I'm not surprised it got a lot of endorsement ), etc. But what I was really interested is, how did they make this game?

 

After a bit of googling, I found out that they used this program called 'RPG maker' to make their game. Interested as I was, I visited 'RPG maker' website and surf through their sites. I thought, "So this is how most people make games. ". I didn't know anything about programming back then, let alone knowing that 'computer programming language' exists, and nor do I have any interest in anything computer-related. Another few surf, I stumbled upon the word "Now with codes... (some programming language)" or something like that.

 

So again, I search about programming language. In turns out that the very basic thing in game-developing is coding the game. So, given that I have 3-4 long months of holidays, I decided to give it a try, and start learning C++ from various tutorial sites and youtube videos , and forums.

 

I spent day and night everyday, reading and watching tutorials online, and making some random useless programs to practice what I've learned.

If I had an error that I couldn't solve, I sometimes couldn't sleep at night until I finally find a solution. Its really decided that this is what I really like to do best. If I can choose any career, I'd want to be a game programmer.

 

However, there are some problem that 'push' me away from nearing that career:

 

Firstly, in my country, there's no game industry at all. Most programmers in my country work for non-game industry, like working for an oil and gas industry. So, I can say that the number of demand of game programmer in my country is likely to be 0.

 

Secondly, I don't have any background on programming, ICT, or computer studies under my school courses. I only found out about programming, and start learning last year's December (2012).

 

Thirdly, I afraid I don't have time to spend on game programming. Now that I'm a student taking A-level course for Physics, Mathematics, Chemistry, I have too much work to do in my hand, and these three subjects aren't easy to score. To add one more 'subject' (i.e programming) in my free time will probably drop my academic performance.

 

Sorry if my English is bad. That's all what I wanted to share. What your say in this?


SFML crash when debugging, but ok on release.

27 July 2013 - 06:05 AM

I tried to search regarding this problem on google but couldn't find a similar case. The problems I found is vice versa of mine - crash when release but ok when debugging.

 

I already checked my project's configuration a dozen times but still can't find whats wrong.


Need an idea on how to create map for 2D first person

26 July 2013 - 06:51 AM

Right now I just wanna try to make a prototype of a game where you can walk around in a 2D world with first person view (like 2D dungeon crawler). I'm using SFML 2.0 for now. I already had the very basic idea on how to create map for this game, but the work are too tedious. I need help so that I make the most efficient way in generating/editing the 2D map. 

 

If you are good at this, please help a newbie out :)


[SFML] Text not drawn problem

16 January 2013 - 10:47 AM

I've a problem where, when I show another window on the screen, everything works fine except the text isn't printed out on the screen. I've already called the loadText() in the int main(). Help me fix this problem.

 

 

#include "ErrorMessages.h"
#include "Global.h"
 
#include <SFML/Graphics.hpp>
 
ErrorMessages::ErrorMessages()
{
    //ctor
}
 
ErrorMessages::~ErrorMessages()
{
    //dtor
}
 
void ErrorMessages::loadText()
{
    if(ErrorFont.loadFromFile("monospa1.ttf"))
        ErrorText.setFont(ErrorFont);
}
void ErrorMessages::sendErrorBox_alreadyvote()
{
    sf::RenderWindow AlreadyVoted(sf::VideoMode(570,50,32), "ERROR - multiple votes not allowed");
 
    while(AlreadyVoted.isOpen())
    {
        sf::Event Event;
        while(AlreadyVoted.pollEvent(Event))
        {
            if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape) || Event.type == sf::Event::Closed)
                AlreadyVoted.close();
        }
 
        ErrorText.setString("You already vote this officer!");
        ErrorText.setColor(sf::Color::White);
 
        AlreadyVoted.draw(ErrorText);
        AlreadyVoted.display();
 
    }
}
 
void ErrorMessages::sendErrorBox_incompleteVote()
{
    sf::RenderWindow IncompleteVotes(sf::VideoMode(570,50,32),"ERROR - incomplete votes");
 
    while(IncompleteVotes.isOpen())
    {
        sf::Event Event;
        while(IncompleteVotes.pollEvent(Event))
        {
            if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape) || Event.type == sf::Event::Closed)
                IncompleteVotes.close();
        }
    }
 
    ErrorText.setString("You must vote all officers!");
    ErrorText.setColor(sf::Color::White);
 
    IncompleteVotes.draw(ErrorText);
    IncompleteVotes.display();
 
}
 
Thank you.

PARTNERS