Jump to content
  • Advertisement
Sign in to follow this  
jblevins1991

rpg game question

This topic is 2475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites

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

Pokemon *pika = new pikachu;


Better:

pikachu pika;

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!