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 ... 3 4 [5] 6 7 ... 15
61
So, the menu flickering actually occurs on the other computer even when it's not capturing?
Yes, it does. On any more powerful CPU (3 or 3.5 GHz).
Today I also made a change on the main loops, I did something like a distribution. So maybe it won't occur any more. I  would have to check it out.
The one suggestion I can think of for this is to make certain that you are only calling display on the window once per frame/loop (and at least once per loop); it's possible that it's the result of flipping the buffer more than required (or not when required).

Remember, each cycle/loop/frame should have one clear, any number of draw calls, and one display.

Well, Hapax, so finally I have solved this tedious issue, thanks you  :). In addition to having distributed the main menu, the option screen, and the game itself, each one into a class, instead of having tricky nested loops, today I learnt something very important: the Display() method does not destroy the contents of its previous call, so it's necesary to call Clear(), not only if you need to paint the screen ( window.Clear(Color.Blue) ). Also, I feel that I guess that this overload of the RenderWindow object (by displaying and not clearing) was the cause of the memory access violation exception that occured often, even when quiting the program.

Then, to the improvements I have been doing these days, now I add the fix of the menu screen flickering issue (the fixes were uploaded). So, thank you very much.  ;D

62
Feature requests / Re: Protected Asset Support
« on: March 03, 2018, 11:59:54 pm »
Hello

https://www.dropbox.com/sh/8bx9skafhqoxue0/AABOoDpeg3_pU3KxIyzAC4BLa?dl=0

The link brings you an application that packs a folder and all its subfolders with all their files into a file. You have to enter the "root" folder and the target file's full path. If both strings are always the same every time you update your data file, you can create a TXT file which contains both strings in one each lines and browse that file by clicking the "Read from TXT" button, what is easier than typing the strings.

In your game or program, you would have to include the class LoadData that is in the C# file included in the folder. Maybe needs translation to C++ (be careful with data types' sizes).

First you need to instanciate the class passing the data file's full path (or relative). To "open" a file you need to call GetFileContent() function passing the folder full path (from the very very root, i.e. C:\\) and assign it to byte[] array that then you pass to the media (Music, Image, etc) you want to load.

I know it could be improved much. But it works fine. Actually, in my poor Super Mario Game.

Regards
Pablo


63
Feature requests / Music Loop Points
« on: March 03, 2018, 10:26:18 pm »
Hello Ladies and Guys

Not so long time ago, I asked if there was a way to play a Music, but from the 2nd loop, to restart it from a certain offset from the beginning (that someone called it "Loop points"). And I remember that I was told that that would be coming with the next version of SFML (or something similar).

I would like to know it it already has been added or when it will be. (for SFML.Net)

I think (and repeat what I already said on that moment) that if the SFML Community members, try to ask for reasonable features (accordind to a multimedia library, that is what SFML is, not a file packer nor an object dropper container and so on ...) and we express ourselves with respect, not questioning Laurent (or whoever it is) by comparing SFML with SDL (like implying that SDL is better (that is NOT)), or saying something like "Laurent, you are hiding some bad code and want to keep it hidden" and that silly stuff (that I read on that moment and remember almost literal), then features that would be really important and really related to a multimedia library (and that are not so easy to develop oneself) would be added faster, and with that, we also might find more features (according) to ask for, and would have more facilities to develop our videogames and or multimedia stuff.

Thanks
Regards
Pablo

64
Hi Lukaius!

Looks great!! Gratz! ;D

Thanks!

Hi Hapax!

Yes, the bomb I think in the first video at approximately 0:50. Suggestions would be flashing slower (not alternating each frame), a single 'flash' that lasts a bit longer and maybe also affect the sprites and not just the background. Also, the flash should probably fade in and out. Definitely out (out should probably be slower too). You could also consider not using full bright white too - maybe just an off-white; it could just increase the brightness/gamma of everything a bit instead of overlaying/replacing it with a solid colour.

I took a time to (try to) fix the issue about the bomb. So I managed, when throwing the bomb, to make the enemy ships get some flashing, and the lightning some special effect (for which I used the Image alpha channel). Anyway, maybe I'll keep on trying to improve that.
Thanks for the idea!

So, the menu flickering actually occurs on the other computer even when it's not capturing?

Yes, it does. On any more powerful CPU (3 or 3.5 GHz).
Today I also made a change on the main loops, I did something like a distribution. So maybe it won't occur any more. I  would have to check it out.

Hi Bitano!

Sure. It's not mine though. I googled it.

Thanks! I'll use it.

65
Hi Bitano!

Very nice looking game!

Thanks!

