The Skye is the limit with Yo Jabba Jabba!
The Skye is the limit with Yo Jabba Jabba!
The Skye is the limit with Yo Jabba Jabba!
You are mixing System.out.print and println. Use as few print calls as possible. If you can amalgamate two calls into one, you can save several milliseconds.
You have repeated code in lines 40 and 50, and 59 and 72. That should be refactored.
Why don't you attack the monster object directly?
You are going on about injuring the monster (surely a Knight would only kill a Dragon, and where is the PrettyMaiden class ?)
I meant, if you have several print calls, join them all together. NotbutThe "" + is to ensure everything is turned into Strings and may be unnecessary in many cases.jonny Alva wrote: . . .
You said to use as few as possible, did you mean use System.out.println command as least as possible or did you mean use System.out.print as least as possible?
. . .
It is always bad to have repeated code. What happens if you need to maintain it and change that code? What happens if you have 99 bits of repeated code and there is an error and you only correct it 98 times?
Is it bad if i use a lot of the same code several times in java or is that like unprofessional?
. . .
Why not give the Monster a sufferAttack() method. That would be giving the monster a behaviour which there can be an interaction with.
How would i do that whould i just put the object as a parameter or not like that?
jonny Alva wrote:Actually, you just gave me a good idea, i'm going to see if i can make other characters here and see if i can have them do something here.
Oh and is it also possible to make an object pause for a min? like lets say the knight attacks and then it waits until it receives the attack of the monster?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|