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.


Topics - ntrncx

Pages: [1]
1
General / how to create a grid?
« on: November 22, 2011, 08:40:04 am »
in cmd you create a 2d array

Code: [Select]
for(int x=0;x<100;x++)
{
      for(int y=0;y<100;y++)
      {
            grid[x][y];
       }
}


in sfml how i create a grid and draw the needed part?
any tutorial?or link?
i thought to create an object for each part but i dont know how to make it,
i want to explain me the logic and give me a tutorial or link with an example if you can,i searched on google but didnt found anything

thanks for your time

2
General / mouse click on moving animation problem
« on: November 19, 2011, 11:16:38 pm »
Hey all
Thats my second project and i am really new in all this,i study c++ for hobby.

Now to my problem if you can help me with documentation or advices will be apreciated :D

i use SFML obviously and this for animation http://www.sfml-dev.org/wiki/en/sources/frame_anim_animated

i have an animation and i want to be able to click it with the mouse where ever will be.
for mouse click i use that :

Code: [Select]
if(events.Type == events.MouseButtonReleased && events.MouseButton.Button == sf::Mouse::Left)
        if((input.GetMouseX()>=Tr.x && input.GetMouseX()<=Bl.x) && (input.GetMouseX()>=Bl.y && input.GetMouseY()<=Bl.y))
        {
            App.Close(); // thats just for testing to see that if actually works,but it doesnt
        }


the coordination is right Tr stands for top right corner and Bl for bottom left

in main i have that

Code: [Select]
for(int loop=totalBalloons-1;loop>=0;loop--)
        {  
            BALLOONS[loop].Move(0,yAxis);
            topLeftCorner=BALLOONS[loop].GetPosition();
            bottomRightCorner.x=topLeftCorner.x+50;
            bottomRightCorner.y=topLeftCorner.y+65;
            App.Draw(BALLOONS[loop]);  
            BALLOONS[loop].Update();      
        }


i am almost sure that the problem is that the animations are inside vectors .

so they share things,any suggestions?
thanks for your time :D

Pages: [1]
anything