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

Pages: 1 2 3 [4] 5 6
46
Vm does not work so well as far as I am concerned. The render window displays only a black square on Linux hosts win7 virtualized via virtual box)

47
General / Re: Game structure help
« on: May 11, 2014, 07:45:38 am »
Basically my renderservice will gather the objects that need to be drawn and then draw their sprite. Damn this is a long topic for a really simple and basic answer

By looking at your class diagram (which looks quite good to me), i wonder why don't you store your vector of game related objects into the "LevelState" class, then your "RenderService" class will access this vector by reference, iterating over each element, and getting the sprite to be drawn from it ?

This operation that consists of copying the sprites stored in your game related objects seems over complicated to me. I strongly advise that you forget about it.

Linking what i say to your former code from the previous post, i think you should store "DisplayObject" class instances (or ptr/smart ptr to them)  into a vector, and not "Sprite", then iterate over this vector of "DisplayObject" and finally get the sprite from it when you call "RenderWindow::draw".


48
Audio / Re: Is there a problem with sf::Music::pause ?
« on: May 11, 2014, 07:28:13 am »
Have you tried with sf::Sound?

#include <iostream>
#include <SFML/Audio.hpp>

int main()
{
    sf::SoundBuffer buffer;
    if (!buffer.loadFromFile("music.ogg"))
        return -1;

    sf::Sound sound;

    sound.setBuffer(buffer);

    sound.play();

    sound.pause();
    std::cout << sound.getStatus();
    if(sound.getStatus()!= sf::Sound::Paused)
    {
        std::cout << "Problem ?" << std::endl;
    }
    else
    {
        std::cout << "OK" << std::endl;
    }

    return 0;
}

Output :

1OK

I'm using SFML-2.1 release (not any snapshot from github)

49
Audio / Is there a problem with sf::Music::pause ?
« on: May 10, 2014, 09:01:47 pm »
Hi,
am i misreading something in the documentation or there is a problem here ? (found nothing in the forum with getStatus keyword nor in the github bugtracker).


#include <iostream>
#include <SFML/Audio.hpp>

int main()
{
    sf::Music music;
    if (!music.openFromFile("music.ogg"))
        return -1; // error

    music.play();

    music.pause();

    std::cout << music.getStatus();
    if(music.getStatus()!= sf::Music::Paused)
    {
        std::cout << "Problem ?" << std::endl;
    }
    else
    {
        std::cout << "OK" << std::endl;
    }

return 0;
// or loop ..
}

Output :

2Problem ?

Using mingw 4.7, linking statically to SFML.

Thank you for the help.

50
General / Re: Game structure help
« on: May 10, 2014, 08:12:34 pm »

but we don't need to update sprite 3 or 5.


just do it, even if the containing object hasn't changed, you are most likely to kill your game performance with the collision detection (for instance) than with the updating of each sprite during each loop turn.

51
Damned my game isn't on the news, that's a shame !  :'(

52
SFML projects / Re: Witch Blast (dungeon crawl shooter)
« on: May 02, 2014, 08:29:15 am »
Quote
... but I haven't figured out how to make the sprite sheet ...

Most of free sprites resources you may find (or even do) are individual images you have to put together into a unique big image. Those individual images must be separated by the same amount of pixel in order to simplify your frames animations.

For that task i use Montage which is super simple, use the no background option to keep alpha channel for transparent background.

http://www.imagemagick.org/Usage/montage/

53
SFML projects / Re: Tanks !
« on: April 29, 2014, 09:30:32 pm »
New release :

After a little session of profiling, i cleaned the code from the most costly operations.

54
SFML projects / Re: Tanks !
« on: April 28, 2014, 08:51:40 pm »
New version available:

Added scenes stack, rendering on texture and shaders to the engine.
Added menu to the game using those features.
New musics (using ogg format for better compression).
Foes now spawn out of the screen and stop near the player.
Joystick is enabled but it doesn't work well on windows (though you can tweak buttons assignation numbers from conf file).

55
SFML projects / Re: Adventure platform game Penisator
« on: April 22, 2014, 07:39:50 pm »
Very nice !

56
SFML projects / Re: Tanks !
« on: April 13, 2014, 07:09:46 pm »
Funny little game :)

Thank you ! I'm glad you tried and enjoyed it, thank you for your feedback, here are my answers :

Quote
Sometimes the enemies spawn almost inside or directly behind the player, where you have no chance to evade. Don't you want to let them enter from the border of the screen?

Well i don't know, i see what you mean but i like the effect of surprise and this behavior adds some "luck" parameter to your final score, which is good in any game (skills+a touch of luck = success)

EDIT : spawning enemies outside the window add a little extra immersion i like it !

Quote
There's a bug when you stand still: an enemy tank drives over you and is too close to hit you.

Yes i think i have to stop the enemy before he reaches the player.

Quote
At the moment, you can keep firing all the time. There should be a motivation to limit the fire, for example ammo supply that needs time to reload (so you can fire 5 projectiles, but then have to wait some time), or health that regenerates while you're not firing.

Interesting, i've been thinking about dropping bonuses and ammo crates at a random pace, however it complicates the game's balance.

Quote
I agree that 8 directions limit the gameplay, as you cannot really aim.
I guess i will have to implement mouse+keyboard control and analogic joypad too.

