Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: how do I create copies of sprite or shapes?  (Read 2301 times)

0 Members and 1 Guest are viewing this topic.

SSLukeY

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
how do I create copies of sprite or shapes?
« 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? :-[

smilesprower

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: how do I create copies of sprite or shapes?
« Reply #1 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 ?

SSLukeY

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: how do I create copies of sprite or shapes?
« Reply #2 on: April 11, 2016, 06:50:49 pm »
yes please an example would really be helpful, thank you

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: how do I create copies of sprite or shapes?
« Reply #3 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/