Jump to content
  • Advertisement
Sign in to follow this  
CodeCriminal

A Few Questions

This topic is 3413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, ive got a few questions to ask, so here goes [smile] Ive been learning a bit of C# for future tool development and basically, just to 'know' another language and i was wondering: - Is it possible to define a methods body outside of the class like in C++? the reason i ask is because i find by doing this the code i produce becomes easier to read. - I downloaded XNA game studio 3.0 tried it out for a little while and managed to make a simple platformer type "game" ( it wasnt really a game, only just a square with a face jumping around the client area with simple collision detection and response ). Would XNA be a good choice for tool development or should i try something else? non-C# stuff - While toying around with joystick input i noticed that the button mapping for each different model of joystick is different. I was wondering how i would go about setting up a common button map between all different controllers, is this even possible? for example button 3 on one of my controllers is at the bottom of the 4 buttons and on my other controllers button 3 is to the right of the other four buttons like so: controller 1: ____( 2 )____ ( 1 )____( 4 ) ____( 3 )____ controller 2: ____( 4 )____ ( 1 )____( 3 ) ____( 2 )____ during programming, if i wrote that button 3 is the jump button then on controller 1 it would be the bottom one and on controller 2 it would be the button to the right! Am i supposed to make the user press each button to calibrate his/her handset? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
- No, it is not possible to define functions outside classes.

- I would not recommend XNA for tools development, mainly because it might not be so easy to integrate into a winforms window along with normal winforms components. SlimDX, on the other hand, might be better suited for tools development.

SlimDX

Share this post


Link to post
Share on other sites
Ok cool, i will look into SlimDX thanks.
I have another question about C#, is it possible to create a winform without using the editor? im just curious [smile]

Share this post


Link to post
Share on other sites
Yes it is, the editor actually just writes code for you, usually placed in a file called <Your Window Name>.Designer.cs.

Create a simple window with the creator and open up the file to see what code is required to create the window.

Share this post


Link to post
Share on other sites
Quote:

- Is it possible to define a methods body outside of the class like in C++? the reason i ask is because i find by doing this the code i produce becomes easier to read.

No. I don't see why you think this is difficult to read. Other than the the two or three lines of extra code you have to type to declare the class, you just have the indenting issue -- if indenting member functions offends you stylistically, don't do it. Then your member functions look exactly the same as non-member functions would look like.

Quote:

- I downloaded XNA game studio 3.0 tried it out for a little while and managed to make a simple platformer type "game" ( it wasnt really a game, only just a square with a face jumping around the client area with simple collision detection and response ). Would XNA be a good choice for tool development or should i try something else?

I wouldn't recommend it for tools either. You certainly could use it, but it's designed to make games and has a lot of high level game-related functionality you'd probably find yourself working around.

SlimDX is a more to-the-point wrapper around DirectX for managed code; that or an OpenGL equivalent (OpenTk, Tao) would be a better choice depending on your preferences for graphics APIs.

Quote:

is it possible to create a winform without using the editor? im just curious

Yes, it's possible, but you should really learn to use the editor for nontrivial GUI work. Otherwise you're just going to find yourself burning a lot of time mucking with positioning and coordinates and layout and configuration minutiae manually.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!