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

Pages: 1 2 3 [4] 5
46
General / Re: I can't fix these linker errors!!!
« on: April 30, 2016, 04:45:26 am »
I'm not sure who wrote all of the SFML site documentation but its really a beautiful thing.  Everything is extremely clear, very difficult to find ambiguity compared to other sites.

47
General / Re: I can't fix these linker errors!!!
« on: April 29, 2016, 03:56:19 am »
Just at first glance, why are you combining static and non-static debug libraries?
And why are you combining static and non-static release libraries?

For Debug  you are using sfml-graphics-d.lib and not sfml-graphics-s-d.lib
For Release you are using sfml-graphics.lib and not sfml-graphics-s.lib


48
SFML website / Re: SFML on Google
« on: April 29, 2016, 02:58:21 am »
I also don't like when I search for "SFML forum" on google i always see this post
Yet you contribute to that post being in the top results by linking to it...

Good point.... I was hoping Google would leave the result out because I was disparaging their search engine :)

49
SFML projects / Re: Let's make 16 classic game in C++ video series
« on: April 28, 2016, 12:28:41 am »
This is an amazing display of talent to me, nice work.

50
SFML website / Re: SFML on Google
« on: April 28, 2016, 12:15:11 am »
Thanks.  I had the same question!

I also don't like when I search for "SFML forum" on google i always see this post

Well, SFML is annoying. - C++ Forum - Cplusplus.com

51
SFML projects / Re: Routing Game
« on: April 26, 2016, 06:38:29 am »
Looks nice!  I had no idea what xorshifting was until I started looking at your code.

I may try to run it later and provide more feedback! :)

52
General / Re: Player interaction
« on: April 23, 2016, 05:32:13 pm »
The next best step, in my opinion, would be to do more studying of C++ in general, and learning when variables go in and out of scope, how containers work, etc.

Its just my opinion that before you should attempt to manage game objects it might be helpful to practice creating a containers of basic C++ types like integers and how you would the use the language to add a new integer, for example, to a vector or other C++ container type.

Once you have this down for basic types the concepts can translate almost directly to more complex SFML types.

53
General / Re: Player interaction
« on: April 22, 2016, 05:54:44 am »
Hi lane,

I don't have any source code that does this now, but one solution I can think is to maintain a vector of Sprites using std::vector<sf::Sprite> or some container like that and then you need an update routine that will check your mouse actions.

If the mouse is within the coordinates of the existing sprite, and the user clicks the left mouse button, you make a temporary copy of the sprite and move its position with the mouse.  When the user releases the mouse button, that triggers an action to actually push an element into the Sprite vector at the position where the mouse was released.

If you aren't very comfortable yet with events and monitoring mouse click actions, I would experiment with a simpler detection of mouse clicking, button releasing, etc before trying to solve this exact issue.

54
General / Re: Proper way to use classes and user created files
« on: April 19, 2016, 05:50:54 am »
My advice would be to keep your window loop and objects in your main() function for now.

You should start learning classes by creating a class that has very little responsibility instead of managing your game window.  Over time, as you learn about classes you can make more complex classes and you'll have the confidence to let them do more complex things.

55
General / Re: Movement Issues
« on: April 19, 2016, 05:31:35 am »
Hi EpiQuerty,

In your main function, you are drawing the player once and then you start up a loop where you check for player input and then move the position of the player. 

The problem is moving the position of the player needs to be followed by another draw() function after you call PlayerInput().  This should be a different than DrawPlayer() since that's just an initial draw.

Drawing needs to happen once per loop iteration (actually a clear screen followed by a draw of the entities at their new positions).

Also I would take your PlayerInput() call out of the inner while loop, and move into the outer loop

int main()
{
    init();
    GraphicsInit(); //initialization functions. They just load some placeholder textures and stuff like that

    window.create(VideoMode(1024, 768), "Game Engine");
    window.clear(Color::Black);
    window.display();

    DrawPlayer();

    while (window.isOpen()) //main window loop
    {
        while (window.pollEvent(event)) //secondary window loop, polls for closing events
        {
            if (event.type == Event::Closed)
            {
                window.close();
            }
        }
       
        PlayerInput();
        NewDrawFunction();
    }
}
 

 

I hope this helps!

56
Graphics / Re: RectangleShape bug or user error?
« on: April 10, 2016, 10:12:33 pm »
Thank you both, I guess the confusion is that I was only "setting" the initial position and not calling "move" I thought it would be part of the local bounds.

I can work with this knowledge of how it works going forward.

57
Graphics / Re: RectangleShape bug or user error?
« on: April 10, 2016, 06:49:54 pm »
Hi,

I did read the documentation before posting but I was thinking that I did not translate, rotate, or scale the entity. 

Maybe I did in fact translate the entity because I called setPosition()?




58
Graphics / RectangleShape bug or user error?
« on: April 10, 2016, 06:28:16 am »
Hi,

I found something odd about RectangleShape that I'm not sure if I should report as a bug.

After calling setSize and setPosition (example below)

        sf::RectangleShape m_healthbar;

        m_healthbar.setSize(sf::Vector2f(m_bounding_box_width * .7f, m_bounding_box.getSize().y * .1f));
        m_healthbar.setPosition(m_xpos +
                (m_bounding_box_width * .025f) +
                (m_healthbar_label_text.getLocalBounds().width) +
                10
                , m_ypos + (m_bounding_box_height * .025f) + m_font_size + 5);

        auto dbx = m_healthbar.getPosition().x;         // This returns 1620.59998, which is what I want
        auto dby = m_healthbar.getPosition().y;         // This returns  151.00000, which is what I want
        auto dbl = m_healthbar.getLocalBounds();        // This returns left and top each as 0, seems wrong?
        auto dbg = m_healthbar.getGlobalBounds();       // This returns left as 1620.59998
                                                           //and top as 151.00000, which is perfect

 

I don't understand why getLocalBounds is returning left and top each as 0.  Later in the code I tried to use getLocalBounds to get the position of the shape and it didn't work because it was returning 0 for left and top.  After switching to getGlobalBounds it started working the way I wanted.

Thank you!

59
Hi,

In reply to Hapax, I'm building statically.

In reply to eXpl0it3r, you are correct and I was wrong, my program compiles fine if I move openal32.dll, but it won't run if I do that.  If I try to run "Using the local windows debugger from Visual Studio" after renaming the dll for example, it says "The program can't start because OpenAL32.dll is missing from your computer.  Try reinstalling the program to fix the problem."  When I put it back where it is now, in Visual Studio's working directory, the program runs fine even though the dll is not in the debug or release directory alongside the exe.

If I were to try to run the .exe OUTSIDE of Visual Studio though (Say from file explorer) I think you are correct, at that point the dll would need to be right next to the EXE along with my other game assets but for some reason within Visual Studio it looks somewhere else.

To make my Visual Studio directories as confusing as possible I accidentally named my Solution and Project the same thing so I have nested "Dark Ruins" directories.

Here's my actual directory structure within the top level Dark Ruins project directory.
Everything works fine when I run the debugger from inside Visual Studio.

C:\Users\Erdrick\Documents\Visual Studio 2015\Projects\Dark Ruins>tree /f
Folder PATH listing for volume Windows
Volume serial number is 2255-631E

│   contributors.txt
│   Dark Ruins.sdf
│   Dark Ruins.sln

├───Dark Ruins
│   │   20th_century_brown_vintage_paper.png
│   │   250773__ninafoletti__walks-on-stones.wav
│   │   Amarok-logo-small.png
│   │   arial.ttf
│   │   base_unit.png
│   │   constants.h
│   │   currency.png
│   │   Dark Ruins.vcxproj
│   │   Dark Ruins.vcxproj.filters
│   │   Dark Ruins.vcxproj.user
│   │   guild.cpp
│   │   guild.h
│   │   inventory.cpp
│   │   inventory.h
│   │   item.cpp
│   │   item.h
│   │   main.cpp
│   │   map.cpp
│   │   map.h
│   │   openal32.dll
│   │   reppin_fools_gold.wav
│   │   sandstone_floor0.png
│   │   test.txt
│   │   unit.cpp
│   │   unit.h
│   │
│   ├───Debug
│   │   │   Dark Ruins.Build.CppClean.log
│   │   │   Dark Ruins.log
│   │   │   inventory.obj
│   │   │   item.obj
│   │   │   main.obj
│   │   │   map.obj
│   │   │   unit.obj
│   │   │   vc140.idb
│   │   │   vc140.pdb
│   │   │
│   │   └───Dark Ruins.tlog
│   │           CL.command.1.tlog
│   │           CL.read.1.tlog
│   │           CL.write.1.tlog
│   │           Dark Ruins.lastbuildstate
│   │           link.command.1.tlog
│   │           link.read.1.tlog
│   │           link.write.1.tlog
│   │
│   ├───items
│   │       gold_sack.png
│   │       grey_gold_sack.png
│   │       no_item.png
│   │
│   ├───Release
│   │   │   Dark Ruins.Build.CppClean.log
│   │   │   Dark Ruins.log
│   │   │   guild.obj
│   │   │   inventory.obj
│   │   │   item.obj
│   │   │   main.obj
│   │   │   map.obj
│   │   │   unit.obj
│   │   │   vc140.pdb
│   │   │
│   │   └───Dark Ruins.tlog
│   │           CL.command.1.tlog
│   │           CL.read.1.tlog
│   │           CL.write.1.tlog
│   │           Dark Ruins.lastbuildstate
│   │           link.command.1.tlog
│   │           link.read.1.tlog
│   │           link.write.1.tlog
│   │
│   └───sounds
│           effect_fools_gold.wav

├───Debug
│       Dark Ruins.exe
│       Dark Ruins.ilk
│       Dark Ruins.pdb
│       SFML.pdb

└───Release
        Dark Ruins.exe
        Dark Ruins.iobj
        Dark Ruins.ipdb
        Dark Ruins.pdb

60
Thanks for your response.

openal32.dll is currently in my Visual Studio 2015 working directory (not next to my .exe yet) and the sound objects are working fine, its just the strange console warning that I couldn't understand.  It appears behind my game so I don't even notice it unless I alt-tab.

If I move it next to my .exe Visual Studio won't compile my program, it wants it in the working directory.

Pages: 1 2 3 [4] 5
anything