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

Pages: [1] 2 3
1
General discussions / Re: Fully finished game with source code
« on: August 04, 2016, 10:12:39 am »
A small research would have led you there :
https://github.com/SFML/SFML-Game-Development-Book

2
Network / Re: TCP Connection
« on: August 02, 2016, 10:12:42 am »
Sorry but it's not clear. If every players send one message to the other player, each player will have one message to proceed. So no need to discard any ?

You can use one socket to send and recieve.

Anyway, if the problem is to only play one annimation at a time a simple boolean will be enough, but i'm sure i didn't understand your problem.

3
Network / Re: TCP Connection
« on: August 01, 2016, 02:56:45 pm »
Quote
Which one will be processed first, causing one user to get confirmation that their message went through first, before receiving the other user's message ?

You can't know which one will arrive first, but TCP provides mecanisms to assure that packets will arrive. Except if connexion is lost forever.

Quote
When the Internet connection is up again, how will these two messages be handled ?

After a certain amount of time (timeout) when a sender doesn't receive acquittement from the receiver, the sender simply resend the packet.

4
Window / Re: Render window and iterators / vectors
« on: July 20, 2016, 03:21:15 pm »
Add more precisions. What do you mean by "doesn't work" ?

You are using a std::vector and a button that hold a texture. Since using push_back from std::vector asume copying the object, do you handle it correctly ? How do you handle texture in general ?

Showing your implementation of the class Button can be usefull for us.

5
General / Re: Game menu
« on: July 07, 2016, 09:50:01 am »
Are you aware that there are multiple ways to develop functionality ? One will say your point of vue is right, another will say there is a better way to do it. Your question has thus no right answer.

What I can say, is that one of the most popular way to implement you game menu is the game state pattern :
http://gameprogrammingpatterns.com/state.html

7
Window / Re: [Question] Creating window, inside other window.
« on: May 27, 2016, 03:57:27 pm »
It seems it's not possible, even though it is an old post :

http://en.sfml-dev.org/forums/index.php?topic=2354.0

8
Graphics / Re: Vertex Array giving coluor to texture
« on: May 18, 2016, 09:56:33 am »
I don't exactly understand. Is it what it is shown in the sprite tutorial :

http://www.sfml-dev.org/tutorials/2.3/graphics-sprite.php

If so, it is probably possible to do it using vertex array, using this ?

http://www.sfml-dev.org/documentation/2.3.2/classsf_1_1Vertex.php#ad5943f2b3cbc64b6e714bb37ccaf4960

Or I don't understand what you asked.


9
General / Re: How To Better Optimize This Code?
« on: May 12, 2016, 09:35:54 am »
It's not an optimisation, but try to use defined values (variables for example) instead of random ones (ie: your "4"). Furthermore, if you suddenly want to change your 4 by something else, you need to modify 4 lines.

It'll be easier to read your code with "Player_Speed" than just "4".

10
General / Re: undefined reference with peculiar name
« on: May 11, 2016, 03:56:34 pm »
I found this using a google search with your error :
http://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line#19905704

May be not the problem though

11
Graphics / Re: Keyobard input lowers FPS and almost pauses the game
« on: May 02, 2016, 11:18:46 am »
Maybe your player->Walk() or this->editor->MoveMarker() isn't working correctly and takes too much time ?

12
SFML projects / Re: Let's make 16 classic game in C++ video series
« on: April 27, 2016, 11:17:42 am »
Put your sources on github or something similar, it'll be easier to watch. I don't want to download archives.

13
SFML provides a high level class to send data : sf::packet, you should check the official tutorial (and the others tutorials as well, it'll help you avoiding low level problematics) :

http://www.sfml-dev.org/tutorials/2.3/network-packet.php

It's easy to use, and you are sure to receive the whole packet at each time (ie: not a part of the packet) :

// on sending side
std::string header = "MyCommandHeaderCode";
double objectToSend = 0.6;

sf::Packet packet;
packet << header << objectToSend;

tcpSocket.send(packet);
 

//receiving sides

//You are sure to receive the whole packet : not a part, not more
tcpSocket.receive(packet);

std::string headerCode;
double data;

packet >> headerCode >>data;
 

14
Your question is clear, but I don't understand why you want to do this. Can't you simply read the data in a buffer to get the number ?

Looking at the doc, it doesn't seem like you can do what you exactly asked without reading it previously.

15
General / Re: Sprites inside a Class
« on: April 11, 2016, 05:40:32 pm »
I writed quickly, it's not syntaxic. I did provides some answers :

- Keep your texture as private member, for easy solution (but clearly not the best)
- Create a texture manager : https://www.google.fr/search?q=sfml+resource+manager&ie=utf-8&oe=utf-8&gws_rd=cr&ei=PcQLV5mrOYO6ateigcgN

If you think we will code for you, you are wrong. We can try to help "correct" your code :

In you class player, add a texture as private member instead of creating it in the function. This way, the texture will reamain untill the destruction of the player.

JayhawkZombie add a good base of what to do.

Pages: [1] 2 3
anything