Hi All,
I'm a dabbling Shockwave Developer, and I'm very new to C# so please humour me :). I also have poor technical jargon skills, and am thus more than likely to be misusing it. I appologise in advance.
I'm trying to store instances of my bullet class into an array, so that I can generate them on the cuff:
Here is my bullet spawning code.
public Bullet bullet;
public Bullet[] myBullets;//Array for instances?
public Bullet makeBullet(Vector3 pos,Vector3 rot)
{
bullet =
new Bullet();
bullet = bullet.Setup(myGens,
this,pos, rot);
myBullets[1] = bullet;
//bullet;//problems!
return (bullet);
}
.. And Here is my bullet class, working fine barr the fact that only one lonely bullet is currently working.
public class Bullet
{
private Vector3 pos;
private Vector3 rot;
private Vector3 velocity;
public Model pmod;
generics myGens;
Game1 myGame;
public Bullet Setup(generics moo, Game1 game,Vector3 nupos,Vector3 nurot){
myGens = moo;
myGame = game;
pmod = myGame.modLoad(
"Content\\Models\\bullet");
pos = nupos;
rot = nurot;
velocity = myGens.cosine3D(rot) * 100;
rot.X -= 67.5f;
return (this);
}
public void UpdateMe()
{
pos += velocity;
draw();
}
public void draw()
{
myGens.sussaModel(pmod, pos, rot);
}
}
}
I have this feeling that the answer will be enbaraissingly simple, but it has eluded me thus far.
Cheers,
James (Developer, gamevial)