Jump to content

  • Log In with Google      Sign In   
  • Create Account


Black-Rook

Member Since 11 Dec 2011
Offline Last Active Feb 06 2013 02:14 AM
*****

#4999836 Switch vs if else

Posted by Black-Rook on 11 November 2012 - 01:18 AM

I will use a switch statement if I'm dealing with a lot of checks. If it's just a few, "else if" will be good enough. They will all accomplish the same thing, code wise.


#4993228 [Allegro 5] Game Crash

Posted by Black-Rook on 23 October 2012 - 04:01 PM

Allegro wiki has all the answers for correctly setting it up.

http://wiki.allegro.cc/index.php?title=Allegro_5


#4993047 [Allegro 5] Game Crash

Posted by Black-Rook on 23 October 2012 - 03:57 AM

Your error code states "Line 29: error: allegro5/allegro.h: No such file or directory", are you sure that you're using the right path for allegro.h ?

I noticed errors in your code:

if(!al_init()) {
	  fprintf(stderr, "failed to initialize allegro!\n");
	  return -1;
   }

All you're doing is checking if al_init() returns false... Yet you never called al_init().

You need to call the following right before the check to see if they return false.

al_init();
al_install_keyboard();

ect....


#4991008 Code Help - Pong Game

Posted by Black-Rook on 16 October 2012 - 11:30 PM

Not sure why you're doing it that way... This is very simple thing to program.

Make a function that returns the value of your Ball's Position.

int Ball::Ball_X_Position()
{
	return x;
}

Then have a function for your Paddle which can read that position.

Paddle.Paddle_Function(Ball.Ball_X_Position());

Just have whatever you need done occur after positions have been read.

You don't need to use Get and Set.


#4989079 C developper, but newbie gamedev, where should I begin?

Posted by Black-Rook on 11 October 2012 - 06:41 AM

Galdred, use whatever you feel like using regardless of opinions. I've used C, C++, C#, VB, ect... But I never liked C# for games and I just use C++ regardless of opinion and I'm doing just fine!

The Allegro library is something I've been using for a long time. However, SDL is also a good option. Best thing to do is just download them, and get started!


#4987863 First "game" in C++

Posted by Black-Rook on 07 October 2012 - 10:52 PM

Servant of the Lord brings up some great points!

Early on in game development I got heavily into tool development, and believe me it saves so much time and hassle from hard coding. I still remember my first text game in C++, I had a ton of classes: Weapon, Enemy, Player, Tool, Battle System, ect...

Keep up the great work!


#4983173 Allegro installation?

Posted by Black-Rook on 24 September 2012 - 04:52 AM

Yes, the 4.5 framework causes issues sadly. You can try the following though:

Set Generate Manifest to No, or you can disable incremental Linking. Under Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)".

Hope this helps!

Edit: Yes, SP1 is also an option, sorry I forgot all about it.


#4983168 C#/XNA textbooks

Posted by Black-Rook on 24 September 2012 - 04:13 AM

I enjoyed reading: Learning XNA 3.0 by Aaron Reed, now of course this is not a 4.0 book, but maybe he has one.

XNA Sites I recommend:

http://xnaresources.com/ <- Start here!
http://www.xnadevelopment.com/tutorials.shtml
http://www.riemers.net/


#4983157 Allegro installation?

Posted by Black-Rook on 24 September 2012 - 03:07 AM

Okay what appears to have happened is that you've set your directories incorrectly. Just encase you didn't know, you must also reset your directory for each new project you create in your project settings. I would strongly suggest you make a project already setup with a generic main.cpp file, and just copy and past the whole project so you don't have to setup everything again. However, if you use a new version you will have to redo everything.


#4983148 Allegro installation?

Posted by Black-Rook on 24 September 2012 - 02:45 AM

Okay this is the problem, it cannot find allegro.h !

For example, I use: #include <allegro5/allegro.h> because I have my C/C++ General Include set to ->>>> C:\allegro-5.0.5\include

If you go into your include folder, you should see another folder which has your allegro.h file, mine happens to be allegro5.

I just downloaded the 5.0.7 version to check the folder, and it shows the file in allegro5.

Using: #include <allegro5/allegro.h> should work! So you must have set your direct wrong in your settings.

Type your directory address for the file instead. Should show this:
#include "C:\allegro-5.0.5\include\allegro5\allegro.h" (SOMETHING LIKE THIS) and remove: #include <allegro5/allegro.h>


#4983145 Allegro installation?

Posted by Black-Rook on 24 September 2012 - 02:32 AM

Try removing: #include <allegro5/allegro.h> and using: #include <allegro.h>


#4983139 Allegro installation?

Posted by Black-Rook on 24 September 2012 - 02:22 AM

Please copy your main.cpp code.

If you're using the cpp tag option it might not show anything after #include <wont show> for some reason.... You can edit your post and just take the cpp part off, and keep it as source.


#4983134 Allegro installation?

Posted by Black-Rook on 24 September 2012 - 02:05 AM

Can you please post the fail message?

If you created an empty project and made a main.cpp which has:


#include <stdio.h>

#include <allegro.h>



int main(int argc, char **argv)

{

   ALLEGRO_DISPLAY *display = NULL;



   if(!al_init()) {

	  fprintf(stderr, "failed to initialize allegro!\n");

	  return -1;

   }



   display = al_create_display(640, 480);

   if(!display) {

	  fprintf(stderr, "failed to create display!\n");

	  return -1;

   }



   al_clear_to_color(al_map_rgb(0,0,0));



   al_flip_display();



   al_rest(10.0);



   al_destroy_display(display);



   return 0;

}



Everything should work, but please post your error message along with the full directories for your allegro include and lib folder.


#4972904 Realistic Encouragement vs Trolling Tear-down

Posted by Black-Rook on 24 August 2012 - 12:40 AM


I don't believe anyone should belittle a new programmer, or game designer, however as with any topic you can address the new comer in a more constructive and civil manner. If they're talking about making the next AAA title in two weeks with no prior experience simply not responding to their post is better then tossing an insult.

Can you please give a specific example of this happening? Anyone? Either no one has been able to link to a specific thread and say "Here is an example of this trolling tear-down" or I've overlooked it. I certainly don't think we should be insulting or belittling people (except for maybe trolls themselves, but even then you're just feeding them, and they usually get banned/suspended/warned pretty quickly by the great mods), but honestly, I can't remember a time when a sincere beginner was insulted or deliberately belittled by an older, more experienced member. The last time I saw one member insulting another member, it was a younger, less experienced member insulting an older, more experienced member.

Honestly, I feel like we're on a witch hunt here.


My post is voicing an opinion. "I don't believe anyone should belittle a new programmer", I never said anyone did this on the GameDev forums. Yes, I've seen this in the past many years ago, however since then, stricter rules and enforcement have been put into place.


#4972811 Realistic Encouragement vs Trolling Tear-down

Posted by Black-Rook on 23 August 2012 - 06:09 PM

I don't believe anyone should belittle a new programmer, or game designer, however as with any topic you can address the new comer in a more constructive and civil manner. If they're talking about making the next AAA title in two weeks with no prior experience simply not responding to their post is better then tossing an insult. Everyone should be allowed to dream because if we couldn't set goals higher than what we could normally achieve, technogly would not be at it's current state today! I remember stories from people in their 70's still laughing about the idea of using a "card" to pay for things, yet it's here...

New programers can save themselves a lot of grief by sharing ideas and only sharing a game they're planing to make once they have some form of a visual or playable demo.

The key to any conversation online or offline is that no matter what you say, someone out there will always have an opinion, good or bad. Work on your ideas, and weed out the good from the bad when it comes to comments.




PARTNERS