how to implement draw method
please help
Resolved
Comments (6)
- Popular
- New
- Old
You must be signed in to leave a comment
Seb
17 March 2020, 17:50solution
Hey Raj,
the problem is a wrong parameter type on line 25.
It's public void draw(Game game) not (GameObject gameObject)
And then after nextFrame() call super.draw(game)
I hope that's it. ;-)
+2
Ashish RajAnand
18 March 2020, 07:37
thank you sir
Moonlander
Sir please plays this game.
can i ask an question?
how to insert message at starting of this game i.e.
rule to play which key will work and how
about game ,
+1
Seb
18 March 2020, 21:09
Your game is working nicely. :-)
I can give you one "quick and dirty" solution to show a message before the game starts.
Add the following code to the beginning of your initialize method:
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Moonlander");
alert.setHeaderText("Game Instructions");
alert.setContentText("Use left, right, up and down keys to steer the spaceship. Space starts the game.");
alert.showAndWait();
This will pop up an info message when the game starts up. It also has a little side effect in relation to the frame of the game. You'll probably see that.
This really is just one very simple way of how to add such a message. I'm sure you can come up with better ways. ;-)
0
Ashish RajAnand
19 March 2020, 02:34
Thank you sir ,
Sir here is any idea about how to run jar file within html page in local host.
+1
Seb
19 March 2020, 20:04
You're welcome, but I'm afraid I can't help you on that one. ;-)
0
Ashish RajAnand
29 March 2020, 13:44
https://codegym.cc/help/8033
0