• Post Reply Bookmark Topic Watch Topic
  • New Topic

Classes Where to start  RSS feed

 
brandon mac
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Design a program for a game.

Build a player for the game
Name the character
health of the player max 100
increase health by eating, increments of 15
attack power max 100, cannot attack if health is below 25, if character health is below 25 tell the character to replenish health


I'm reading through this example of what to do and its talking about constructors, mutators, and accessors which I have no idea about any of this.

Also I'm learning about breaking down the program into 2 sections so the player would be one part and the game would be the other part.



Okay I would like to know if I'm headed in the right direction with this but I'm trying to figure out how I'm going to make the player lose health so take damage and then what I can use to replenish the health to allow the character to attack again.









[/code]
 
fred rosenberger
lowercase baba
Bartender
Posts: 12562
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
brandon mac wrote:Okay I would like to know if I'm headed in the right direction with this but I'm trying to figure out how I'm going to make the player lose health so take damage and then what I can use to replenish the health to allow the character to attack again.

I would suggest you slow down, and stop coding. In fact, we even have a FAQ call StopCoding (<--click that). If you can't answer those questions above, you probably shouldn't be writing ANY code yet.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!