It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was reviewing a code from a simple PONG game code in c#, the logic as far as I could understand was reading a key press (UP and Down) in a infinte loop and update the position of the ball and bar each n milliseconds one after another.
I want to know how to draw objects on a graphic box simultaneously?
I am just interested in making simple games using a imagebox and simple graohics.
If you want to make really simple games like Tetris or other puzzle-like, you could simply drop the "infinite loop" part. I've seen plenty of simple games built with Winforms/user controls/standard events (keypress/mousemove...).
If you plan to write something more complicated, then you probably want start learning XNA. Microsoft kindly provides useful starter kits.
You don't do it simultaneously, you do it in a loop but that loop happens so fast that a human cannot tell they are being updated one at a time.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am a total newbie for app development with a little knowledge of c#. I have some free time in my hand ans was thinking of learning WP7 app development as well as c#. So, I figured I will build a metronome app in c# for WP7. I think learning by doing a project will me most effective.
But, I haven't been able to find much resources on how to accomplish this. On the web there are lots of tuts on how to build a metronome in JS but not in c#. So, If anyone can point me to some resources to get me started, that would be great. I'll be trying hard learning bits by bits as I progress.
http://create.msdn.com/en-US/ You will find tutorials, videos & all sorts of other excellent good times on here.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I would like C# code for determining the centre and radius of the circle that best fits the points in an array using the least squares method or equivalent.
Having searched on web I've found none.
You can either use a general minimization algorithm such as Levenberg-Marquardt or turn it into a linear problem and just solve for the parameters of the circle (x,y, radius). See this link for more information.
I'm not aware of any multivaraible Levenberg-Marquardt for .NET so the second solution is probably easier to go for. Note that you will need to solve a matrix equation of the form Ax=b to find your circle parameters. The Math.NET library seems able to do this.
You can try the FitEllipse function of the opencv library :
Fit ellipse
I think a C# wrapper of OpenCV exists.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm trying to create a car game in C#. I'm now trying to figure out a way to get some sounds into the game. For example, the acceleration sound of the car.
I recently tried to add a 5 second-sound of a real car accelerating, but I don't think its the right way to do it. Because then i have to start from the beginning all the time of the clip when i accelerate.
Is there maybe some way to work with frequencies? To send a frequency to the speakers and then just increase it when I accelerate (And to make it sound like a car)
I've heard about PWM, could that be something?
One way to approach this might be to mix some sounds together...
For example, if you had a series of sounds such as:
Car Idling
Car accelerating from 1st to 2nd, gear, etc
Sound of the car downshifting / engine braking
Sound of the car in each gear
You could just play different sounds at different times and cross-fade between them. Perhaps you could even do some pitch adjustment during playback to correspond to the throttle.
I'm not sure how the pros do it (Grand Theft Auto, Grand Turismo), but that's the first thing that comes to mind.
When I need audio in my C# projects I always try to use NAudio.
NAudio Algorithm to play a sinewave whose frequency can be changed smoothly in real time (there's a link to an algorithm the author wrote in the body of the question)
http://mark-dot-net.blogspot.com/2009/10/playback-of-sine-wave-in-naudio.html
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am well in C# with WPF. Now i want to develop game using WPF. But the problem is i have no basic idea about game development. Can any one give me any advice or any web side or any book reference for game development.
Check out the XNA Developer Centre.
I would use the XNA game development studio. It is designed for building games on the PC and the XBOX. I you are only building a simple 2D game I would scrap C# and work in BlitzBasic or PureBasic as they are very easy to build games.
It depends on what kind of games you want to write. If you want to write Puzzle games then WPF could work. Here is a nice tutorial that shows how to write a puzzle game in Silverlight: http://msdn.microsoft.com/en-us/WP7TrainingCourse_YourFirstWP7AppLab
If you want to write action games (Or pretty much any other kind of game) then XNA is the way to go like others have mentioned. It is a game framework after all.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I asked a question about moving images with timer in c# . Some people said to me to use WPF. But I never worked with WPF before. I looked msdn but don't understand it.
Please help me, I really need this soon.
I would suggest you to have a look at Expression Blend video tutorial. Learning and implementing wpf without out tools like Expression Blend is quite challenging. http://expression.microsoft.com/en-us/cc197141.aspx
In short, in WinForms (I assume you use WinWorms when you don't use WPF) to animate some elements on the screen, so the following:
Override the forms OnPaint method, and inside there, draw the image(s) on the desired positions.
Make a backgroundworker tat support sending progress.
In the backgroundworker calculate the new positions, then call ReportProgress.
In the report progress event method, redraw the images on their new positions.
Remember to set the forms DoubleBuffered property to true so that the redrawing is done smoothly.
Good luck! :)