Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualBlack-Rook

Posted 16 October 2012 - 11:44 PM

C# uses functions like C++ does. Since C# uses classes, you have functions in those classes.

For example:

using System;

class Ball
{
    private int x, y;
	
	 // Constructor
	public Ball(int Temp_X, int Temp_Y)
	{
		x = Temp_X;
		y = Temp_Y;
	}

	// Destructor
	~Ball(){}

	// Get X
	public int Get_X()
	{
		return x;
	}
}

Just a basic example.

#1Black-Rook

Posted 16 October 2012 - 11:41 PM

C# uses functions like C++ does. Since C# uses classes, you have functions in those classes.

For example:

using System;

class Ball
{
	int x, y;
	
	 // Constructor
	public Ball(int Temp_X, int Temp_Y)
	{
		x = Temp_X;
		y = Temp_Y;
	}

	// Destructor
	~Ball(){}

	// Get X
	public int Get_X()
	{
		return x;
	}
}

Just a basic example.

PARTNERS