Can i suggest a simple change to get rid of that background image 'tear'? If you mirror the previous version of the image when scrolling up, the background image will appear more natural. I think that's a quick win.  ;D

Yes, of course you can.  ;D I already fixed that. A very quick win.

See attachment

Thanks again! May I steal that nice image?   ;)

Hi Hapax!

Looks pretty well done. The white flashes, though, are the worst thing ever! :P

Thanks!
With "the white flashes" you mean when you throw the bomb? (It it is, what do you suggest?  :) ) Or you reffer to the menu screen issue?

The beginning of the video (during the menu) seems to show two frames at once (well, alternating). Is this just the capture that did this? I found my captures started to do this recently. :(

Yes, in my notebook, it doesn't happen that flashing. But in other more powerful machines, such as my friend's with which I made the videos, actually I see that issue. And I can't figure out why this occurs. But I'll continue squeezing my brains.  8)

Thank you both for the feedback!  :)


66
Hello Ladies and Guys of SFML Community

So this time I continued working on this poor game. Also, as I was advised before, I made gameplay videos, which are here. There are now 8 levels, visual effects have been improved, there are new ships, and better music (that make the .rar's size a bit greater).

Although the game works fine, I plan to continue working on it.

As always, I would appreciate criticism, advise for improving, or any feedback.

As you will guess, some graphics were made by me, and some others were not. Yeah, I am not an artist (feel free to beat me because of that!).

Video
https://youtu.be/kVUZ-HJnaSc

Video
https://youtu.be/3JO623asOhs

Video
https://youtu.be/uJY6WhteHvU

Game download link
https://www.dropbox.com/s/3wy14x0jrgpaen7/Massacre%20A%20Poor%202D%20Space%20Shooter.rar?dl=0

Regards
Pablo

67
General / RenderWindow.Display() crashing my poor game in an old PC
« on: February 21, 2018, 07:03:01 pm »
Hi Ladies and Guys of SFML

I'm trying to run my poor Space Shooter game in a PC from about 2003, written in C# with SFML.Net 2.0. The system is Windows XP. AMD 1.5GHz, 1,18 GB RAM  8)

A few days ago it ran fine. But I just added some improvements to the application, and it suddenly started to crash while debugging, with no error nor exception message, but always the highlighted line was window.Display();  :-\

I don't think that posting the code will help, because there is no essential changes from the before code.

May be an out of memory error?

I will thank any help  :D


68
SFML projects / Re: Random game
« on: February 16, 2018, 02:49:36 am »
Hi!

I ran the game. Once again, very good! (I didn't see the code in detail yet)

An "issue" ... Why the screen measures like that? The height is greater than the width and than the physical screen height. Wouldn't be much better (and easier to play) to use something like 800x600?

69
SFML projects / Re: Flappy-Bird Clone Attempt
« on: February 12, 2018, 01:28:28 am »
Hi! Thank you very much for the explanation! (and for moving to a very simpler IDE)

Now I was able to do everything correctly and to run the game.  :D

Though it's a bit simple, it's very good. (My highest score was 6) And well done. (I suppose, though I'm not a C++ programmer, because I ran the game with no runtime errors, and because I looked at the code)

A few items I would suggest to improve:
* First of all, to tidy up the code (i.e. the target of an if statement goes beneath, and one statement per line). This is good for others who read the code, and for you to keep tidy and enlarge the game.
* Maybe it's better to pass the app object to the Bird and Obstacles objects when you create them, as you pass the Bird object to the Obstacles ones, so then the call to first.draw(); and so would be tidier.
* To use more functions (and maybe classes, and files) instead of writting all inside the main function. This also helps for readability and maintaining and enlarging the game.

Something that has nothing to do with programming itself, you could add keyboard input. And that the bird's flap is milder. I felt like that when I released the mouse button the hang was greater and greater. I´m not sure, but it may be a conceptual issue in the movement() and leftClick() functions.

Having said that, thanks again for your help in the set up. And congrats for the game. It's very good for a begginer.  :)


70
SFML projects / Re: Flappy-Bird Clone Attempt
« on: February 10, 2018, 11:50:40 pm »
I wasn't able to run the app, it's a mess for me to set up the CodeBlocks IDE, given that I'm a boy used to the simplicity of Visual Studio and SFML.Net. My listening (and talking) is not so good as my reading (and writting), that's why the tutorial video didn't help me much. But I would like to run the game. Could someone tell me where to READ the instructions to make that IDE work? Thanks

71
SFML projects / Re: Flappy-Bird Clone Attempt
« on: January 31, 2018, 04:26:38 pm »
Could you Powereleven or someone tell me what's the trick here? I attach the screenshot of the error window
Thanks in advance

72
SFML projects / Re: Flappy-Bird Clone Attempt
« on: January 29, 2018, 04:05:30 am »
Could you tell me what version of VC++ and SFML should I use to run the Bird game? I really tried, downloaded Visual Studio 14 (C++) and SFML 2.4.2 and I can't build the app, there are linker errors, so it could be that is a wrong version. I think it would be interesting to run the game.
Thanks

73
SFML projects / Re: Flappy-Bird Clone Attempt
« on: January 27, 2018, 04:06:13 am »
Well, I didn't see (or realize) you were implementing 2 views. Anyway, as the RenderWindow object (app) is the same, independently of what function it is passed to, I think it would be better to pass it as a parameter in the constructor (the function that creates the object - I don't know exactly how it is in C++). That's because you just pass that var (app, bird, etc) ONCE, and then you can simply access it from anywhere in the class without extra parameter adding in every internal class function. But ... you don't call a var ... you call a function ... you pass the var as a parameter (in this case)  ;)

class Obstacle
{
    private int x, y;
    private Bird bird;
    private RenderWindow app;
    // other variables

    // pass the Bird and RenderWindow references so you can use them directly in the class
    public Obstacle(int x, int y, Bird bird, RenderWindow app)     
    {
        this.x = x; this.y = y;
        this.bird = bird;     // assign the Bird reference to a class var through you can access that object
        this.app = app;     // the same for the RenderWindow
        // other assignments
    }

    public void Draw()  // here you don't need to pass the bird, app, etc, as a parameter
    {
        if (Collision(this, this.bird) {    // this.bird contains the Bird object reference
            // do something ;

            // other stuff

            this.app.Draw(obstacleTexture);   // this.app contains the RenderWindow object reference
        }
    }
}

Regarding to the program model, I think that even the smallest ones would be more easier to make (read, understand, ...) if you try to organize it acording to the common practices ... it would be easier to develop for you, and easier to read and understand to other people

I'll try to see the entire code to give my view better  ;D

74
SFML projects / Re: Flappy-Bird Clone Attempt
« on: January 27, 2018, 01:20:45 am »
I was just seeing the main.cpp file. Actually, how much complicated is C++! How courageous have to be programmers who use it!

In a while I'll try to see all the project files in a C++ IDE when I'm at home. But a couple of things now:
1) the app object (of type RenderWindow) should also be passed as an argument to the constructors of all objects that need it instead of being passed to all functions. That would be better performance and tidier code.
2) I think it would be better to define a Game class which declares the bird and obstacle objects (and letters and all other stuff), with a RunGame() method (or function). That is, for the main() function isn't so untidy. You also could create a class for the group of Obstacles (with a List or Vector to store them), to make it more efficient, and check the collision bird-obstacle one by one (in a loop, not to pass the 3 obstacles and the bird to a same function).
Usually, while more you group the game components into objects, better and tidier will be the code.



