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

Pages: [1] 2
1
Network / Re: extending packet with queue
« on: November 19, 2015, 01:51:18 pm »
Thank you, I will read that.

2
Network / extending packet with queue
« on: November 18, 2015, 07:54:20 pm »
Hi brothers and sisters,

Im trying to make a game and for jobs Im using boost's spsc_queue class within sf::Packet class.

Im taking some errors (sometimes) while receiving different sized packets. I think I must tell to the spsc_queue the exact size of th Packet. But how can I do this?

3
General / Re: Mouse::setPosition problem with View
« on: October 07, 2015, 07:29:31 pm »
Very good idea. I write a minimal code and it worked fine. And then I looked my main code confidently and I noticed problem's source. Maybe. Actually I dont understand exactly why it did not work but I make little changes then it worked.

Thanks for everyone's attention.

4
General / Re: Mouse::setPosition problem with View
« on: October 07, 2015, 02:30:57 pm »
Hi again.
Ive prepeared a visual for problem.



The problem is object.position != Window.mapPixelToCoords(Mouse::getPosition(Window),Window.getView())

Or is this a problem?

How can I make this equality true?

5
General / Re: Mouse::setPosition problem with View
« on: October 06, 2015, 05:20:35 pm »
Yes I did.

6
General / Re: Mouse::setPosition problem with View
« on: October 06, 2015, 04:49:36 pm »
I dont know why but that doesnt work right for me.

7
General / Re: Mouse::setPosition problem with View
« on: October 06, 2015, 04:22:52 pm »
Thank you for trying to help and sorry if I cant explain my problem clear enough.
Now my only need is to know mouse cursor's world position.
Ive read tutorials about views but I have an idea that can do this and it doesnt work right. I have nothing else now.

8
General / Re: Mouse::setPosition problem with View
« on: October 06, 2015, 02:42:58 pm »
Difference between view and view position?

9
General / Re: Mouse::setPosition problem with View
« on: October 06, 2015, 02:02:46 pm »
Im trying to use mappixeltocoords function but there is promlwm still. Player's position is according to window's left-top corner. But when Im using mappixeltocoords function it gives me coords irrevelant from left-top corner. And I cant calculate righly.

How can I meet these two in same coordinate plane?

10
General / Re: Mouse::setPosition problem with View
« on: October 05, 2015, 06:49:45 pm »
The center of view is player's position. Player moves and then aim facility moves and mousecursor moves.
But when the player move out of Screen width or height, mousecursor overflows out of window.

I am confused about object's positions in window, view and screen.

11
General / Re: Mouse::setPosition problem with View
« on: October 05, 2015, 06:37:46 pm »
@SpectreNectar Thanks, I know that.

@eXpl0it3r Can you explain detailed?

12
General / Mouse::setPosition problem with View
« on: October 04, 2015, 03:07:51 pm »
Hi again brothers and sisters.

I have a problem while using Mouse::setPosition method in View.
My screen's height is 1080 pixel. And 0 to 1080 there is no problem. But -0 and 1080+ it stucks and doesn't change.

Im making a topdown shooter game and using mouse pointer as taking aim facility. So when player moves, then mouse pointer move too. And view following player's position.

Thanks for your help already.

edit: I tried using mapCoordsToPixel fucntion but I couldn't figure out it doesn't work right.

13
General / Re: MouseMoved event doesn't work in release mode
« on: September 05, 2015, 09:11:44 pm »
Thank you very much Hapax.
I was using sfml-2.2 includes but sfml-2.3 libs. I fixed this and there is no problem now.
Thanks for everyone's attention.

14
General / Re: MouseMoved event doesn't work in release mode
« on: September 05, 2015, 05:02:10 pm »
A new thing: When I scroll mousewheel, Left MouseButtonPressed works. Interesting.

15
General / Re: MouseMoved event doesn't work in release mode
« on: September 05, 2015, 04:58:29 pm »
I don't know what should I paste here exactly. But here are the events:

while(Window.pollEvent(event))
   {
      if(event.type==sf::Event::Closed)
         Window.close();

      if(event.type==sf::Event::KeyPressed)
      {
         if(event.key.code == sf::Keyboard::Escape)
            return 1;
      }
           
     
      if(event.type==sf::Event::MouseButtonPressed)
      {
         switch(event.mouseButton.button)
         {
         case sf::Mouse::Left:
            player.newBullet(new Pistol(player.position,sf::Vector2f(event.mouseButton.x,event.mouseButton.y),player.speed,player.radius));
            break;
         case sf::Mouse::Right:
            player.newBullet(new Shotgun(player.position,sf::Vector2f(event.mouseButton.x,event.mouseButton.y),player.speed,player.radius));
            break;
         }
         cout<<"button";
      }

      if(event.type==sf::Event::MouseMoved)
      {
         player.computeAim(sf::Vector2f(sf::Mouse::getPosition(Window)));
         cout<<"move";
      }
   }


And MouseButtonPressed event doesn't work too.

Pages: [1] 2