6 Replies - 554 Views - Last Post: 30 August 2010 - 02:43 PM Rate Topic: -----

#1 giuseppe105  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 448
  • Joined: 15-May 08

Class name?

Posted 30 August 2010 - 01:52 PM

I am making a class that i will use to create each Battler and Monster in my game? What should i call it?

This post has been edited by giuseppe105: 30 August 2010 - 01:53 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Class name?

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon

Reputation: 2965
  • View blog
  • Posts: 11,222
  • Joined: 15-July 08

Re: Class name?

Posted 30 August 2010 - 01:54 PM

Give it a descriptive name so that you can guess at its methods without having to look in it. Make an abstract AbstractMonster and AbstractBattle class that hold similarities and make appropriate subclasses.
Was This Post Helpful? 0
  • +
  • -

#3 giuseppe105  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 448
  • Joined: 15-May 08

Re: Class name?

Posted 30 August 2010 - 02:04 PM

i was thinking about making an abstract class the monsters only have 2 less variables then the hero's so i was thinking of making 1 abstract class for both and leaving the 2 variables null for the monsters.

is this wasting memory?

I decided not to make an abstract class because to tell the truth i don't know what it is or how it works. except for the one you made on the state machine i know how that work and why but cant use what i know to make my own abstract class.

I don't wanna hear any of this business that if i don't know what an abstract class is then i shouldn't be making a game. If i don't know i will ask and learn and move on working on the game. I'm using the game as a learning tool. by not knowing something means I'm learning.

edit
sorry for accusing you of something you haven't done.

This post has been edited by giuseppe105: 30 August 2010 - 02:04 PM

Was This Post Helpful? 0
  • +
  • -

#4 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon

Reputation: 2965
  • View blog
  • Posts: 11,222
  • Joined: 15-July 08

Re: Class name?

Posted 30 August 2010 - 02:07 PM

So if you don't know something, I'd suggest learning it. Saying "I don't want to know" is the wrong attitude...All knowledge that one has makes a potentially better program.
Was This Post Helpful? 0
  • +
  • -

#5 giuseppe105  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 448
  • Joined: 15-May 08

Re: Class name?

Posted 30 August 2010 - 02:10 PM

now hold on a second there i never said "I don't want to know" Where would i look to learn about abstract classes?

and you never commented on the wasting memory thing.
Was This Post Helpful? 0
  • +
  • -

#6 giuseppe105  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 448
  • Joined: 15-May 08

Re: Class name?

Posted 30 August 2010 - 02:38 PM

I understand now you don't need to comment on the memory thing because if i use an abstract class and have a subclass for monsters and players i don't need to have unused variables laying around.

I ran into 1 problem though.

monsters have everything players have and nothing extra.

so would i make players a subclass of monsters?

and instead of making monsters abstract i could make monsters like a normal class and extend monsters in my players class?

This post has been edited by giuseppe105: 30 August 2010 - 02:40 PM

Was This Post Helpful? 0
  • +
  • -

#7 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon

Reputation: 2965
  • View blog
  • Posts: 11,222
  • Joined: 15-July 08

Re: Class name?

Posted 30 August 2010 - 02:43 PM

Yep. That'll do!
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1