75
SFML projects / Re: Flappy-Bird Clone Attempt
« on: January 25, 2018, 09:16:25 pm »
You can see the code below that shows how an object can access (read and write) another object.

You just need to add a class attribute of the type Bird in all the enemies and every class that needs to access it. In the constructor you add a parameter of that type, and when you create an enemy object you pass as last argument a reference to the Bird object. Then you can simply read from or write to that variable. You don't need to pass it to the enemy class internal methods because it is a class global variable, visible in all the class. The attributes of the Bird that need to be accessed have to be public or as a property (or the way that C++ implements for a variable to be accessed outside its class). Remember that in C++ the syntax for references and pointers is a bit complicated, it's not as in C#, so the code I write here is not C++, but the idea is OK. You should just change the syntax

You also can see this mechanism in this game, my smallest one (it's written in C#, but the concept is the same)

https://www.dropbox.com/s/qf5rpk4zlid8l6d/PAC-MAN%20Folder.rar?dl=0


class Enemy
{
    private Bird player;
    private int x, y;
    // other vars

    public Enemy(int x, int y, Bird player)
    {
        this.x = x;
        this.y = y;    
        this.player = player;

        // other vars
    }

    public void Draw()    // or Update()
    {
        if (this.y < player.y)  // read from the player's reference (or address)
            ;  // the bird is under the enemy

        if (Collision())  // define Collision()
            player.life = 0;   // write to the player through its address (then the Bird should know that to do)

        if (IsHitByBird())  // define IsHitByBird()
            this.life = 0;      // you killed the enemy

        // do other stuff ( like move )
    }
}

 

Please let me know if it works

Pages: 1 ... 3 4 [5] 6 7 ... 15