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

Pages: 1 ... 7 8 [9] 10 11 ... 13
121
SFML projects / Open Source 2d shooter
« on: June 12, 2010, 04:45:57 am »
That's pretty hectic :)

Haven't looked at source or Lua stuff yet.

Are you going to do some more work on the artwork and perhaps polish up the GUI?

May I suggest cleaning out the bin and obj folders to get a smaller download? Also, is the main executable a debug mode one? Using release mode should get it considerably smaller.

One (two) more thing! It crashes when I exit (memory at (address) referenced by (address) could not be "read") and the window lets me resize and maximise.

122
General discussions / SFML 2 API documentation online
« on: June 12, 2010, 04:30:49 am »
Yay! I was just planning to move to SFML2 anyway, this should ease the transition a bit.

Also,
Quote from: "Nexus"
Just out of curiosity, are you going to update the web documentation every time you change a part of the API? Or should we rather run Doxygen at ourselves if we need the newest version?


Cheers :)

123
Feature requests / LAME MP3 support
« on: June 12, 2010, 04:28:47 am »
Perhaps a useful suggestion would be that if ogg vorbis is not up to the standard of what you are doing then you should use a lossless codec instead? FLAC comes to mind.

I don't like listening to or creating music compressed to any lossy format, personally. I prefer Ogg Vorbis over MP3 due it's freeness and openness.

124
General / Checking if something is near you with SFML
« on: June 07, 2010, 04:27:03 am »
If you have your objects in an appropriate container (http://cplusplus.com/reference/stl/ - vectors are probably the simplest to learn), you can just for loop through it.

object would be your vector of objects
Code: [Select]
for (int i = 0; i < object.size(); i++)
{
    //if object is lower than 20 pixels above the player and is higher than the player...
    if (object[i].getY > playerY - 20 && object[i].getY < playerY)
    {
        //object must be one unit above the player
    {
    //check other sides
}


It's more than likely that you will need something more complex than that, but it's the basic idea. Bear in mind that this if condition will be true any time the object is in the row above the player, you will have to cross check it with X(columns) for a proper result.

Might I suggest using square tiles/objects/player for simplicity?

rogue**

125
General / Collision Detection
« on: June 02, 2010, 03:42:48 am »
Of course it's possible!

Some people use Box2D with SFML. It would be overkill for most roguelikes though. I don't know what experience you've had before SFML, but adding a physics (simulation) engine to your project is a fair bit of work and just increases the complexity and time it will take to finish.

There's a pretty good collision detection class in the wiki - http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection

Most roguelikes don't even need that level of collision detection - they just need to check if the player is on the same tile as an item or next to an enemy.

If you wanted a physics engine just for cool effects or something though, sorry for ranting :lol:

126
General discussions / Can I use SFML like this?
« on: June 01, 2010, 05:39:46 am »
I can't really help with using g++ from the command line, sorry. I have done it before but always end up using Code::Blocks. Why not try C::B on your mac?

127
General discussions / Passing a render window to a class?
« on: June 01, 2010, 05:35:00 am »
I believe this is known as passing by reference. Could be that it's not though... ;)

Anyway, it works:

Code: [Select]
void CLASS::draw(sf::RenderWindow &target)
{
    target.Draw(sprite);
}



To call it:

Code: [Select]
class.draw(App);

Obviously, you might not be doing this for a drawing routine, but you should be able to see how it works.

128
General discussions / Can I use SFML like this?
« on: June 01, 2010, 02:51:49 am »
1 - Yes.

2 - Probably. From my understanding, vi isn't a full IDE and you must be compiling on the command line? If so just look up how to link to libraries with g++. If vi is a full IDE, replace 'g++' in my last sentence with 'vi'  :lol:

I hope that's all right. I don't know much about macs.

Isn't Swing/AWT a full GUI package?

129
Audio / Loading Audio
« on: May 30, 2010, 01:48:36 pm »
I load all my sounds at level initialisation. As for your example, it's personal preference really. I would prefer to have it stopped, and only start playing it when you are nearly close enough to hear it. I think that's a cleaner approach than having it looping at zero volume. It doesn't seem much more difficult to code either.

130
Graphics / How to display framerate and make some inputs
« on: May 30, 2010, 01:40:21 pm »
1 - There are many ways to do this. I like using stringstreams, it makes me feel cool.

Code: [Select]
std::stringstream ss;
ss << "FPS: " << FPS;//FPS being your framerate int/float/whatever
std::string str = ss.str();


You can then use SetText(str) or could probably go straight from the stringstream to sf::String. Note that stringstream needs you to include <sstream>

2 - SFML doesn't have built in support for text boxes exactly. As you said you could use one of the GUI projects, but I find that over kill for most things. I usually just use the TextEntered event.

Here's an example, complete with working backspace!

Code: [Select]
std::string inputString;
if (Event.Type == sf::Event::TextEntered)
{
    char c = Event.Text.Unicode;

    if (c == 8)//8 is backspace
    {
        if (inputString.size() > 0)//check that there is something to delete
        {
            inputString.erase(inputString.end() - 1);//delete the last character
        }
    }
    else if (c < 128 && c > 31)//pretty much anything you want should be between 31 and 128
    {
            inputString.push_back(c);
    }
}

sf::String whatever;
whatever.SetText(inputString);


Hope that was of help!

131
General / stupid errors :(
« on: May 29, 2010, 04:06:41 pm »
It's a linking issue. Read the "Getting started" tutorial for the relevant IDE - they cover setting up the linker.

132
Graphics / SFML sprits and images
« on: May 29, 2010, 04:03:25 pm »
As far as the DLL errors go, with most IDEs, by default, you must have the DLLs in the same directory as the project file to run the program FROM THE IDE. If you want to run an .exe directly, the DLLs must be in the same folder as the .exe

133
General discussions / SFML and c++ or sfml only
« on: May 28, 2010, 02:02:07 pm »
SFML is what's known as a library. http://en.wikipedia.org/wiki/Library_%28computing%29

You need to make a program in a language that SFML (the 'L' is for Library) supports.

C++ is a common choice and a good one too, but most people will recommend something else for a beginner. You could try Python. SFML for Python has just been updated to the latest version (1.6).

SFML also supports .Net languages as well as C, D and Ruby, but I'd give the last three a miss.

Whatever your choice, get atleast a little bit familiar with the language and then check out the tutorials page.

134
General / Using SFML with Windows API
« on: May 26, 2010, 02:04:31 am »
http://www.sfml-dev.org/tutorials/1.6/graphics-win32.php

??

You could also use the .NET API and use Visual C# or Visual BASIC.

If you have no reason for windows specifically, may I suggest using Qt or wxWidgets?

135
General / Problem decompressing SFML 1.6 tar in Ubuntu 10.04
« on: May 18, 2010, 05:26:18 am »
I just installed 10.04, downloaded and installed SFML1.6 and it worked first go about a week ago.

Pages: 1 ... 7 8 [9] 10 11 ... 13
anything