nvangogh
unread,Apr 25, 2013, 12:44:12 PM4/25/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I am in a problem situation.
I have this :
std::vector<sf::Sprite> alien_fleet(55, alien);
This vector will hold a collection of 55 Sprites (for a game). There is
no problem in it compiling. The problem is that each element of the
vector - each 'alien sprite' MUST be associated with a cartesian
coordinate position x , y pixels.
The library i am using takes care of the pixels by allowing me to use
int values. So each alien sprite must simply be associated with a (x, y)
value.
Now, suppose we have:
a total screen size of x by y pixels, and
that each of these alien sprites are say 55x55 pixels in size
How would I go about associating the alien_fleet vector with the system
of x , y coordinates? I think there needs to be another container.
Bearing in mind that the position of each sprite will change during the
execution of the game.