Jump to content


Member Since 29 May 2000
Offline Last Active Yesterday, 09:21 AM

Posts I've Made

In Topic: MT libraries in modern games.

27 May 2017 - 11:41 AM

c++ standard library all the way

In Topic: Problem with moving SDL rect at an angle?

23 May 2017 - 03:19 PM

first thing: SDL_Rect uses integers for its values, and you are going to want to use floats.

next: if it moves in the "opposite" direction, just invert the sign on the math (ie change the - to a +)

next: moving sideways? where are you expecting an angle of 0 radians to be at?  straight "up"?  nope.  in math cos(0) = 1 and sin(0) = 0.  since you are using cos to modify your x value, then when the angle is 0 then you are changing your x component by the speed and the y component by 0

In Topic: Repeatedly using Async

21 May 2017 - 08:55 AM

For network stuff, I always create a separate thread where the only purpose is to receive packets (in a blocking manner) and then pushing them into a queue.  Then on the main thread in the update method, I will loop through the queue and process them all.  That means you need to protect that queue with a mutex though.

In Topic: read int from char * question

21 May 2017 - 08:53 AM

have you tried calling the function and see if the correct value is returned?


that being said, if you are trying to convert "10" to 10, then no, this wont work.


Look into build in functions like http://www.cplusplus.com/reference/cstdlib/strtol/

In Topic: What inputs to support for PC game, keyboard, controller, or both

07 May 2017 - 07:55 PM

my opinion is keyboard/mouse.  there may be a case where a controller would be better but I cant think of one, at least not where I would prefer to use a controller.  I am partial towards strategy (RTS or TBS) games though.