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

Pages: 1 ... 637 638 [639] 640 641 ... 720
9571
SFML wiki / Re: Tiled map with arrays
« on: September 25, 2012, 05:27:05 pm »
Ok, I've added include guards and made loop more eye-friendly.
Yeah I noticed, I was editing too. ;D

Anyways I've fixed the missing indentations and added the required includes, I hope I didn't miss any.

Btw for me it makes more sense to use *.hpp file endings, so it matches nicely with *.cpp and directly indicates the use of C++. ;)

9572
SFML wiki / Re: Tiled map with arrays
« on: September 25, 2012, 04:20:10 pm »
Nice! :)

What exactly is the reason for leaving out the include files & guards? ???

Also could you (or am I allowed to) format the main loop a bit better? I mean at the moment it's just a hugh block of code which seems quite hard to read. Or is there a reason why you don't insert spaces/break lines? ;)

So this
                while(app.pollEvent(eve))if(eve.type==sf::Event::Closed)app.close();
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q))cam.zoom(1.05f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::W))cam.move(0.f,-10.f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::E))cam.zoom(0.95f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))cam.move(-10.f,0.f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::S))cam.move(0.f,10.f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))cam.move(10.f,0.f);

Would turn into this
                while(app.pollEvent(eve))
                        if(eve.type==sf::Event::Closed)
                                app.close();
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::Q))
                        cam.zoom(1.05f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::W))
                        cam.move(0.f,-10.f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::E))
                        cam.zoom(0.95f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                        cam.move(-10.f,0.f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::S))
                        cam.move(0.f,10.f);
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                        cam.move(10.f,0.f);
Or at least add a space after the if-statement, so one can differentiat what is the check and what is the action with one look. :D

9573
General / Re: Ways to raise FPS
« on: September 25, 2012, 10:13:38 am »
Or use a profiler to fibd out where the application spends most of its time.
And as alteady pointed out never call a destructor manually, thos leads to undefined behavior.

9574
System / Re: Multithreaded loading screen
« on: September 24, 2012, 11:40:24 pm »
However, I found more interesting bug which I was debugging for ~2 hours. I found that you can't draw text using a default font in 1 thread while in second one work on text with the same font. What I was doing was displaying loading screen in main thread while in second load resources. When I used something like getLocalBounds() on a text (not the same text variable, just the same font - default one) in a second thread then font became damaged - some characters like 'I' were missing whenever I wanted to draw text with default font.
UB bugs are really hard to debug, it seems like index-out-of-bounds write so some character sprites are damaged(?) I don't know anything else that could do such thing. Maybe later I'll try to get minimal bug-reproducing code for this bug.
Doesn't really matter anymore, since the default font is removed in the latest commit. Also there have been many similar bug reports already (search in the forum), so you can check out the known issues on github. ;)

9575
Network / Re: klient-serwer game network
« on: September 24, 2012, 05:11:30 pm »
There are tutorials in for SFML 1.6 which can get applied easily to SFML 2. ;)

9576
General discussions / Re: [Idea/Request/Question] SFML platformer tutorial
« on: September 24, 2012, 04:12:58 pm »
You say you're sure that I didn't mean it this way, and yet you imply that I did. :) I've even explicitly mentioned an example and explained it.
Well you didn't mean it, but your request still asks for it (i.e. just because it sounds different in your head, it doesn't have to change its meaning). ;)

As I said, I'm quite familiar with it and am able to write apps and a simple game with an average code, however I'm not a professional, or probably not an advanced user.  :)
You won't really advance if you don't invest your time in reading and learning things, a tutorial will only be useful to some extend, but it won't help you really understand the principles so you'd be able to apply them on your own.
No offense, but I think about everyone that states he's familiar with C++ hasn't looked at it in depth. C++ is not just some for's and if's and classes, there's much more to it and the complexity is bigger than it might seem from the outside. If one claims to be a master in C++ then one also should be able to prove it. ;)
E.g. there are hobby programmers I know that are working with C++ for around 20years and yet still get to learn new stuff, but they're at a level where they don't let others spend hours on writing code for them, but sit down and do their research on their own.

I'm not wrong for me, everyone is different, therefore works different. Someone may have trouble even with thinking of a solid idea for a game. No offense meant.
You didn't get my point here. At the state where you are, things might look easy to implement but the hard part seems to be getting the idea into code. Believe me I've been there, but once you get to a level where you've seen behind the curtains you get to know that ideas that seem so easy are in fact quite complex and notice that the implementation is just a small part of the way to the goal.

Since I've explained that people work differently, an example in another language isn't a good point.  ;)
Why not? Since you claim to be quite familiar with C++ it should be easy to adapt some code from language X to C++ (this even excludes some esoteric stuff).

