Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

kidman171

Member Since 14 May 2012
Offline Last Active May 19 2013 03:55 AM
-----

#5053793 Coding Style: Curly Braces

Posted by kidman171 on 16 April 2013 - 05:49 AM

What about using the best of both worlds?

 

int  doSomething(int x)
{     int y;
      // ... do complex operation
      return y;
}

      

 

 




#5045085 lib3ds

Posted by kidman171 on 20 March 2013 - 06:27 PM

You can compile makefiles on windows with MinGW32-make. Just check in your mingw installation and see if there is a binary called mingw32-make. If so, open a command prompt, cd to the folder with the makefile in it, and run mingw32-make.


#5032088 Where to begin? (C#)

Posted by kidman171 on 13 February 2013 - 06:52 PM

How in the world can you not find anything!? I googled "C# for the absolute beginner" and got tons of good hits! You can also search for c# books on amazon and you will get a lot of hits.


#5030979 OpenGL Setup Issues

Posted by kidman171 on 11 February 2013 - 03:33 AM

Try compiling glew with mingw using the makefile that comes with the source. You will need to compile it through MSYS because the makefile is not windows-compliant. Then link to your newly compiled library and that should fix things.




#5027740 SDL Event Queue

Posted by kidman171 on 31 January 2013 - 10:40 PM

What you should do is keep track of when the key gets pressed and when it gets released. You could have a simple array of bools, one for each key. When you get an SDL_Keydown event, switch the key in your bool array to true. When you get an SDL_Keyup event, switch the key in your bool array to false. Then in your update loop, you can just check your bool array to see if x is pressed and move your sprite accordingly.




#5026949 [solved]Help with my ray picker

Posted by kidman171 on 29 January 2013 - 03:42 PM

Thanks swiftcoder, that solved the problem! I changed the origin to the cameras position and direction to normalize(nearPlane - cameraPosition) and it works like a charm!




#5026194 What OpenGL Implementation Do Real Games Use?

Posted by kidman171 on 27 January 2013 - 04:06 PM

Note that opengl32.lib only supports up to opengl 1.1. If you want to use any newer functionality, you need to get that functionality from the graphics card drivers. Your best option is to use a library like glew(http://glew.sourceforge.net/) to load that functionality for you.




#5017562 seriously newbish question :)

Posted by kidman171 on 04 January 2013 - 05:43 PM

vector<vector<string>> room[10];

 

 

This code would create an array of 10 vectors of vectors of strings.


I think you want this:

 

vector<vector<string>> room(10);

 

 

This would create an vector of vectors of strings, instantiated with 10 elements.




#5016923 DirectX 10, Collision detection with mouse question.

Posted by kidman171 on 02 January 2013 - 07:08 PM

Google 3d picking


#5014162 CodeBlocks and SFML Confusion?

Posted by kidman171 on 25 December 2012 - 08:29 AM

I wrote a step by step tutorial just for you, I hope it helps.

Attached Files




#5013936 My first game MyPong, finished at last

Posted by kidman171 on 24 December 2012 - 08:14 AM

Hello, congrats on finishing your first game!

 

Here are a few things I noticed about your game:

 

    1) The paddle speed is way too slow. If the ball goes on the other half of the screen, I have no chance to save it.

    2) The ball start's in the center and goes in a random direction very quickly, sometimes scoring against the AI or myself 3 or 4 times in succession.

         Increasing the paddle speed may give a chance to save the ball in this scenario.

    3) There are a few things that might make your code cleaner, for example:

 
</p><div>if ai_pad.points == 11 or my_pad.points == 11:</div>
<div>if ai_pad.points == 11:</div>
<div>game.winner = "AI"</div>
<div>else:</div>
<div>game.winner = "Player"</div>
<div>game.game_over = 1</div>
<div>game.pause = 1if ai_pad.points == 11 or my_pad.points == 11:</div>
<div>if ai_pad.points == 11:</div>
<div>game.winner = "AI"</div>
<div>else:</div>
<div>game.winner = "Player"</div>
<div>game.game_over = 1</div>
<div>game.pause = 1</div>
<div>
      This is under the calculate_position function in ball.py. However, this piece of code is calculating the winner, not the position. Putting it in its own method called something like determine_winner()  could help you find errors easier because you will know right where your code is that determines the winner.
      Also, the speed for the pad is controlled by a variable called ball_speed. Don't you think you should call this variable pad_speed?
 



#5004505 Starting OpenGL

Posted by kidman171 on 27 November 2012 - 07:21 AM

Hi,
I've been studying modern opengl (3.2+) lately. Like the other's have said, opengl is not tied to a compiler, you can use any compiler you like. At home I use Visual Studio 2012 Express and at work I use Code::Blocks with MinGW 4.7.2.

If you are interested in learning Modern OpenGL, I have found the following links to be very helpful:
http://www.arcsynthesis.org/gltut
http://www.opengl-tutorial.org
http://ogldev.atspace.co.uk/index.html
http://www.mbsoftworks.sk/index.php?page=tutorials&series=1
http://rastertek.com/tutgl40.html
http://open.gl

Good luck!


#5000523 Who to follow on Twitter?

Posted by kidman171 on 13 November 2012 - 05:24 AM

I like to follow David Rosen's work on Overgrowth: http://twitter.com/wolfire


#4998708 Returning multiple values from function C++

Posted by kidman171 on 07 November 2012 - 08:33 PM

You are probably passing the render window to a function as a copy instead of reference. Render Window inherits NonCopyable so you can't do that.


#4997707 Using sfml2.0 to input a name

Posted by kidman171 on 05 November 2012 - 02:17 PM

I was actually just working on getting a user's name today. Here is a snippet of the code I used:

while( window.pollEvent(event) )
{
switch( event.type )
{  
case sf::Event::TextEntered:
  if( event.text.unicode < 128 )
  {
   std::string name = playerName.getString();
   if( event.text.unicode == 13 ) // return key
   {
	// finished entering name
   } else if( event.text.unicode == 8 ) { // backspace
	if( name.size() > 0 ) name.resize( name.size() - 1 );
   } else {
	name += static_cast<char>(event.text.unicode);
   }
   playerName.setString( name );
  }
  break;
// ... more cases
}
}





PARTNERS