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 - Tigre Pablito

Pages: 1 2 [3] 4 5 ... 15
General / Re: Collision by differentiating colors
« on: September 01, 2018, 12:56:18 am »
Hi Blingu
Hi Hapax

I have an idea about how to approach this, suppose the maze image is 800x600 and the player is 20x20, and suppose the players's Position is (posX, posY), then to know if the player has touched at least 1 pixel of the wall would be (Please someone translate to C++ - Thanks!)
(I think the function should be part of the player class, and recieve the maze image as an argument)

public bool CollideWithWall(Image image)
    int a, b;
    for (a = 0; a < 20; a++)
        for (b = 0; b< 20; b++)
            if (image.GetPixel(posX + a, posY + b) == wallColor) // define wallColor
                return true;
    return false;

The function above checks one by one all pixels from the maze Image that are occupied by the player, and returns true when it encounters the first (just one pixel is needed to collide). If it doesn't find anyone, then returns false.

We also suppose the player's Sprite's Origin has its default value (0, 0).

Finally, as I was taught in this Forums, there shouldn't be magic numbers in the code, so we can replace 800 and 600 by MAZE_WIDTH and MAZE_HEIGHT, and 20 and 20 by PLAYER_WIDTH and PLAYER_HEIGHT

Hope this helps

Graphics / How to draw in an Image?
« on: July 26, 2018, 10:26:01 pm »

Would someone have a good way or function for drawing a RectangleShape in an Image?

And an Image in another Image?

Thank you

(C# if possible please)

General / Re: My poor SFML games don't run on a specific PC
« on: July 26, 2018, 01:35:16 am »
Hi Laurent

I updated the device controllers or drivers through Windows control panel and now my game runs fine, so thanks

About the other issue, I was just trying to be funny ... it was not my intention to annoy anyone

Maybe my humor sense is not the best (and maybe my games are OK)

Though I think there are worse things than that, I'll try to be more serious in my posts

General / Re: My poor SFML games don't run on a specific PC
« on: July 16, 2018, 10:22:00 pm »
Hi dabbertorres

It is

NVIDIA GeForce 7025 / NVIDIA nForce 630a (Microsoft Corporation WDDM)

General / My poor SFML games don't run on a specific PC
« on: July 16, 2018, 07:03:33 pm »
Hello, Ladies and Guys

The system is

Windows 7 Ultimate 64 bit Service Pack 1

AMD Athlon II X2 245 processor 2.90 Ghz  2.0 GB RAM

I'm using SFML.Net 2.2

When trying to run from the VC# IDE it crashes on every Draw() call ...

Thanks for any help

General / Re: player-wall collision in game
« on: July 01, 2018, 05:14:34 am »

I agree with you that Hapax's first option is the best (for this case at least)

What I would suggest is to add into the main loop (maybe in the players update() function), (instead of the code you showed), something like this:

while (collideLeft())
while (collideRight())
while (collideUp())
while (collideDown())

You would have to define the 4 functions

If you (that it seems) make the player move by 'walkSpeed' pixels, then it may happen that you get stuck into the wall by more than 1 pixel, that's why the code above loops: *) nothing, if you haven't hit a wall, *) or, until you are at 0 pixels from it if you have (for the 4 possible ways ... you can put each one with the code that moves the player on its own direction, for higher performance)

Feature requests / Re: Better gamepad support
« on: June 10, 2018, 05:30:22 am »
Although, yes, I must agree that this feature request, better gamepad support has to do with a multimedia library

Feature requests / Re: Better gamepad support
« on: June 10, 2018, 05:24:23 am »
I'd like to add gamepad support for my game, is there some place I can found something already written ?

I can help but please, don't debate endlessly if it should be included or not in SFML, most likely it should. If SDL did something, it's probably for a good reason, it's worth for SFML to take inspiration from it.

Hi Phanoo

I don't know why, it seems that you like SDL more than SFML. As far as I know, nobody is forcing you to stay in SFML if you like SDL more. It is completely up to you to decide where you are