I don't even have the money to repair my computer, how do you think I could pay for something like this? You also seem to have missed where I said "and for other people like me," which means a public project to help people, just like the tutorials and wiki section of SFML. I don't think people get paid to write those, do they? :)
No I get what you meant, that the thing should be for the community and I never spoke out against this, but writing a complete platformer and document it to the extend that it could get used as a tutorial, is a job that can take many hours of freetime spread over several weeks and thus is quite a sacrifice to the person who does it. So if you want someone to spend so much time for you (and other readers) it would only be fair to pay him somehow. Free software is great but everyone has to life from something... ;)

I think handling collision would be a good implementation in the tile engine as well.
There are many, many, many tutorials on who to handle collision and there are even tutorials in the wiki section. If you can't connect the dots then programming can get very rough... ;)

9577
Graphics / Re: is it possible to subtract a texture from an other
« on: September 24, 2012, 12:59:48 pm »
I don't see where there are multiple 'lights' but congrats! ;)
Btw it crashes at exit on my PC.

9578
General discussions / Re: Comparison SFML vs SDL -> GUI and OGRE3D
« on: September 24, 2012, 10:17:07 am »
sdl : more advanced than sfml, it uses C, but it doesn't mean you can't write on C++, also you can attach any other library (C/C++)
I hope you didn't mean the last part just for SDL...
You can attach any other library to any other application too.

Additionally I don't really see how SDL is 'more advanced'. It's just more popular. Or did you mean the programmer has to be more advanced to be able to work with it? ;)

9579
General discussions / Re: [Idea/Request/Question] SFML platformer tutorial
« on: September 24, 2012, 08:54:18 am »
I'm sure you didn't mean it like this, but for me thos sounds quite like: 'Can someone write a platformer, which I can copy then, so I don't have to program it?'
I doubt that you're really that familiar with programming in C++, otherwise you'd understand the depth of such a task. ;)
I also think you're wrong with thinking that the hard part is to get the idea to code, the hard part is getting the idea to a mature level so that it's easy to implement. This does involve having a plan on how to structure the classes for the engine and how graphics and logic can be kept seperated, etc. If the idea isn't matured, then you can't really implement it and the trasition might seem impossible. ;)
As for the question itself, I'd bet quite a bit that you can find such a tutorial in some language on the internet and since the hard part is the planning and not the coding the general idea can easily get extracted and implemented with SFML.
If someone potentially would be willing & able to wrote such a thing, would you consider to pay him to some extended or should everything obviously happen  for free (i.e.  asking a half professional to write stuff over many many hours in his freetim for you for free)? ;)

9580
Window / Re: How do I get the dimensions of a window?
« on: September 24, 2012, 08:33:33 am »
Unlike SDL SFML uses a object oriented approach with C++ and avoids as much as possible global functions.  )

9581
Audio / Re: Music won't work at all
« on: September 23, 2012, 10:56:25 pm »
Hmmm, have you tried it with another file than OGG?

9582
Audio / Re: Music won't work at all
« on: September 23, 2012, 10:45:24 pm »
'Stupid' questions: Does your audio driver work? I mean can you listen to music with any other application? Or is the default device set wrongly? ;)

9583
General / Re: Window.input() or Mousemove event ?
« on: September 23, 2012, 03:16:52 pm »
I guess you're talking about a user defined cursor, i.e. sprite, right?
It's better to update it each iteration, but not with GetInput() because that's SFML 1.6, which you shouldn't use anymore. On SFML 1.6 hasn't been really worked on it for around 3years and SFML 2 has many many new features.
In SFML 2 you can use sf::Mouse::getPosition(), as described in this tutorial.

If you don't use a custom cursor then there's no reason at all to update the mouse... ;)

9584
General / Re: [linux] Dedicated server / run in Console
« on: September 23, 2012, 02:25:11 pm »
Well sfml-graphics depends on sfml-window, so I don't really see how you could've successfully build your application without linking against sfml-window.

You probably shouldn't create a second version, but refactor your original one and separate the logic fully from the graphic (e.g. by using the MVC pattern), so it would be very easy to drop the graphics part and just run the game as server... ;)

9585
Audio / Re: Best way to use Sound?
« on: September 23, 2012, 01:09:46 pm »
I will need shot sounds and maybe other little sounds too, but what's better, a single Sound instance which plays these little sounds when is needed -stopping the previous one if is necessary- or an instance for each type of sound: shot, attack, bird, ....
It depends on what you want to do. If there can be multiple sounds at once, then use multiple objects, otherwise one instance should be enough.

Ah btw, when I run my program, even if I dont declare any sound, any music or anything that relies to audio, I hear a continuous BEEE in my speakers :S
I guess that 'BEEE' is just a high pitched humming, right?
Some graphics card can produce such strange noises (somehow) when they are at their limits.
Try to use window.setFramerateLimit(60); or similar.

Pages: 1 ... 637 638 [639] 640 641 ... 720