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

Pages: [1] 2 3
1
General / Re: Undrawing Sprites and Shapes
« on: July 19, 2012, 07:39:52 am »
Don't draw them :)
Have a bool or something, and when you don't want your sprites, set it false (or true..)

Example:
// your main loop
// stuff here...handling input etc
if (drawSprites == true) // if this is false, then obviously your program will 'skip' this part
{
   // draw your stuff here
}

Or something like this.

2
General discussions / How to make music/sound, easily?
« on: July 12, 2012, 06:02:46 pm »
Hello guys.

I know, that this question has nothing to do with SFML at all, so sorry about that.
I need a software for creating music. So far, I'm playing around with Rosegarden with the Musica Theora soundfont, which is nice and all, and if I click here and there, and press some buttons on my keyboard, I can generate some noise. In other words, it is not what I'm looking for. What I want is something really simple, and easy to use stuff, because I have no idea how to compose music.
This software should be really, really cheap, preferably for free (no trial, and shareware, and of course no illegal stuff), and I should be able to create some basic music in a matter of minutes, without any musical knowledge.

Also looking for something to create sound effects. Like explosions, shooting and so on.

Any suggestions ?

3
General discussions / Do you use C++11?
« on: March 10, 2012, 11:24:07 pm »
Dream in code C++ tutorial forum
There are some C++11 tutorials here. Like Nexus said, there are lots of them on the net.

I just found this It does not seem in-depth, by the way.

4
General discussions / Do you use C++11?
« on: March 10, 2012, 05:49:22 pm »
Quote from: "Nexus"
Quote from: "unranked86"
But I plan to learn the other features as well, but some of them aren't yet implemented in gcc 4.6.
Do you know which ones? On the internet, I only find tables that compare language feature support, not library features...



This is the closest thing I found...link
And it says:
Quote
This page describes the C++11 support in mainline GCC SVN, not in any particular release.


And this is the latest stable libstdc++ reference. I'm not sure, if I'm helpful :oops:

5
General discussions / Do you use C++11?
« on: March 10, 2012, 02:51:31 pm »
Yes, I am, and they are quite nice in my opinion :) I use the new pointers and bind(). But I plan to learn the other features as well, but some of them aren't yet implemented in gcc 4.6.

6
SFML projects / Game Develop : Free game development tool
« on: March 05, 2012, 09:25:59 am »
Quote from: "4ian"
Which version of Ubuntu are you using ?


Like I said earlier, I'm using Arch Linux, and my glibc version is 2.15-7, which, I assume, is newer than the one GD is using.

7
SFML projects / Game Develop : Free game development tool
« on: March 04, 2012, 08:55:35 am »
Well, this is something really nice and great project!

A few months ago I was looking for something like this, without any luck:(

I've tested it on Arch Linux, with wine (version 1.4-rc6). First when I tried to change the language to english it crashed. Other than that, seems to be working alright. Opening an example, and running it, works.

Then, I decided to give a try to the ubuntu version. Should anyone try to run it on Arch, you need libpng12, and libjpeg6. (they can be found in the archlinuxfr repo)

(Edit: Download the ubuntu package, and run:
Code: [Select]
$ lzma -d gdlinux.tar.lzma
You will get .tar file. Just extract it, and there you go.)

It starts, however it gives me this message:
Code: [Select]
Extension ./Extensions//Widgets.xgdle could not be loaded.
Contact the developer for more informations.

Detailed log:
./Extensions//Widgets.xgdle: undefined symbol: _ZNK12RuntimeScene8GetLayerESs

The file is there, so I don't know what's the problem...

Opening an example works, but when I try to run it, I get this:
Code: [Select]
Compilation of events failed, and scene cannot be previewed. Please report this problem to Game Develop's developer, joining this file:
/tmp/GDTemporaries/compilationErrors.txt


Contents of the file can be found here

Hope this helps you somehow.

edit2: It seems that this error has to do something with the libpthread. My glibc version is: 2.15-7

8
Graphics / Collision with FloatRect
« on: March 03, 2012, 02:43:21 pm »
I think, your collision class should take 2 FloatRects.
And instead of creating the rects "by hand" for your Sprites, take a look at Sprite.GetGlobalBounds

9
Graphics / Collision with FloatRect
« on: February 27, 2012, 09:53:49 am »
Why don't you use the Intersects(...) and Contains(...) functions of the sf::FloatRect class ? I guess, that's why they exist, you know, to make our lives easier. :)

