Good evening everyone. I am a newby in game programming, and I would like to receive some help.
So I have created a list of round shapes. I will post just some rough lines of the code, to give you an idea.
class ShapeCircle
{
sf::CircleShape circle;
//sf::Vector2f position;
//and the other things
}
struct Node
{
ShapeOfCircle circle;
node*next;
}
class listCircles
{
private:
*node head;
public:
//the other methods
}
And until here everything is okay. Now what I would like to do is to create another list in which, each node, contains a list.
struct Node2
{
listCircles ListOfCircles;
Node2*next;
}
And same, we have this second list.
What I would like to do is to create new circles, if the player moves to the right, and if the player moves to the left should be able to see the "old screen".
Let's say I have a list of (4, 5, 3, 3);
The first time I open the screen there is the player who sees 4 circles, then the player moves to the right of the screen and (pacman effect, the player goes beyond and is back again) I should be able to see 5, then if the player moves again 3, but if the player goes backwards, I should be able to see 5.
Is there a way that I can do this? I tried to save the position of the circles in a file, and trying to read ( a complicated thing) but it didn't work, that's why I am sort of sticking with lists (I am not allowed to use any libraries)
Do you have any suggestions?