File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,32 @@ or if you already have maven installed
7272
7373` mvn package `
7474
75+ ## HelloBot
76+
77+ A simple ` Hello World ` bot is as easy as:
78+
79+ ``` Java
80+ import bwapi.BWClient ;
81+ import bwapi.DefaultBWListener ;
82+ import bwapi.Game ;
83+
84+ class HelloBot extends DefaultBWListener {
85+ private BWClient bwClient;
86+
87+ @Override
88+ public void onFrame () {
89+ Game game = bwClient. getGame();
90+ game. drawTextMap(100 , 100 , " Hello World!" );
91+ }
92+
93+ public static void main (String [] args ) {
94+ HelloBot bot = new HelloBot ();
95+ bot. bwClient = new BWClient (bot);
96+ bot. bwClient. startGame();
97+ }
98+ }
99+ ```
100+
75101## Documentation
76102
77103The API documentation can be found [ here] ( https://javabwapi.github.io/JBWAPI/ ) .
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class GameInstance {
1515 + 4 // LastKeepAliveTime
1616 ;
1717
18- public GameInstance (int serverProcessID , boolean isConnected , int lastKeepAliveTime ) {
18+ GameInstance (int serverProcessID , boolean isConnected , int lastKeepAliveTime ) {
1919 this .serverProcessID = serverProcessID ;
2020 this .isConnected = isConnected ;
2121 this .lastKeepAliveTime = lastKeepAliveTime ;
You can’t perform that action at this time.
0 commit comments