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 - ntrncx

Pages: [1]
1
General / how to create a grid?
« on: November 22, 2011, 06:34:28 pm »
stupid me i got confused without reason
i did this
Code: [Select]

for(int x=0;x<800;x+=30)
    {
        for(int y=0;y<600;y+=45)
        {      
            testSprite.SetPosition(x,y);
            App.Draw(testSprite);
        }  
    }


why it blinks like crazy?this code is out of the game loop;[/code]
just to test and understand how it works.but why it blinks?

2
General / how to create a grid?
« on: November 22, 2011, 11:02:51 am »
well i did watched them,i already made 2 small games. but they say the basics,i want to study and read about it,but i need the start.the logic,i don't want code or "ready solution",

if you can describe by words would be helpful :D or link of a tutorial will be appreciated

3
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

4
General / mouse click on moving animation problem
« on: November 22, 2011, 01:00:28 am »
yes Tl means that,thanks a lot i solved the problem

what i did wrong wast hat the following code was inside a function
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
        }


i put it out and worked as a charm :D

and thanks a lot for the observation about the repeating code,i try to learn :D[/code]

5
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]