Jump to content

  • Log In with Google      Sign In   
  • Create Account

rpg game question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 jblevins1991   Members   -  Reputation: 99

Like
0Likes
Like

Posted 01 March 2012 - 12:04 PM

Im making a pokemon rpg game and i need an idea on how to create target pokemon. i have the pokemon class made, but i dont have an idea on how to create the enemy pokemon class. should i use inheiritance?

Sponsor:

#2 Dawoodoz   Members   -  Reputation: 299

Like
0Likes
Like

Posted 01 March 2012 - 01:29 PM

Inheritance is overkill when you can have a team property as an integer. You can not give out your game if you use the pokemon trademark.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#3 e‍dd   Members   -  Reputation: 2105

Like
1Likes
Like

Posted 01 March 2012 - 01:39 PM

Why does an enemy pokemon have to be modelled any differently to a "regular" pokemon?

You probably don't want inheritance. It is mostly a means to achieve convenient runtime polymorphism. If you don't have a polymorphic interface in mind, it's not what's needed.

#4 jblevins1991   Members   -  Reputation: 99

Like
0Likes
Like

Posted 01 March 2012 - 01:56 PM

i don't plan on giving it out, its just something that makes learning game programming fun and interesting.

so i can just do something a long the lines of...

Pokemon *pika = new pikachu;

#5 e‍dd   Members   -  Reputation: 2105

Like
0Likes
Like

Posted 01 March 2012 - 02:03 PM

so i can just do something a long the lines of...

Pokemon *pika = new pikachu;


Better:
pikachu pika;


#6 Dawoodoz   Members   -  Reputation: 299

Like
0Likes
Like

Posted 01 March 2012 - 02:14 PM

I never planned to give out my physical simulation application but after 4 years in development people liked it and it got nominated for best execution in the Swedish Game Awards.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#7 FLeBlanc   Crossbones+   -  Reputation: 3101

Like
0Likes
Like

Posted 01 March 2012 - 03:29 PM

You might consider using object composition rather than "traditional" deep hierarchy polymorphism. That is, avoid building those ugly inheritance trees where such-and-such is derived from whatsis, which is derived from whozit and wotsit. Nothing but god-awful messes to be had there.

Object composition allows you to express an object based on the properties it possesses, without tying those properties to any particular class in the inheritance tree. Objects in this sense, then, boil down to being basically a bucket full of properties. You can add exactly the properties you need to the object, without worrying about which base class or classes would be appropriate to derive from.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS