16
Graphics / Bullet Face direction problem
« on: May 27, 2022, 08:04:33 am »
Hello, i need a solution for a 2d shot game. The player still shot to the right direction, i have no idea how i change the bullet direction when he walk to the left side?
//Touch Shot Button
if(btn.btnRect3.contains(worldPos)){
isFiring = true;
}
//bullet shot details
if(isFiring == true){
bullet newBullet (Vector2f( 20, 20));
newBullet.bulletSetPos(Vector2f(player.playerSprite.getPosition().x + 60, player.playerSprite.getPosition().y + 100));
bulletVec.push_back(newBullet);
isFiring = false;
}
Any Ideas
//Touch Shot Button
if(btn.btnRect3.contains(worldPos)){
isFiring = true;
}
//bullet shot details
if(isFiring == true){
bullet newBullet (Vector2f( 20, 20));
newBullet.bulletSetPos(Vector2f(player.playerSprite.getPosition().x + 60, player.playerSprite.getPosition().y + 100));
bulletVec.push_back(newBullet);
isFiring = false;
}
Any Ideas