SFML community forums

Help => Graphics => Topic started by: SSLukeY on April 11, 2016, 03:35:36 pm

Title: how do I create copies of sprite or shapes?
Post by: SSLukeY on April 11, 2016, 03:35:36 pm
I'm a beginner of sfml,  I'm currently making a game which involves shooting bullets, so I need to create copies of bullets, kind of like spawning them in, but i'm not entirely sure how to.

 I know it might be really simple, but I'm really stuck,  any help please? :-[
Title: Re: how do I create copies of sprite or shapes?
Post by: smilesprower on April 11, 2016, 04:37:21 pm
Easiest way is to create a class Bullet
You can have a list of bullets or a vector etc.

If you need more of an explanation or some sample code I can post some later on maybe ?
Title: Re: how do I create copies of sprite or shapes?
Post by: SSLukeY on April 11, 2016, 06:50:49 pm
yes please an example would really be helpful, thank you
Title: Re: how do I create copies of sprite or shapes?
Post by: Jesper Juhl on April 11, 2016, 06:56:03 pm
There are lots of examples in the wiki and tutorial:

https://github.com/SFML/SFML/wiki

http://www.sfml-dev.org/tutorials/2.3/