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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - forestlapointe

Pages: [1]
1
General / Re: check if variable is equal to certain sprite or null
« on: September 19, 2019, 01:13:51 pm »
It seams there is a lot about C++ that I've yet to learn, haha. Thank you this was very helpful and brought a lot of functions and techniques to my attention that I would not otherwise have thought to use.

2
General / check if variable is equal to certain sprite or null
« on: September 18, 2019, 01:34:26 pm »
I need to create a public function that runs through an array of sprites and draws them if they are not null, however if you create an array of sprites I have no clue what null is. So I figured I'll just make a blank sprite, name it null, populate the array with that, and use it as null. However when I try to compare the value in a point of the array to (well anything really, but in this case) the null sprite, it tells me "no match for 'operator==' (operand types are 'sf::Sprite' and 'sf::Sprite')" which I assume means that because I'm not comparing a typical data type the operators mean nadda.
This is my code so far, it's at the top of the page(after all the #include's)
(click to show/hide)

If you didn't already guess, I'm making a game where the sprites will overlap, and I would like those with a lower y value to be drawn first, so that those that are closer to the "camera" will be drawn over those "farther away". I tried googling how to do this, but the only thing I found was a lot of people asking for a z axis to be implemented in sfml, and others responding that that would be inefficient and to do this instead. Problem is, everyone's so quick to tell people off but nobody actually wants to actually help or give any idea how to do it.

Pages: [1]
anything