SFML community forums

Help => General => Topic started by: TMKCodes on June 17, 2010, 12:22:10 am

Title: [Solved] 3D camera and events
Post by: TMKCodes on June 17, 2010, 12:22:10 am
Okey.. I was writing bit of 3D and my camera went kind of crazy. I've written events to move the camera, but when i click on a key it keeps going on and if i click it again it goes faster and if i click reverse it slows down. Seems like the events are going into loop or something. Remember. It keeps going forever, been trying to debug this for few hours now, like once i press key it stays down. :P

Here's my code http://codepad.org/9NpiXuGg
Title: [Solved] 3D camera and events
Post by: Kingdom of Fish on June 17, 2010, 02:34:24 am
Well, first of all, you are using global variables. I mean no disrespect but you really should go back and learn C++ (simple terminal stuff). Once you have a variable outside the current scope it won't reset until you tell it too.

And also, DO NOT use global variables... never...
Title: [Solved] 3D camera and events
Post by: TMKCodes on June 17, 2010, 03:05:22 am
Seriously dude. There's nothing wrong with global variables, but yes thank you. They were not nulling.