I have a class "Bullet" which I instantiate using a method CreateBullet(), since there are going to be multiple bullets i decided that I should make bullet an array, though this didn't work out and I've spent an hour on trying to fix it.
What I call in my Initialize method:
Bullet bullet[] = Bullet.CreateBullet[1]();
The Bullet class:
class Bullet
{
public float2 position;
public float angle { get; set; }
public float speed { get; set; }
public static Bullet CreateBullet()
{
Bullet bullet = new Bullet()
{
position = new float2()
};
return bullet;
}
public void Move()
{
}
}
Could you please show me what's wrong with the code? Thank you in advance.
Bullet bullet[] = Bullet.CreateBullet[1]();, among other things... Start reading the documentation msdn.microsoft.com/en-us/library/aa288453%28v=vs.71%29.aspxList<Bullet>will be much easier to work with.