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

Pages: [1] 2 3 4
1
SFML projects / Re: randballs
« on: May 22, 2018, 08:26:32 pm »
Added new video ( updated in description ), simple quadtree detection and "collapse" and "cast away" functions!

I am going to add portals and obstacles in next updates, feel free to share a cool idea you like to see ;)

2
SFML projects / randballs
« on: May 19, 2018, 04:27:36 pm »
Hi guys !
I did this little playground and I will continue add features, as by now is pretty simple: Each ball randomly changes its color. On collision if they have the same color they merge, otherwise bounce.

It uses EnTT for entity management and all other engine classes are made by me ( Hope it could help someone ;) )

Link to source code

Updated video:


3
Graphics / Re: How protect the game's image files?
« on: November 08, 2016, 06:14:30 pm »
Maibe there exists a way to hide resources putting everything into one executable leaving only the data that will be modified like save game data.

You can do what you want but the moment you load the image on your ram that's the moment you lost the war.

5
Window / Re: handle input while window is in background
« on: June 29, 2013, 04:50:10 pm »
Quote
I belive that u can handle an event even if the window isnt focused ( something with "lostfocus" event ).
Nop, the OS never sends key events to unfocused windows, this would be unnatural (that's the whole point of having a focused window). The only way to receive keyboard events while unfocused is to call a very specific function, which is not implemented in the SFML API.

Out of curiosity, why do you need that?

ok gotcha, i have to find another way :)

I need to have this program running in background that can do usefull in-game macro like write pre-writed texts in game chat or save some key/mouse inputs and do it when u need and do a lot of similar things.

ty again for your time.

6
Window / Re: handle input while window is in background
« on: June 29, 2013, 02:44:28 pm »
uhm ok. I belive that u can handle an event even if the window isnt focused ( something with "lostfocus" event ).

np!! I'll use "iskeypressed" and I have to change a little bit of code.
ty all for your time.

b

7
Window / Re: handle input while window is in background
« on: June 29, 2013, 01:23:47 pm »
I already know about sf::Keyboard::isKeyPressed, but there is no way using events ?

8
Window / handle input while window is in background
« on: June 29, 2013, 12:29:21 pm »
hi all.

it is possible handle an input ( key press , mouse click  , and so so.. ) while sf::renderWindow is in background ?


with this code doesn't work

                sf::Event event;
                while ( window.pollEvent(event) )
                {
                        if ( event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::L  )
                        {
                              // do things
                        }
                }



it is work ony if window is focussed ! any idea ? ty in advance

C++ - sfml 2 -  visual studio 10 & 12 - OS: windows 7

9
SFML projects / Re: Ludum Dare 25 Entry - Grand Wreck Auto
« on: January 10, 2013, 11:20:21 pm »
great game !

10
Graphics / Re: [Isometric] dont draw correctly ( black lines ? )
« on: December 11, 2012, 05:03:37 pm »
solved by fixing image lenght

11
Graphics / [Isometric] dont draw correctly ( black lines ? )
« on: December 11, 2012, 02:33:55 pm »
Simple question:


I have my isometric map that i initialize in this mode:

        for (int i = 0; i < Xmapsize; i++)
                 for (int j = Ymapsize - 1; j >= 0; j--)
                 {
                        tile_map[i][j].setTexture(texture);
            float x = (j * tile_width / 2) + (i * tile_width / 2);
            float y = (i * tile_height / 2) - (j * tile_height / 2);

                        tile_map[i][j].setPosition(x,y);
                 }



and i draw it in the simplest mode possible:

                for (int i = 0; i < Xmapsize; i++)
                        for (int j = Ymapsize - 1; j >= 0; j--)
                                window.draw(tile_map[i][j]);



Any1 know why in my map there are some orrible black lines ?

This is the image:





Ty in advance!


some stuff: sfml 2, visual studio 10 , the error persist in debug n release mode

12
Graphics / Re: sf::FloatRect & performance
« on: November 23, 2012, 04:14:16 pm »
ty

13
Graphics / sf::FloatRect & performance
« on: November 23, 2012, 03:24:28 pm »
I have this code, in my draw function:

        view->setCenter(_player->getPosition());
        window.setView(*view);

        _map->draw(window,view->getViewport());


and in _map the draw  is

void TileMap::draw(sf::RenderWindow &window, const sf::FloatRect &_camerarect)
{
        unsigned int tilesdraw(0);
        for ( int i = 0; i< mapW ; i++ )
                for ( int j = 0; j<mapH; j++ )
                        if ( _camerarect.intersects(tiles[i][j]->getGlobalBounds()) )
                        {
                                window.draw(*tiles[i][j]);
                                tiledisegned++;
                        }
        std::cout<<"Tiles drawed: "<<tilesdraw<<std::endl;
}



I made that for draw only the tiles that are in the window, but its not work ( at least not draw anything ), any ideas whats I wrong?


sfml2, visual studio c++ 2010.

14
Window / Re: [sfml2]Mouse pos in 2d world! [SOLVED]
« on: October 25, 2012, 02:55:47 pm »
ty laurent :)

15
Window / Re: [sfml2]Mouse pos in 2d world!
« on: October 25, 2012, 02:48:47 pm »
mmm

i tried

                sf::Vector2i mousepos = sf::Mouse::getPosition(window);
                window.convertCoords(mousepos,window.getView());



and without window.getview() too, but still giving wrong coord.

Pages: [1] 2 3 4
anything