I have played the game Ach Ball (and it's good), but soon it will be launched the game Break Balls, that took inspiration in your posts with hard arguing on feature requests that have nothing to do with a multimedia library and comparisons between SFML and SDL and prompting people to switch to SDL

Unless that you are staying in SFML for charity, if SDL suits you best, you are free to switch wherever you want, so as others are, plus they donĀ“t need to be given directives about where to switch to or stay in

This is SFML and "there is what there is" (HAY LO QUE HAY, in Spanish). Actually I started in SDL and switched to SFML, but everyone is free to go/switch/stay wherever he/she wants to. But when I switched to SFML I did not make a mess and a movement in the SDL mailing list.


DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 29, 2018, 02:03:49 am »
Yes, it's very improbable that the window loses focus, you're right, maybe only by an appearing window that asks you to buy further antivirus protection. For those very few cases what I'll do is handling the LostFocus event with a game pause function. Thanks for your replies.

DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 24, 2018, 03:50:05 am »
My first problem is solved, that is, when my poor games start, the window automatically gains focus ...

But what about if it lost focus while the game is running? ... I have to click on the screen ... also it is a bit annoying that a window appears or for some reason the game window loses focus

So it would be very nice that comes the SetFocus() function for SFML.Net to be able to regain focus when it's lost (I saw there is a LostFocus event, that would be used with it) ... If I understood well it will be added to next .Net update ... I hope so

DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 23, 2018, 01:45:24 pm »
No, RequestFocus doesn't focus the window, it just request you to focus it, flashing its icon in the task bar with a yellow tone, like when you're debugging your app with Visual Studio and it stops at an exception.

I just was able to get the window focused when creating it (when the game starts), by changing the app target type.

But there isn't any SetFocus() function in SFML.Net for now. That would be useful in case the app loses focus while the game is running. So let's wait for SFML.Net update  :)

DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 23, 2018, 03:30:52 am »
Hi Laurent

I already found the way to solve the issue of focus stolen when the game starts. My apps were of console type, and then the console box stole focus to the window. Now I changed to Windows application and it starts focused.

However, if the window lose the focus, it seems (for SFML.Net) it isn't possible to regain it from the code. As you said, we'll have to wait for the .Net update. (I searched the setFocus() function and there isn't. Rarely, there are RequestFocus(), that works fine, and another I don't remember)

I hope the SFML.Net update comes soon  :D


DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 22, 2018, 07:21:43 pm »
Hello eXpl0it3r

If the function for focussing the window is not SetActive() I suppose the code example with it won't help us too much to solve the issue  ;D

If you could tell me which is the function that really does, it would be very nice and then if it fails, I will make the code example. Thank you!  :)

DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 22, 2018, 03:48:24 pm »
the issue about setting the window active (RenderWindow.SetActive() method)
What issue?

When my poor games start, I have to click on the screen, if not, they don't respond to events (keyboard, etc). So I call window.SetActive(); but it seems it does nothing. So what I would need is a way to prescind of clicking on the screen to activate it. Maybe I'm wrong and that is not the function I have to call.

Hi Ladies and Guys

I would like to know if sometime the issue of setting window active or focussed and the one about Music loop points will be fixed/added to SFML.Net.

And, once again, I'll give an opinion: I don't think threats are the way for asking for something. Even less, that granting the requested thing is a way to respond a threat or a push. Clippboard support, as Laurent said from the beggining of that thread, has nothing to do with a multimedia library. But because of the push of some members, one of those that prompted others to switch to SDL, it seems that "feature request" has been started to develop/add to SFML. I wonder when the developer(s) and the SFML Team will stop fearing these kind of movements and characters, and just continue doing what they do the best (the multimedia library, SFML). I anyone wants to switch to SDL or whatever it was, then GO to SDL or where they want if they like it more. Nobody is forced to stay in SFML if he/she likes SDL more. But, as I saw, that member doesn't seem to think that SDL is better. I say this with no intention to offend anyone.

But why I say this? Because there are issues that really have to do with a multimedia library, such as the ones I mention here, that don't bring threats and are not too difficult to do. And, obviously, because I actually think that if someone(s) say(s): "Do this, or I will go to another place", I would reply "Go to another place". Other case would be if someone say "Would you please do this? (And thanks for what you have already done)".


Pages: 1 2 [3] 4 5 ... 15