So my "meteors" weren't drawing because I was passing the meteor shape variable by value to my add point function, and not my reference. That would explain why the points didn't "save" themselves when the function was done. This simple mistake made me laugh when I realized how small it was, but now I just feel like I have so much to learn when it comes to C++.
Here's how it looks so far (I love pictures, haha.)

So I tried writing function that would check if a point is the same as the meteors, for collision.

{
if (i == 0)
{
if(Y == meteorShape.GetPointPosition(i).y)
{
checkY = true;
break;
}
}
else if ((Y >= meteorShape.GetPointPosition(i).y) && (Y <= meteorShape.GetPointPosition(i+1).y))
{
checkY = true;
break;
}
}
So... it doesn't work. I'm not sure if it's because of this "checking point" function or something else, I'm almost positive the problem's here though. I'll find and fix it by the next post!
hey catrinat, im really curious as to you finishing your game, or at least to the point where its playable. i am also someone who knows a bit of c++ and is *attempting* to learn sfml.
ReplyDeletei dont know about you, but i learn best from other peoples code. ya know like figuring out why and how they did certain things. so if you want you could send over the game your working on, and ill reply with one or two of mine.
from what i read,you can be quite busy, so if you found other interests besides sfml, thats fine. but you can always contact me at miccim15@yahoo.com thank you