10
Graphics / Collision with FloatRect
« on: February 24, 2012, 04:30:12 pm »
Well, I was "researching" (using google :) ) the very same thing, and in general, you have two options. Implement your own Quad-tree, or the grid-based collision detection. In my personal opinion, it all depends on your game, whether you want to use quad-trees or the grid. I mean, if you have a tile-map then the quad-tree seems a better choice.

11
Graphics / Performance :S
« on: February 21, 2012, 08:11:03 pm »
How do you use this in your actual game ? Do you construct the Background object once, and then just call Draw() or you construct it every frame (which is obviously wrong)?
What's in the "Functions.h" ?
Yes, maybe you have too much stars, try it with 100 or 200. Using sf::Shape's might be faster, so use them for this. In this case you can use list and vector aswell, so that's not an issue.

12
Graphics / Performance :S
« on: February 21, 2012, 06:37:33 pm »
Alright, then. I don't know why it's lagging, so I just post my similar implementation I did long ago.

Stars.hpp

Code: [Select]
#ifndef STARS_HPP
#define STARS_HPP

#include <SFML/Graphics.hpp>

#include <vector>

class Star
{
public:
Star (float x, float y);
~Star ();

void Draw (sf::RenderTarget& target) const;

private:
float mPosX;
float mPosY;
sf::Shape mCircle;

};

class StarManager
{
public:
StarManager (unsigned int width, unsigned int height);
~StarManager ();

void GenerateStars ();
void DrawStars (sf::RenderTarget& target);

private:
unsigned int mWidth;
unsigned int mHeight;
unsigned int mMaxStars;
std::vector<Star> Stars;

};

#endif


Stars.cpp
Code: [Select]
#include "Stars.hpp"

Star::Star (float x, float y):
mPosX(x),
mPosY(y)
{
mCircle = sf::Shape::Circle(mPosX, mPosY, 1, sf::Color::Yellow);
}

Star::~Star ()
{
}

void Star::Draw (sf::RenderTarget& target) const
{
target.Draw(mCircle);
}


StarManager::StarManager (unsigned int width, unsigned int height):
mWidth(width),
mHeight(height),
mMaxStars(200)
{
}

StarManager::~StarManager ()
{
Stars.clear();
}

void StarManager::GenerateStars ()
{
unsigned int lx;
unsigned int ly;

for (unsigned int i = 0; i != mMaxStars; ++i)
{
lx = sf::Randomizer::Random(0, mWidth);
ly = sf::Randomizer::Random(0, mHeight);

Star aStar(lx, ly);

Stars.push_back(aStar);
}
}

void StarManager::DrawStars (sf::RenderTarget& target)
{
std::vector<Star>::iterator iter;
for (iter = Stars.begin(); iter != Stars.end(); ++iter)
{
iter->Draw(target);
}
}


And here is how you use it:

Code: [Select]
StarManager smgr(400, 400); // (400, 400) is the width and height of the area, where the stars will be

smgr.GenerateStars();

// in your render code
smgr.DrawStars(mywindow); // mywindow is your sf::RenderWindow

It's old code, but should work without problems. Hope it helps.

13
Graphics / Performance :S
« on: February 21, 2012, 06:07:07 pm »
Don't get me wrong, but this code shouldn't run at all. You should get a segfault.

Don't use pointers. That's my advice. Avoid them as long as you can, and if you really need to use pointers, then use some smart pointer.
So, try to change your containers to <sf::Sprite>, <sf::Image> and <sf::Shape>, and remove your pointers in the constructor, and see what happens. By the way, why do you have a std::list<sf::Image> ? You don't even use it.

14
Graphics / Collision with FloatRect
« on: February 21, 2012, 05:22:58 pm »
When the boxes intersect, move the movable box back by 1 pixel.

15
General discussions / SFML and C++0x; "error: use of deleted function"
« on: November 03, 2011, 08:02:13 am »
Quote from: "Laurent"
Quote
I get a different error

Which is... ? ;)

And why are you still using std::mem_fun_ref if you have the almighty std::bind?
I can't try, but something like this should work:
Code: [Select]
for_each(ents.begin(), ents.end(), std::bind(&entity::update, _1));

for_each(ents.begin(), ents.end(), std::bind(&entity::draw, _1, std::ref(win)));


Thanks a lot, it compiles now :) Is there any beginner friendly documentation about the new features of C++? I can't find one. I checked the gcc one, but it's a bit hard for me to read.

I'm sorry, but I can't copy the error message :(

Pages: [1] 2 3
anything