Evolution SDK
Posted: Mon Jul 12, 2010 6:57 pm
I am developing a 2D SDK. The SDK consists of a reusable engine that uses SFML which draws heavily on Qt's design, and a level editor written in Qt.
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
LolLeonBlade wrote:
Glad you took our "advice" and posted SOMETHING other than "I'm making [insert seemingly random project here]".lotios611 wrote:I don't have much done yet, but you could check out the code I have at the google code page for this project.
Well yeah, I think we all wish the best of luck. But the post was just pretty vague. Really he/she just stated what tools he was utilizing, not really what he/she intended the engine to accomplish, or any other information really. I love seeing the progress of everyone's engines/games, and I just want more information on this project haha.dejai wrote:Unlike the others that scrape around your post looking for a laugh I think it is great that you are starting a 2D game engine it is a great learning experience. I have been writing one since February and it is around 10 thousand lines of C++ and has lua integration for scripting behaviors and xml for storing data (not ideal but works on an indie scale). Code speaks louder than words I have often not been able to articulate my intention to this crowd so I just started writing the code and it seems to turn out a lot better in the end. Screen shots usually help but when you are developing an engine and not a game, art is not really your priority. Anyway best of luck with it just be ready to write a lot of code over a long period of time. Keep on coding.
Haha alright xD. I just don't want to make an assumption, and offend anyone hahalotios611 wrote:I've decided to switch to SFML to decrease the amount of code I have to write. Also, "It's a boy!" was said at my birth.
Code: Select all
#ifndef DYNAMIC_ARRAY_2D_H
#define DYNAMIC_ARRAY_2D_H
#include <vector>
template <class T>
class DynamicArray2D
{
public:
DynamicArray2D() : numberOfRows(0), numberOfColumns(0)
{
}
T& operator()(int row, int column)
{
if (numberOfRows < row)
{
numberOfRows = row;
data.resize(numberOfRows);
}
if (numberOfColumns < column)
{
numberOfColumns = column;
data[numberOfRows].resize(numberOfColumns);
}
return data[row][column];
}
T operator()(int row, int column) const
{
if (numberOfRows < row)
{
numberOfRows = row;
data.resize(numberOfRows);
}
if (numberOfColumns < column)
{
numberOfColumns = column;
data[numberOfRows].resize(numberOfColumns);
}
return data[row][column];
}
private:
int numberOfRows;
int numberOfColumns;
std::vector<std::vector<T> > data;
};
#endif
lotios611 wrote:I'm having troubles with some code. I'm trying to implement a dynamic 2D vector class. I've been working on it for the past weeks, and nothing I've tried worked. I don't mind using pointers if It'll be easier that way.
Here's the code:Code: Select all
[/quote] ok first thing I noticed is that you're just encapsulating a vector<vector<T> >. Not a bad thing, but it also means you don't need to hold the width and height (if you're doing it in a [y,x] access style, which is how it usually is, the height is v.size() and the width is v[0].size()). Also, when you resize the width you have to resize EVERY vector in the vector<vector<T> > while for height you only have to resize the main one. I'm not really in the mood to write any c++ code atm, but I hope I gave you the idea. ;)