Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Feb 2006
Offline Last Active Dec 04 2014 08:51 AM

Posts I've Made

In Topic: Problem setting up SDL with Dev-C++

19 November 2014 - 12:21 PM

Not sure if this is still the case or not but I believe Dev C++ has been abandoned.  Most people recommend using Code::Blocks or Visual Studio.  I've used all three and would say Code::Blocks has better features than Dev C++.  Visual Studio has become my favorite although it can be intimidating at first.

In Topic: Having trouble accessing an objects properties.

29 December 2013 - 02:47 PM

I'm not 100% sure what the problem your running into is aside from accessing the derived classes data.


You could have character have a virtual method called DoAttack() where each derived class can override it to do whatever they have todo.  Another approach to the problem is to use composition and instead of creating bladewarrior, fistwarrior, drunkenwarrior, you could have a single class called GameMonster (or w.e) which would contain a pointer to another class that has more information on the type of monster it is.


This article should help you. http://gameprogrammingpatterns.com/type-object.html


The cool part about doing it that was is you can have all your different monsters in an xml file and modify attributes without having to recompile.  You can also make sub-monster types without having to specify every attribute and instead have it "inherit" from it's parent monster type.


EDIT: Since it's C# that you're using, you don't have to worry about pointers.  Classes are passed by reference so you can just set your monsters to have w.e monster type you want.


e.g. Monster m = new Monster(); //You could do it the way the article shows as well

m.SetType(new FistWarrior());


The only thing is that if you have custom attack patterns or something you would need to do a litle more work.  Maybe something like m.SetBehavior(new WarriorBehavior(WarriorStyle.Fist));   Just an idea, haven't gotten up to that yet in my project

In Topic: Input handling design frustration

29 December 2013 - 02:30 PM

I haven't had the time to mess with my project because of finals and it's the busy season at work, but I still need to implement input somehow in my game.  Right now this is holding me back from doing anything else (well mentally it's holding me back because I really want to get input to my game character so I can then implement collision and render my map with the player)

In Topic: Gamedev has shown me how I've grown

29 December 2013 - 02:25 PM

Great to see I'm not the only one!


Hodgman's little story made me laugh haha.


Gamedev is definitely the best community I've encountered on the internet.  When the day comes that I finish making my 2d rpg game....everyone here will know xD

In Topic: How can I use Windows Phone sensors to move an object?

26 December 2013 - 02:34 PM

I don't know how to use this formula in my code: On = On-1 + α(In – On-1)

How can I use the formula or a similar formula in my code?

I skimmed through the article and it seems they're using extrapolation to smooth out the data.  Someone else can chime in if this is too overkill for what you're doing, but the formula seems to be the formula of a line i.e. y= m(x-x1) + y1


If you've taken calc 1 that formula should be familiar to you (or pre calc)

I'm not sure what On-1 stands for in this context, it seems like it's an initial reading.  Maybe it's the first reading that's gotten over the  50 inputs they get?


In is the raw input data which the sensor would give you.  I haven't researched if the SDK gives you the reading filtered or not or if it really is raw data.  You'll have to research that.  Hopefully something on the wikipedia page can help you a bit more.




The article is using linear extrapolation


EDIT: From what I gathered, you would use the formula to sample 50 inputs within a given amount of time and average them out using that formula to have a smooth input. alpha (α) would be 0 to 1 which is basically how much smoothing should be done.  It's a constant.