This is what is received in the Fly class:
public fly(Game1 game, Texture2D flytexture, Vector2 posisi, int arah):base(game)
{
...
}
This is what you've sent from Balloon:
fly ballon = [i][b]new fly((Game1)Game, this, ((Game1)Game).flytextures);
Posted 05 February 2012 - 11:32 AM
public fly(Game1 game, Texture2D flytexture, Vector2 posisi, int arah):base(game)
{
...
}
fly ballon = [i][b]new fly((Game1)Game, this, ((Game1)Game).flytextures);
Posted 05 February 2012 - 11:56 AM
ShadowsEdge19, on 05 February 2012 - 11:32 AM, said:
public fly(Game1 game, Texture2D flytexture, Vector2 posisi, int arah):base(game)
{
...
}
fly ballon = [i][b]new fly((Game1)Game, this, ((Game1)Game).flytextures);
Posted 06 February 2012 - 10:07 AM
public readonly static int numfly = 2;
public readonly static string[] flytexturepaths = new string[] { "fly", "balon" };
public readonly static Vector2[] flyinitpos = new Vector2[] { new Vector2(50, 250), new Vector2(700, 300) };
public Texture2D[] flytextures;
public fly[] flys;
public SpriteFont arialfont;
private int i;
protected override void LoadContent()
{
//bullet
pelurutexture = Content.Load<Texture2D>("bullet");
//laser
lasertexture = Content.Load<Texture2D>("laser");
arialfont = Content.Load<SpriteFont>("Arial");
//arial font
//---------------------load background-----------------
flytextures = new Texture2D[numfly];
for (i = 0; i < numfly; i++)
{
flytextures[i] = Content.Load<Texture2D>(flytexturepaths[i]);
}
flys = new fly[numfly];
for (i = 0; i < numfly; i++)
{
flys[i] = new fly(this, flytextures[i], flyinitpos[i], i);
Components.Add(flys[i]);
}
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
bgtexture = Content.Load<Texture2D>("BG");
// TODO: use this.Content to load your game content here
}
