Jump to content

  • Log In with Google      Sign In   
  • Create Account

johnmarinelli

Member Since 29 Nov 2012
Offline Last Active Mar 24 2014 03:10 PM

#5126217 Concept for making a state manager

Posted by johnmarinelli on 24 January 2014 - 05:32 PM

It looks like you're on the right track to me - however, I'm confused as to why you would make a StateManager class with a vector of states in it?  Couldn't you just put a BaseState* in your world object, and then in your world.update you call BaseStatePointer->update(), etc?

 

It just looks like a (possibly) unnecessary level of encapsulation to me, but your big picture seems good.  This article really helped me understand state machines; although it's implemented with SDL, I think you'll be able to grasp it:

 

http://lazyfoo.net/articles/article06/index.php




#5103791 How can I gain a deeper understanding of C/C++?

Posted by johnmarinelli on 23 October 2013 - 11:19 AM

Hello,

 

So after going through these slides (they're very interesting, btw!  I suggest you go through them), I realized that my knowledge of C/C++ isn't as deep as I thought. 

 

Does anyone with a very concrete understanding of C/C++ have any advice for becoming more like the girl character?  Any book recommendations/practices?  I know that simply programming every day is the first step, but I'd like to supplement my programming with any extra information I can get.




#5038788 Finally finished a project; now how do I get it out?

Posted by johnmarinelli on 03 March 2013 - 12:35 PM

Hi everyone,

 

So I've finally finished something that I'm willing to let into the wild.  I've built it using SDL & VS2010.  The problem is, I have <i>no</i> experience distributing apps.  I tried to run it in release mode, and I get errors like

 

c:\users\john marinelli\desktop\~\programming $hit\c++ sources\killstuff\killstuff\c_Entity.h(2): fatal error C1083: Cannot open include file: 'SDL.h': No such file or directory
 

so, I assume that I have to re-link the libraries or something, but before I go and do that and potentially mess things up I'd like to know exactly what to do.

 

 




#5038786 Need help with C++

Posted by johnmarinelli on 03 March 2013 - 12:29 PM

lazy-foo.net is the standard SDL tutorial.  Although if you have very little programming experience and are only doing this for a class, I would really recommend looking for any way out of it.




#5029182 Rule of Three, and const-correctness questions

Posted by johnmarinelli on 05 February 2013 - 03:37 PM

Hi guys,

 

I was recently told that my code is missing the Rule Of Three concept, and that my timer isn't const-correct.

 

I know of these terms; but google and searching the forums didn't help much.

 

I think what would help, however, would be an example of each concept (Rule of Three, Const-correctness) related to Game Programming.  I know what the Rule Of Three is for (creating copy ctor, assignment ctor, and dtor), but I don't completely understand why.  Also, I know that RAII/smart pointers take care of all that altogether, but I'd like to understand the Rule of Three.

 

As far as const-correctness, I think that it means that when you pass a variable by reference to a function, you should pass it as a const so that you're assuring it doesn't get changed.  does this mean that in my game loop, the Update(int &deltaTicks) function should be Update( const int &deltaTicks )?




#5009463 Game Component Architecture

Posted by johnmarinelli on 11 December 2012 - 11:34 AM

Hi all,

I plan on making a simple game using C++ and SDL. The premise is very simple; you have a character that runs around and kills zombies. However, I want to make different kinds of zombies, and I was reading about the Game Component system and it piqued my interest.

Where I usually do the basic Entity->Player/Zombie/whatever system, I realized that creating a bunch of different types zombies may be tedious. So my biggest question is, how could I implement the game component system with making multiple kinds of zombies? They will all share a few attributes (x and y coordinates, animation, health); but I want to make some be more difficult than others.

My current idea of the component system is that I create a base Component class, then make an AI Component class - from there I could make an "easy" AI component, "medium" AI component, etc - and give each respective zombie class a type of component. However, I've read about this thing called a "subsystem" - I'm not entirely sure what the subsystem is supposed to do, and the article I've been reading hasn't mentioned it where others have (the article I'm reading is http://gameprogrammingpatterns.com/component.html ).

So, I'd like to know if and how to use a subsystem with components, and how exactly I would implement say, an "AIComponent" with a cZombie class.

Thanks!


PARTNERS