Well, I've got list of objects (picture boxes) with 30 objects which have location same as players in the game I'm playing. Players positions change fast,so positions of my picture boxes should change too. I've tried to do this using timer,but application lags,and it looks like players are warping. Is there any other way to change objects' positions on the form fast,without lagging?If not,maybe some suggestions what to do to prevent lag?
Asked
Active
Viewed 706 times
0
-
Using a single picture box and redrawing the frame would probably be better performance-wise, rather than having many picture boxes. But ultimately I think WinForms is not really the right framework to use to create a responsive game... – learningcs Apr 13 '15 at 22:38
-
Oh,I'm not trying to create a game.I'm making a tool for an already existed game. – Turus Apr 13 '15 at 22:43
-
As I was enlightened in this thread: http://stackoverflow.com/a/29374892/833335 C#'s async-await mechanism would probably be the best to use – Robert Apr 13 '15 at 22:49
1 Answers
1
Consider reading this tutorial by MSDN on threading. Threading allows you to improve the performance of your program by make more use of your CPU.
https://msdn.microsoft.com/en-us/library/aa645740%28v=vs.71%29.aspx
Hope it helps
Edit: You can also use a background worker which makes threading slightly easier.
https://msdn.microsoft.com/en-us/library/cc221403%28v=vs.95%29.aspx

Gus
- 31
- 5