⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamestate.java

📁 想学习java游戏编程的最好的例子之一
💻 JAVA
字号:
package com.brackeen.javagamebook.state;

import java.awt.Graphics2D;
import com.brackeen.javagamebook.input.InputManager;

public interface GameState {


    /**
        Gets the name of this state. Used for
        the checkForStateChange() method.
    */
    public String getName();


    /**
        Returns the name of a state to change to if this state is
        ready to change to another state, or null otherwise.
    */
    public String checkForStateChange();


    /**
        Loads any resources for this state. This method is called
        in a background thread before any GameStates are set.
    */
    public void loadResources(ResourceManager resourceManager);

    /**
        Initializes this state and sets up the input manager
    */
    public void start(InputManager inputManager);


    /**
        Performs any actions needed to stop this state.
    */
    public void stop();


    /**
        Updates world, handles input.
    */
    public void update(long elapsedTime);


    /**
        Draws to the screen.
    */
    public void draw(Graphics2D g);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -