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.


Topics - StormWingDelta

Pages: 1 2 [3] 4
31
General / I forget how big of a Borderless Map can SFML Handle?
« on: April 02, 2014, 06:07:00 am »
Just wondering since I'm planning a game that needs and endless map or as endless as I can get it anyways.  Also forgot what classes let this be doable as well. :)


That aside hopefully once I get what I need up and running there won't be as many questions leaving feeling dumber than I am.  ::)

32
DotNet / Totally blanked on a few things and need some help
« on: April 02, 2014, 05:33:03 am »
Totally spaced on how to setup a few things.  I'm working on a game and was trying to remember the setup for a game loop when using SFML.  Can't quite remember the syntax in SFML.net's case. >.>  Got everything else setup just stumped.

33
DotNet / Error while trying to add SFML.net 2.1 to VS 2012 project
« on: April 01, 2014, 03:48:59 am »
Had this error at school and now at home. Can someone help me make it go away?  Trying to get all the files needed included and no clue how to do this for the .net version of SFML.

For some annoying reason it won't let me ref the csfml dlls. But yet whines about them not being around when I include the .net ones and it tries to find them.  ???


34
Yes I haven't been around in ages and got really into C# while I was away.  Was wondering what I needed to download and/or build and where from to get SFML working with C#.


I see the C++ download for SFML but I'm clueless on the .net version unless it is a simple rebuild or the same thing.

Meantime also saw a few topics on issues getting setup the rest of the way floating around so I might hunt through those.  If someone wants to bash me upside the head with a book have fun.  :P

Also wondering how much of the tutorial code would be useful to look at for the .net version and what changes between them I should worry about?  ???

That aside nice to be back and finally remember this place. :)

35
General / Needing help with object manager.
« on: October 28, 2012, 09:45:59 pm »
The first one here is a version of Serapth's Game From Scratch tutorial.


Would be nice to put in std::unique_ptr but unsure how to an where.

GameObjectManager.h
#pragma once
#include "VisibleGameObject.h"
//#include "SFML/Graphics.hpp"


class GameObjectManager
{
public:
        GameObjectManager();
        ~GameObjectManager();

        void Add(std::string name, VisibleGameObject* gameObject);
        void Remove(std::string name);
        unsigned int GetObjectCount();
        VisibleGameObject* Get(std::string name);

        void DrawAll(sf::RenderWindow& renderWindow);
        void UpdateAll();

private:
        std::map<std::string, VisibleGameObject*> _gameObjects;

        struct GameObjectDeallocator
        {
                void operator()(const std::pair<std::string,VisibleGameObject*> & p) const
                {
                        delete p.second;
                }
        };
};
 


GameObjectManager.cpp
#include "stdafx.h"
#include "GameObjectManager.h"
#include "Game.h"
#include <memory>

GameObjectManager::GameObjectManager()
{
}

GameObjectManager::~GameObjectManager()
{
        std::for_each(_gameObjects.begin(),_gameObjects.end(),GameObjectDeallocator());
}

void GameObjectManager::Add(std::string name, VisibleGameObject* gameObject)
{
        _gameObjects.insert(std::pair<std::string,VisibleGameObject*>(name,gameObject));
}

void GameObjectManager::Remove(std::string name)
{
        std::map<std::string, VisibleGameObject*>::iterator results = _gameObjects.find(name);
        if(results != _gameObjects.end() )
        {
                delete results->second;
                //std::unique_ptr<VisibleGameObject*> temp(results->second); //Have no clue how to use this for here???????
                _gameObjects.erase(results);
        }
}

VisibleGameObject* GameObjectManager::Get(std::string name)
{
        std::map<std::string, VisibleGameObject*>::const_iterator results = _gameObjects.find(name);
        if(results == _gameObjects.end() )
        {
                return NULL;
        }
        else
        {
                return results->second;
        }
}

unsigned int GameObjectManager::GetObjectCount()
{
        return _gameObjects.size();
}


void GameObjectManager::DrawAll(sf::RenderWindow& renderWindow)
{

        std::map<std::string,VisibleGameObject*>::iterator itr = _gameObjects.begin();
        while(itr != _gameObjects.end())
        {
                itr->second->Draw(renderWindow);
                itr++;
        }
}

void GameObjectManager::UpdateAll()
{
        std::map<std::string,VisibleGameObject*>::iterator itr = _gameObjects.begin();
        float timeDelta = Game::GetWindow().GetFrameTime();

        while(itr != _gameObjects.end())
        {
                itr->second->Update(timeDelta);
                itr++;
        }
       
}
 

Meanwhile this next one is something I was working on but couldn't get some annoying error to go away in.
Was trying to see if vector was any better but I'm having issues scanning through the list and getting things by anything other than a number.
BaseObjectManager.h
#pragma once
#include <vector>
#include <string>
#include "BlankSprite.h"


class BaseObjectManager
{
public:
        BaseObjectManager();
        ~BaseObjectManager();

        //void AddSprite(BlankSprite &s);
        void AddSprite(BlankSprite *s);
        //void AddSprite(BlankSprite s);

        //void RemoveSprite(BlankSprite &s);
        void RemoveSprite(BlankSprite *s);
        void RemoveSprite(std::string name);
        void RemoveSprite(int element);
        void RemoveDeadSprites();
        void ClearAllSprites();
       
        BlankSprite *getSpriteByPtr(std::string name);
        BlankSprite &getSpriteByRef(std::string name);
        BlankSprite getSpriteCopy(std::string name);

        unsigned int getSpriteListSize();

protected:

private:
        std::vector<BlankSprite*> spriteList;
        //std::vector<std::unique_ptr<BlankSprite*>> spriteList;

};
 

BaseObjectManager.cpp
#include "StdAfx.h"
#include "BaseObjectManager.h"
#include <iostream>

BaseObjectManager::BaseObjectManager()
{
}


BaseObjectManager::~BaseObjectManager()
{

}

/*void BaseObjectManager::AddSprite(BlankSprite &s)
{
        spriteList.push_back(s);
}*/

void BaseObjectManager::AddSprite(BlankSprite *s)
{
        spriteList.push_back(s);
}
/*void BaseObjectManager::AddSprite(BlankSprite s)
{
        spriteList.push_back(s);
}*/


/*void BaseObjectManager::RemoveSprite(BlankSprite &s)
{

}*/

void BaseObjectManager::RemoveSprite(BlankSprite *s)
{
        //meant to remove a sprite by its pointer
}
void BaseObjectManager::RemoveSprite(std::string name)
{
        //meant to remove a sprite by its name
        std::vector<BlankSprite*>::iterator scanList;
        unsigned int i = 0;
        for(scanList = spriteList.begin(); scanList != spriteList.end(); scanList++)
        {
                //BlankSprite hold = spriteList.at( std::distance(spriteList.begin(),scanList));
                if(i < (spriteList.size() -1))
                {
                        if(spriteList.at(i)->getName().compare(name) == 0)
                        {
                                spriteList.erase(spriteList.begin() + i);
                        }
                        else
                        {
                                std::cout << "No sprite with this name exists!" << std::endl;
                        }
                }
                i++;
        }
       
}
void BaseObjectManager::RemoveSprite(int element)
{
        spriteList.erase(spriteList.begin() + element);
}
void BaseObjectManager::ClearAllSprites()
{
        spriteList.clear();
}
void BaseObjectManager::RemoveDeadSprites()
{
        std::vector<BlankSprite*>::iterator scanList;
        unsigned int i = 0;
        for(scanList = spriteList.begin(); scanList != spriteList.end(); scanList++)
        {
                //BlankSprite hold = spriteList.at( std::distance(spriteList.begin(),scanList));
                if(i < (spriteList.size() -1))
                {
                        if(spriteList.at(i)->getDead() == true)
                        {
                                spriteList.erase(spriteList.begin() + i);
                                //spriteList.pop_back(spriteList.at(i));
                        }
                        else
                        {
                                //std::cout << "No sprite with this name exists!" << std::endl;
                                continue;
                        }
                }
                i++;
        }
}

BlankSprite *BaseObjectManager::getSpriteByPtr(std::string name)
{
       
        std::vector<BlankSprite*>::iterator scanList;
        unsigned int i = 0;
        for(scanList = spriteList.begin(); scanList != spriteList.end(); scanList++ )
        {
                //BlankSprite hold = spriteList.at( std::distance(spriteList.begin(),scanList));
                if(i < (spriteList.size() -1) )
                {
                        if(spriteList.at(i)->getName().compare(name) == 0)
                        {
                                return spriteList.at(i);
                        }
                        else
                        {
                                //std::cout << "No sprite with this name exists!" << std::endl;
                                //return nullptr;
                                continue;
                        }
                }
                i++;


        }
}
/*
BlankSprite &BaseObjectManager::getSpriteByRef(std::string name)
{

}
BlankSprite BaseObjectManager::getSpriteCopy(std::string name)
{

}*/

unsigned int BaseObjectManager::getSpriteListSize()
{
        return spriteList.size();
}
 

I keep getting some annoying excpetion error anytime I try to use the methods meant for targeting a specific sprite/object. 

Any ideas?  I know I'm missing something but can't pin down what.

36
General / Hmm Where to start up again I wonder.
« on: October 26, 2012, 07:32:23 pm »
It's been a while since programming in C/C++ and I still have the sprite/object manager from my the pong game I was working on.



Also found a nice idea for a game to use it for but first I want to see if anyone can spot any issues with it before I go and build up a new game.

Yes this code is in SFML1.6 Couldn't find my SFML2.0RC version of it after changing computers.
Here's the header File of it.
#pragma once
#include "VisibleGameObject.h"
#include "SFML/Graphics.hpp"


class GameObjectManager
{
public:
        GameObjectManager();
        ~GameObjectManager();

        void Add(std::string name, VisibleGameObject* gameObject);
        void Remove(std::string name);
        int GetObjectCount() const;
        VisibleGameObject* Get(std::string name) const;

        void DrawAll(sf::RenderWindow& renderWindow);
        void UpdateAll();

private:
        std::map<std::string, VisibleGameObject*> _gameObjects;

        struct GameObjectDeallocator
        {
                void operator()(const std::pair<std::string,VisibleGameObject*> & p) const
                {
                        delete p.second;
                }
        };
};
 
Here's the Source File

#include "stdafx.h"
#include "GameObjectManager.h"
#include "Game.h"


GameObjectManager::GameObjectManager()
{
}

GameObjectManager::~GameObjectManager()
{
        std::for_each(_gameObjects.begin(),_gameObjects.end(),GameObjectDeallocator());
}

void GameObjectManager::Add(std::string name, VisibleGameObject* gameObject)
{
        _gameObjects.insert(std::pair<std::string,VisibleGameObject*>(name,gameObject));
}

void GameObjectManager::Remove(std::string name)
{
        std::map<std::string, VisibleGameObject*>::iterator results = _gameObjects.find(name);
        if(results != _gameObjects.end() )
        {
                delete results->second;
                _gameObjects.erase(results);
        }
}

VisibleGameObject* GameObjectManager::Get(std::string name) const
{
        std::map<std::string, VisibleGameObject*>::const_iterator results = _gameObjects.find(name);
        if(results == _gameObjects.end() )
                return NULL;
        return results->second;
       
}

int GameObjectManager::GetObjectCount() const
{
        return _gameObjects.size();
}


void GameObjectManager::DrawAll(sf::RenderWindow& renderWindow)
{

        std::map<std::string,VisibleGameObject*>::const_iterator itr = _gameObjects.begin();
        while(itr != _gameObjects.end())
        {
                itr->second->Draw(renderWindow);
                itr++;
        }
}

void GameObjectManager::UpdateAll()
{
        std::map<std::string,VisibleGameObject*>::const_iterator itr = _gameObjects.begin();
        float timeDelta = Game::GetWindow().GetFrameTime();

        while(itr != _gameObjects.end())
        {
                itr->second->Update(timeDelta);
                itr++;
        }
       
}
 

I could include the rest of the connecting file for the project if needed.

37
General / Vector Drawing lib?
« on: August 30, 2012, 04:38:05 am »
Just asking since last I heard SFML didn't support Vector drawing. Anyone know of any of the libs here or elsewhere that can do this?

38
Window / About using sf::View for changing the viewport position.
« on: August 30, 2012, 04:35:42 am »
I'm just wondering what one of the two functions to use since it seems move and set center seem to both move the viewport but they have two different effects.


Anyone have any ideas for this since I'm working on a game that takes advantage of a map with no borders?

39
My computer doesn't like shaders for some reason but tries to run the games anyways. Also a few of the newer games in the projects section aren't working for some reason.

:(

40
-------------- Build: Debug in SFML2RCTesting ---------------

Linking console executable: bin\Debug\SFML2RCTesting.exe
obj\Debug\main.o: In function `main':
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:10: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:10: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKSsjRKNS_15ContextSettingsE'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:11: undefined reference to `_imp___ZN2sf4Font14getDefaultFontEv'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:11: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:10: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:11: undefined reference to `_imp___ZN2sf4TextC1ERKNS_6StringERKNS_4FontEj'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:19: undefined reference to `_imp___ZN2sf6Window5closeEv'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:16: undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:22: undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:22: undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:24: undefined reference to `_imp___ZN2sf6Window7displayEv'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:13: undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:27: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
D:/Documents/CodeBlocksWork/SFML2RCTesting/main.cpp:27: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
obj\Debug\main.o: In function `~Drawable':
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Drawable.hpp:52: undefined reference to `_imp___ZTVN2sf8DrawableE'
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Drawable.hpp:52: undefined reference to `_imp___ZTVN2sf8DrawableE'
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Drawable.hpp:52: undefined reference to `_imp___ZTVN2sf8DrawableE'
obj\Debug\main.o: In function `~VertexArray':
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/VertexArray.hpp:46: undefined reference to `_imp___ZTVN2sf11VertexArrayE'
obj\Debug\main.o: In function `~Text':
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Text.hpp:49: undefined reference to `_imp___ZTVN2sf4TextE'
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Text.hpp:49: undefined reference to `_imp___ZTVN2sf4TextE'
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Text.hpp:49: undefined reference to `_imp___ZN2sf13TransformableD2Ev'
D:/SFMLLibraries/SFML2p0Things/SFML-2.0-rc/include/SFML/Graphics/Text.hpp:49: undefined reference to `_imp___ZN2sf13TransformableD2Ev'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)


I have no clue what happened here at all.  Any ideas? I am using the starter program to test with from the tutorial on getting SFML2 setup but again I don't know why I'm the error magnet of the board.

41
I've found a number of things on AIs a while ago and thought people should know about them. 

[Insert preferred Language Here], coding AI behaviour tutorials

http://www.lalena.com/AI/Flock/     {This is in Java but from what I've read of the code the only issue I see someone having when changing this to C++ is the memory and pointer issues}

http://create.msdn.com/en-US/education/catalog/?devarea=11  {The ones here are in XML and very Readable}

I was also looking for some documentation on other AIs including the ones in the links.
There are links to other places within these so have fun snooping around to see what you can dig up. :)

42
General discussions / New Forum Looks nice.
« on: March 25, 2012, 08:19:43 pm »
This place got quite the overhaul since I was last here. 

43
General / Nothing like being really puzzled using a tutorial.
« on: February 21, 2012, 03:38:59 am »
I ran across a tutorial for a game engine and I got the idea of modding it for use in other things but I'm running into a bit of a snag.

For starters the code is an out of date version of SFML 2 and it seems there a number of mistakes even I can see.


http://www.dreamincode.net/forums/topic/230524-c-tile-engine-from-scratch-part-1/

http://www.dreamincode.net/forums/topic/230525-c-tile-engine-from-scratch-part-2/

http://www.dreamincode.net/forums/topic/231078-c-tile-engine-from-scratch-part-3/

http://www.dreamincode.net/forums/topic/232396-c-tile-engine-from-scratch-part-4/


I went and tried to add some files from the Game from scratch tutorial here http://www.sfml-dev.org/forum/viewtopic.php?t=5817 and it seems there are a few issues here and there mainly in converting the files to SFML 2 from SFML 1.6 .

Here's what I have so far.  I'm still working on it at the moment so it looks a bit fragmented currently.
https://legacy.sfmluploads.org/file/105

44
General / Trying and failing to get SFML2 to build for Code::Blocks
« on: February 19, 2012, 08:39:57 pm »
I have no clue why it is so hard for me to get SFML2 up and running but this is getting rather annoying for me. No matter what I do at some point or another I end up with errors that stop me from being able to use SFML2.

This time I'm getting this error when trying to build SFML2 in code blocks:

Code: [Select]

-------------- Build: all in SFML ---------------

Using makefile: Makefile
Execution of 'make.exe -s -f Makefile all' in 'D:\SFMLLibraries\SFML2p0Things\SFML2p\Builds\CB' failed.
Nothing to be done.





It won't let me build the Library at all. :(

This is driving me nuts. I've got CMake, MinGW, and Code::Blocks all in my Path Variable and CMake finds everything so I have no clue what's going on. :(

45
General / Where does everyone get their .ttf files for text in SFML?
« on: February 04, 2012, 07:20:48 pm »
Just wondering since I've been wanting to test out the Text codes SFML has but they seem to need a type of file I'm a bit clueless about.   Anyone want to help?

Pages: 1 2 [3] 4