I am developing an Android game. I have problem with bullet firing. It's a space ship that has to fire bullets but right now it's firing in a random direction. I have to fire a bullet to the enemy from the only one point on the nose of the ship. Right now the bullets fire sometimes from the tailpart or other. So that's a problem. How do I give a bullet direction and how to fire it from only the head of my space ship?
private void fireBullet()
{
float plusX = 16;
float plusY = plusX * mPlayer.getRotationValue();
Bullet mBullet = new Bullet(mPlayer.getX()-plusX, mPlayer.getY()+plusY, 8, 8, this.mGameController.mBulletTextureRegion, this.mPhysicsWorld, mPlayer);
mBulletList.add(mBullet);
//System.out.println("size is :" + bulletList.size());
mScene.getTopLayer().addEntity(mBullet.getSprite());
mSoundManager.playGunShot();
}
What is defect here?? it does not fire bullet from ship's nose?? What can be done..??
