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

Author Topic: spawn more trees with one sprite  (Read 1464 times)

0 Members and 1 Guest are viewing this topic.

AzkaIsHere

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
spawn more trees with one sprite
« on: April 06, 2018, 11:21:46 pm »
Hi, I have an image that is a tree and I want to make it so that it spawns 500 trees all around the map, but I don't know how to draw multiple times the same image, I know that you need vectors and for loops, but I didn't understand much about how that works, can someone explain how to do that? thanks in advance

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: spawn more trees with one sprite
« Reply #1 on: April 07, 2018, 09:35:10 am »
That's a basic C++ question, the SFML forum is not the best place for learning such things. You should rather read a good C++ book, or find dedicated tutorials, or at least a true C++ forum :)
Laurent Gomila - SFML developer

AzkaIsHere

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: spawn more trees with one sprite
« Reply #2 on: April 07, 2018, 01:58:56 pm »
no it's not, I know how for loop works and how arrays work etc... the thing that was confusing me is the passage from an arrays and for loop working with integers to an array and for loop working with sprites, but I figured it out yesterday so it's ok thx anyway

 

anything