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

Pages: 1 [2] 3 4
16
General / Re: Making Consistent Physics with Delta Time
« on: July 02, 2014, 08:30:36 am »
void Player::update(sf::Time deltaTime)
{
        ..
}

float Player::jump(sf::Time deltaTime)
{
        ...
}
 

Do yourself a favor and use a constant reference for your delta-time parameter, like so
void Player::update(const sf::Time &deltaTime)
{
        ..
}

float Player::jump(const sf::Time &deltaTime)
{
        ...
}
 
Your code as it is right now, may not effect the delta-time. But if you don't plan to ever modify the delta-time, a constant reference will be a good thing to do for extra safety against the human race and better efficiency in terms of memory usage :)

17
Graphics / Re: Dynamic Tile Map
« on: June 30, 2014, 12:57:36 pm »
it's not the magical solution to everything.
It would be great if there was such a solution.

18
Graphics / Re: Checking if vertices come in contact?
« on: June 30, 2014, 12:51:46 pm »
took me about 15 seconds to find an article about circle and triangle collision detection on google :) here you go:

http://www.phatcode.net/articles.php?id=459

19
Graphics / Re: SFML Game Development, Movement
« on: June 30, 2014, 09:02:32 am »
That makes no difference....  :P
For this code/project it may not do any difference. But the includes should be inside the guards.

20
SFML projects / Re: Squeak
« on: June 29, 2014, 05:15:23 pm »
I wasn't aware that there was much interest in it, let alone interest in using it for more than just personal convenience. Unfortunately, I have no idea how to make a static library but I'll certainly be looking into it. This is all about learning, after all :)
Well static libraries is a lot easier to make. So don't worry if you think it will be hard to learn :)

21
SFML projects / Re: Squeak
« on: June 29, 2014, 01:39:25 pm »
You should really make it possible for people to use this as a static library. I would never use this if I had to transport a .dll file with my project just for these cursor helpers.

22
SFML projects / Re: Scrapping and learning
« on: June 29, 2014, 01:31:13 pm »
Well. You could start by using the window module :)

23
Network / Re: Online Highscore TCP or HTTP
« on: June 24, 2014, 02:37:48 pm »
Time checking against what?
Well make some kind og algorithm that checks if the request is actually possible for one to do. If the same score request comes two times in a row. Thats suspicious, but actually possible. But the same score within 1 minute, well thats should not be possible (of course this depends on what game it is). I would use sessions to control this.

Also I would send a time value in the HASH that well check if the time of the request is okay. I know this will be really hard because of internet latency. But if we said the time just had to be within the set timeout on the server.

24
Network / Re: Online Highscore TCP or HTTP
« on: June 24, 2014, 02:06:19 pm »
As for securing for replay do some IP checking and time checking.
For the private/secret key, I would make a function that manipulates the key before it'll be used and delete the manipulated key from memory right after. I know this will not be totally secure, but it will be harder for the hacker to pull the key out.

And guys, please correct me if I'm wrong and if what I suggests can't be done. I'm just throwing out some ideas from the top of my head. But ye, if the hacker is skilled enough I guess mostly everything can be hacked.

25
Network / Re: Online Highscore TCP or HTTP
« on: June 24, 2014, 01:26:41 pm »
About security, I think it's useless to implement a complex system... You can crack it anyways, except the way exploiter described, but I think this would be an overkill...  :-\

AlexAUT
Trust me, Laurent suggestion is the right way to go. As a professional web developer I use this approach alot across different API's. Actually it's the most common way to secure a payment gateway from being hijacked.

Before one can crack your system, one will need to know your secret key. And for type of HASH, go with a SHA-2 hash and then you'll be good to go :-)

But you can expand this approach alot. You could reverse the whole HASH and so on to make it more difficult for one to understand what you're doing in your code.

26
Graphics / Re: Texture apply in a 3D environment with SFML
« on: June 24, 2014, 12:59:36 pm »
ok I get it, but i just have another small issue, my object is drawn with Triangles and my texture is applying itself the wrong you if you see what i mean, if i put a picture i will see twice the same side on both triangles of a same face instead of the full pictures :/

Actually i still have this small problem if i want to put a picture, the top of the picture is in the middle of my object ...
Could you provide me a screenshot explaining your problem?

27
Graphics / Re: Texture apply in a 3D environment with SFML
« on: June 24, 2014, 12:22:27 pm »
Hmm, I was wrong when telling you that UV coordinates only goes from 0.f to 1.f.
But if you write 128.f then the texture will actually repeat 128 times - only if the texture settings is set the right way. But as I remember the sf::Texture has these paremeters set the right way for that :)

28
Graphics / Re: Texture apply in a 3D environment with SFML
« on: June 24, 2014, 12:14:52 pm »
std::vector<GLfloat> texture_default = {
        0.0f, 0.0f,  
                // Top-left
        0.0f, 128.0f,  
                 // Top-right
        128.0f, 0.0f,  
                 // Bottom-right
        128.0f, 128.0f,
                // Bottom-left

};

There is your problem. UV coordinates only goes from 0.f to 1.f.
So if your image is 128 pixels width and you want the full width, you don't type 128.f, but 1.f :)

If you only want the half of 128 pixels (64 pixels) then your need to put in 0.5f.

29
Graphics / Re: Texture apply in a 3D environment with SFML
« on: June 24, 2014, 12:04:44 pm »
Sounds like your texture/UV coordinates is the problem.

30
General / Re: Problem with rendering (SFML2.1, OOP + <vector>)
« on: June 24, 2014, 11:52:13 am »
I don't know how to use enums yet, in this project i don't want to use them. I'll try to learn them during the holidays, so most probably after this project.
I may comfort you with that it only takes about 5 minutes to learn  :D
Enum is just a way to make an integer human-readable.

Pages: 1 [2] 3 4
anything