alright I have a class for shooting(shots) in my game, also a player, map and game class.
so I have the player creating the shots with
1 2 3 4 5
void Player::shoot()
{
//not sure how to get the new shot everytime
shot.push_back(Shots(Player::getPosition(),sf::Color::Red, 2.5f, sf::Vector2f(-1.f, -1.f)));// sf::Color::Red, 2.5f, (-1.f, -1.f));
}
I have the main creates game and game creates map and map creates player. so where I draw the player I think I want to draw the shots as well and I have this.....
1 2 3 4 5
window.draw(circle) // this is the player for now
for(int i = 0; i < shot.size(); i++)
{
window.draw(shot[i].projectile); // but here it says projectile is inaccessable
}
I have the shot as a circle as well as "sf::CircleShape projectile;"
im a little lost on how I can get this to draw to the screen.
ok, not sure how to go about this, I want to make a new function called render in the shots class but then im not quite sure how to draw up the individual shot this is what I have but does not work
[code]
void Shots::render(sf::RenderWindow& window)
{
for(int i = 0; i < shot.size(); i++)
window.draw(projectile[i]);
}
[code]