To show what I have done in the works
× [PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
I used the Java program to design a text game, Text Fighter.
In the game, I designed two characters, Davis and Kim. They will be randomly to fight, if one of them the Power (Health Point / HP) is lower than zero, the game will stop and finish. There is a example in downward. Download the file: 1.Player.class 2.Player.java (update: 21-10-07) 3.PlayerTest.class 4.PlayerTest.java You can see the code in here. PR
無題
Thank you very much.
However, it is a bug to write something like: setPower( 100 + 1 ); victim.setPower ( 100 - 1 ); in the method attack because the powers will be reset to 101 and 99 respectively no matter what the original powers are. These did not happen in your trials because it is difficult to have both the players at equal power once the game has started. The fix is to use getPower() in place of the 100.
Re:張真人
Thank you for your comment.
I have tried the method before, but when I run the program it shows wrong value of power. I know what I did wrong at last time. Now the program goes thought the right value. |
Date
Freearea
New Event
(12/18)
(12/11)
(10/25)
(10/25)
(10/18)
Blog Search
|