In tutorials sometimes people use "extends Game", sometimes "implements Screen" and i have auto-generated "extends ApplicationAdapter". What is the difference between them?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
ApplicationAdapter
allows you to create a listener, but not being forced to implement every method. If you're familiar with Swing, check outKeyAdapter
, it's the same idea.An
ApplicationListener
allows you to handle application events. This allows you to execute code during certain events within the application life-cycle (such as destroy).A
Game
is anApplicationListener
that supports multiple screens. You can create multiple screens and switch between em usingsetScreen
.A
Screen
is exactly what it sounds like; it's what will be displayed at that given time. Maybe it's a main menu, maybe it's the actual game.It's recommended you use the
Game
class for the base of your game, then create multipleScreen
instances of the different possible game states you will have.