• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Crusable77

Members
  • Content count

    231
  • Joined

  • Last visited

Community Reputation

594 Good

About Crusable77

  • Rank
    Member

Personal Information

  • Location
    Canada
  1. Thanks, I didn't even think of that.
  2. Hello, I have a struct that defines an RGBA colour:  struct Colour{ float r; float g; float b; float a; }; Then I have an array of some predefined colours  so instead of having  to write out something link display.clear(Colour(1.f, 0.f, 0.f, 1.f) I would instead write  display.clear(clr::red); So I have an array of colours:  //pre defined colours Colour colours[6] = {{1.f, 0.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}}; Now here is my problem. I want to typedef all the elements in the array so instated of writing clr::colours[0] I write clr::red. SO I tried writing them like this and it did not work:  namespace clr{ typedef colours[0] red; typedef colours[1] green; typedef colours[2] blue; typedef colours[3] magenta; typedef colours[4] white; typedef colours[5] black; }//namespace clr Is this possible or did I just do it wrong?  Thanks for any help.
  3. Yes it was the graphics card. My graphics card is very old. Thanks for the help.
  4. Hello, I recently got a new pc with windows 8. I tried to compile a project on this new computer with the same IDE and the same version on SFML as  on my old windows 7 laptop, and I get this error repeated in my console window. An internal OpenGL call failed in Texture.cpp (146) : GL_INVALID_ENUM, an unacce ptable value has been specified for an enumerated argument An internal OpenGL call failed in Texture.cpp (147) : GL_INVALID_ENUM, an unacce ptable value has been specified for an enumerated argument The only thing I can think of is the graphics card. All the projects compile fine on my old laptop, which has a better graphics card but worse cpu and less ram. Thanks for any help.
  5. I fixed the issue two days ago, sorry for not commenting. I added a tilepos int and then wrote a predicate to pass into the std;:sort and that fixed it. Thanks for the responses. 
  6. When I have the image the same as the one on the right, it should say I win, but it doesn't. I believe it is because of the order of the vector. I want the top corner of the map to be 0 and then all the way down to the bottom right to be n in a sequential order, despite how I move the tiles. At the beginning of the game i shuffle the tiles using std::random_shuffle and reset the positions so it is jumbled and call std::sort: std::random_shuffle(m_blocks.begin(), m_blocks.end()); //reset the positions for(int y = 0; y != 10; ++y){ for(int x = 0; x != 10; ++x){ m_blocks[(y * 10) + x]->setPos(sf::Vector2f(offsetX + (x * 32), offsetY + (y * 32))); } } std::sort(m_blocks.begin(), m_blocks.end()); m_blocks is the tiles and 32 is the size of the block.   I also call std:;sort after I move the tiles:  std::sort(m_blocks.begin(), m_blocks.end()); Also I am overloading the < operator: bool Block::operator<(Block& rhs){ return (m_tile_pos < rhs.m_tile_pos); } and the m_tile_pos is set everytime the block is updated
  7. Hello, I am making a picture matching game(you have a picture and a jumbled picture and you need to make them match),  and so I have a vector of tiles(2d squares with colour). When I move the selected tile it changes the position of the tile it moved onto to its old position. However, this does not change its position in the vector so when trying to see if the picture matches the one I just made, it doesn't work. I need a way to, after I move the tile, update the vector so the order of the tiles in the map is 0 - n and it isn't all jumbled up. I tried std::sort but that doesn't seem to work. Thanks for any help.I included a pic to help demonstrate the movement.[attachment=19165:Problem.png]
  8. Hello, I am tyring to comile a project with SDL2 through command line with MinGw. I have a run.bat file that looks like so:   g++ -o Game.exe Main/Main.cpp -lmingw32 -lSDL2main -mwindows -lSDL2 pause start /d "C:\Users\Mathew Bergen\Documents\Programming\C++\LD Practice" Game.exe I get these errors: c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/libmingw32.a(main. o): In function `main': e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src /src/libcrt/crt/main.c:91: undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status I googled the WInMain@16 error and I found that I needed to add -mwindows to the linking command, but it still does not work. I am on windows 7, Thanks for any help.
  9. Thank you everyone. I figured out the error was with my singleton, it wasn't deleting properly. Thanks for the help.
  10. I did read the article and I did everything it told me to and I still don't get the full debug log. 
  11. Hello, I did  #define _CRTDBG_MAP_ALLOC and my destructors are virtual: /*Component is the parent to all other components so the entity class can have a std::vector<Componet*>*/ #ifndef COMPONENT_HPP #define COMPONENT_HPP class Component{ public: Component(); virtual ~Component() = 0; virtual void update(float deltaT); }; #endif //COMPONENT_HPP
  12. Hello, I have an entity with a std::vector<Component*> m_components (Component is an abstract base class all other Components inherit from so I can polymorph them) and when I destroy the entity I clear the vector like so: Entity::~Entity(){ for(std::vector<Component*>::iterator iter = m_components.begin(); iter != m_components.end(); ++iter){ delete *iter; *iter = NULL; } m_components.clear(); m_components.shrink_to_fit(); }  and I get memory leaks. I looked online and everywhere I look it looks like I am doing it right. The memory leaks are a jumble of numbers: Detected memory leaks! Dumping objects -> {377} normal block at 0x05804D28, 8 bytes long. Data: < N > 90 4E 80 05 00 00 00 00 {376} normal block at 0x05804E80, 80 bytes long. Data: < c w c > 90 B1 63 05 D8 81 77 05 90 B1 63 05 00 00 CD CD {374} normal block at 0x05884028, 98304 bytes long. Data: < > 00 00 FF FF 00 00 FF FF 00 00 FF FF 00 00 FF FF {373} normal block at 0x05804E38, 8 bytes long. Data: < M > A4 4D 80 05 00 00 00 00 {372} normal block at 0x05804DF0, 8 bytes long. Data: < M > 80 4D 80 05 00 00 00 00 {371} normal block at 0x05804D70, 68 bytes long. Data: < c w c > C8 B0 63 05 C8 80 77 05 C8 B0 63 05 00 00 CD CD {353} normal block at 0x05778268, 8 bytes long. Data: < w > E8 81 77 05 00 00 00 00 {352} normal block at 0x057781D8, 80 bytes long. Data: < c *x N > 90 B1 63 05 10 2A 78 05 80 4E 80 05 01 00 CD CD {350} normal block at 0x057839A0, 262144 bytes long. Data: < $ $ $ $ > 83 24 0C FF 83 24 0C FF 83 24 0C FF 83 24 0C FF {349} normal block at 0x05778190, 8 bytes long. Data: < w > FC 80 77 05 00 00 00 00 {348} normal block at 0x05778148, 8 bytes long. Data: < w > D8 80 77 05 00 00 00 00 {347} normal block at 0x057780C8, 68 bytes long. Data: < c x pM > C8 B0 63 05 08 19 78 05 70 4D 80 05 01 00 CD CD {326} normal block at 0x05772908, 8 bytes long. Data: < *x > 20 2A 78 05 00 00 00 00 {325} normal block at 0x05782A10, 80 bytes long. Data: < &w c w > 18 26 77 05 90 B1 63 05 D8 81 77 05 01 00 CD CD {323} normal block at 0x057819D0, 4096 bytes long. Data: < > FF 00 00 FF FF 00 00 FF FF 00 00 FF FF 00 00 FF {322} normal block at 0x05781988, 8 bytes long. Data: << x > 3C 19 78 05 00 00 00 00 {321} normal block at 0x05772950, 8 bytes long. Data: < x > 18 19 78 05 00 00 00 00 {320} normal block at 0x05781908, 68 bytes long. Data: <@"w c w > 40 22 77 05 C8 B0 63 05 C8 80 77 05 01 00 CD CD {303} normal block at 0x0577A100, 8 bytes long. Data: <(&w > 28 26 77 05 00 00 00 00 {302} normal block at 0x05772618, 80 bytes long. Data: < c *x c > 90 B1 63 05 10 2A 78 05 90 B1 63 05 01 00 CD CD {299} normal block at 0x05779030, 4096 bytes long. Data: < > FF 00 00 FF FF 00 00 FF FF 00 00 FF FF 00 00 FF {298} normal block at 0x05772308, 8 bytes long. Data: <t"w > 74 22 77 05 00 00 00 00 {297} normal block at 0x057722C0, 8 bytes long. Data: <P"w > 50 22 77 05 00 00 00 00 {296} normal block at 0x05772240, 68 bytes long. Data: < c x c > C8 B0 63 05 08 19 78 05 C8 B0 63 05 01 00 CD CD {275} normal block at 0x0563B220, 8 bytes long. Data: <| c > 7C B0 63 05 00 00 00 00 {274} normal block at 0x0563B190, 80 bytes long. Data: < &w *x N > 18 26 77 05 10 2A 78 05 80 4E 80 05 01 01 CD CD {273} normal block at 0x0563B148, 8 bytes long. Data: <p c > 70 B0 63 05 00 00 00 00 {272} normal block at 0x0563B0C8, 68 bytes long. Data: <@"w x pM > 40 22 77 05 08 19 78 05 70 4D 80 05 01 01 CD CD {271} normal block at 0x0563B070, 24 bytes long. Data: <H c c c > 48 B1 63 05 C8 B0 63 05 04 00 00 00 20 B2 63 05 {171} normal block at 0x0357F378, 40 bytes long. Data: < 5_ > D4 C5 35 5F 18 00 00 00 08 00 00 00 00 00 00 00 {170} normal block at 0x003FBFE8, 40 bytes long. Data: < 5_ > D4 C5 35 5F 18 00 00 00 08 00 00 00 00 00 00 00 Object dump complete. I am using VS2012's built in system for detecting memory leaks. This is the only place I am dynamically allocating anything in my program and when I comment out everything that has to do with the vector I get no errors. Thanks for any help.
  13. Hello, I read this http://msdn.microsoft.com/en-us/library/e5ewb1h3(v=vs.71).aspx (tells you how to detect memory leaks in VS) and I applied it to my project but I got some unexpected results. I am not even dynamically allocating anything and it tells me I have a bunch of memory leaks.  Detected memory leaks! Dumping objects -> {173} normal block at 0x038F9D90, 20 bytes long. Data: <8.s 8.s 8.s > 38 2E 73 00 38 2E 73 00 38 2E 73 00 01 00 CD CD {172} normal block at 0x038F3408, 24 bytes long. Data: <@4 > 40 34 8F 03 FF FF FF FF 00 00 00 00 00 00 00 00 {171} normal block at 0x0360EEA0, 40 bytes long. Data: < _ > D4 C5 C3 5F 18 00 00 00 08 00 00 00 00 00 00 00 {170} normal block at 0x0072BCF0, 40 bytes long. Data: < _ > D4 C5 C3 5F 18 00 00 00 08 00 00 00 00 00 00 00 {151} normal block at 0x007335B0, 32 bytes long. Data: <Platformer Studi> 50 6C 61 74 66 6F 72 6D 65 72 20 53 74 75 64 69 {150} normal block at 0x00727620, 8 bytes long. Data: < % > 9C 25 08 01 00 00 00 00 {147} normal block at 0x00732F60, 24 bytes long. Data: < /s > 98 2F 73 00 FF FF FF FF 00 00 00 00 00 00 00 00 {146} normal block at 0x00732ED0, 24 bytes long. Data: < /s > 08 2F 73 00 FF FF FF FF 00 00 00 00 00 00 00 00 {145} normal block at 0x00732E88, 8 bytes long. Data: <8# _ > 38 23 C4 5F 00 00 00 00 {144} normal block at 0x00732E38, 20 bytes long. Data: < > 90 9D 8F 03 90 9D 8F 03 90 9D 8F 03 01 01 CD CD {143} normal block at 0x00732DF8, 4 bytes long. Data: < > 0C 00 00 00 {142} normal block at 0x00732DB8, 4 bytes long. Data: < > 0B 00 00 00 Object dump complete. My Code: #define CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> #include <SFML/Graphics.hpp> #include <string> #include <sstream> #include <iostream> //window attributes const unsigned int WINDOW_WIDTH = 800; const unsigned int WINDOW_HEIGHT = 600; const unsigned int MAX_FPS = 60; const std::string WINDOW_NAME = "Platformer Studio v 1.0 inDev"; int main(){ sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT), WINDOW_NAME, sf::Style::Close); sf::Event event; sf::Clock fpsTimer, updTimer; int frames = 0; window.setFramerateLimit(MAX_FPS); while(window.isOpen()){ //events while(window.pollEvent(event)){ switch(event.type){ case sf::Event::Closed: window.close(); break; } } //keyboard input if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) window.close(); ++frames; //set to a dark purple colour window.clear(sf::Color(80, 0, 80, 255)); window.display(); //get frame rate and display it in the title bar if(fpsTimer.getElapsedTime() >= sf::seconds(1)){ std::stringstream sstr; sstr << WINDOW_NAME << " " << frames << " fps"; window.setTitle(sstr.str()); frames = 0; fpsTimer.restart(); } } _CrtDumpMemoryLeaks(); return 0; }  What does this mean? I am using VS2012 and SFML 2.0. thanks for any help
  14. Hello, I have never copyrighted any of my code and I am unsure of how to do it. Do I need a registered company? Can I just use my name? Is there a standard message you need to put in with your code? Thanks for any help. Also, I am not sure if this belongs in this forum or not.
  15. No, the problem only occurs when I changed to std::vector from std::list.   Edit: It worked thanks