Difference between revisions of "Creating A Player"
(Created page with " You need to create a new class, so from the main menu click File, and select New File. 600px You will have the following code: <syntaxhighlight...") |
(No difference)
|
Revision as of 23:01, 17 March 2017
You need to create a new class, so from the main menu click File, and select New File.
You will have the following code:
1 using System;
2 namespace TestGame
3 {
4 public class Player
5 {
6 public Player()
7 {
8 }
9 }
10 }
The public class Player line is the class definition, and public Player is the constructor for the class. You need to add the following lines within the using section:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
This will allow the class to access the MonoGame framework and SDK. Now to add the methods to setup, update and draw the player. So add the following methods into the player class:
public void Initialize()
{
}
public void Update()
{
}
public void Draw()
{
}