Quote
The smoke could be focused in front of the tank.
I'll make some tests as it shouldn't take long.

Quote
It would be nice to restart directly after game over.
Yeah, i have to add a menu in any case, with a start button and replay button, it should be a nice addition to my little engine as i need to implement a sort of scenes stack (lifo) before i do the gui, there's some work to do in that area and i don't know if i'll be able to do it.

Quote
By the way, you should rather use unique_ptr instead of shared_ptr, unless you have a good reason for the latter :P

You are right, i was not aware of unique_ptr existence. After a short analysis, it needs to be used with temporary entities as i call them in my engine because the main rendering class is the only one to own those entities (from instantiation to destruction).

I must say that i am a bit disappointed about the documentation i found about smart pointers (and c++ in general) on the internet, i do not mean reference websites as i mostly don't care about methods listing and short examples, i'm talking about good, complete, clear and fresh litterature on those cutting edges subjects.

Quote
(My highscore was 32)
Congratulations, most of my friends do an average of 30 points.

57
SFML projects / Re: Tanks !
« on: April 13, 2014, 11:13:02 am »
38 points is my best score so far (with default configuration)

58
SFML projects / Re: Tanks !
« on: April 13, 2014, 11:09:25 am »
New version available

Changelog:

Changed memory management (shared_ptr instead of raw pointers)
Grassy background.
Muzzle flashes, impacts and trails particles added.
Centered window at start.

Have fun.

59
SFML projects / Re: Tanks !
« on: April 10, 2014, 07:21:07 pm »
There's no danger, you have this message because it is a self signed certificate i could make a valid certificate but i don't want to provide the personal information the authority is asking for.

The binary is safe too, you can build the game yourself if you want as i'am providing the source code within the zip archive.

The game works fine on wine as far as i know.

I've discovered at least a memory leak in the game so, i think i'm going for raii in the next version because i'm starting to be fed up with those memory management problems.

60
SFML projects / Re: Tanks !
« on: April 08, 2014, 10:48:32 pm »
By the way you can modify the game's configuration so that red tanks become blue and green tank becomes red (if you're a communist you'd prefer playing a red tank yeah i get that) or run faster.

Make sure you keep aside a backup config before making the game unplayable.

Here's the animation.xml for red vs blue like the old days c&c red alert.

<animations>
        <animation name="joueur_stop" duration="1">
                <frame left="0" top="32" width="32" height="32"/>
        </animation>
        <animation name="joueur_run" duration="1000000">
                <frame left="0" top="32" width="32" height="32"/>
                <frame left="32" top="32" width="32" height="32"/>
                <frame left="64" top="32" width="32" height="32"/>
                <frame left="96" top="32" width="32" height="32"/>
                <frame left="128" top="32" width="32" height="32"/>
                <frame left="160" top="32" width="32" height="32"/>
                <frame left="192" top="32" width="32" height="32"/>
                <frame left="224" top="32" width="32" height="32"/>
        </animation>
        <animation name="ennemi_stop" duration="1">
                <frame left="0" top="96" width="32" height="32"/>
        </animation>
        <animation name="ennemi_run" duration="1000000">
                <frame left="0" top="96" width="32" height="32"/>
                <frame left="32" top="96" width="32" height="32"/>
                <frame left="64" top="96" width="32" height="32"/>
                <frame left="96" top="96" width="32" height="32"/>
                <frame left="128" top="96" width="32" height="32"/>
                <frame left="160" top="96" width="32" height="32"/>
                <frame left="192" top="96" width="32" height="32"/>
                <frame left="224" top="96" width="32" height="32"/>
        </animation>
        <animation name="bullet_fire" duration="1">
                <frame left="180" top="117" width="16" height="17"/>
        </animation>
        <animation name="fire_smoke" duration="1000000">
                <frame left="0" top="560" width="130" height="90"/>
                <frame left="130" top="560" width="130" height="90"/>
                <frame left="260" top="560" width="130" height="90"/>
                <frame left="390" top="560" width="130" height="90"/>
                <frame left="520" top="560" width="130" height="90"/>
                <frame left="650" top="560" width="130" height="90"/>
        </animation>
        <animation name="explosion" duration="750000">
                <frame left="0" top="0" width="64" height="64"/>
                <frame left="64" top="0" width="64" height="64"/>
                <frame left="128" top="0" width="64" height="64"/>
                <frame left="192" top="0" width="64" height="64"/>
                <frame left="0" top="64" width="64" height="64"/>
                <frame left="64" top="64" width="64" height="64"/>
                <frame left="128" top="64" width="64" height="64"/>
                <frame left="192" top="64" width="64" height="64"/>
                <frame left="0" top="128" width="64" height="64"/>
                <frame left="64" top="128" width="64" height="64"/>
                <frame left="128" top="128" width="64" height="64"/>
                <frame left="192" top="128" width="64" height="64"/>
                <frame left="0" top="192" width="64" height="64"/>
                <frame left="64" top="192" width="64" height="64"/>
                <frame left="128" top="192" width="64" height="64"/>
                <frame left="192" top="192" width="64" height="64"/>
        </animation>
</animations>
 

Pages: 1 2 3 [4] 5 6