SHARE
TWEET
Untitled
a guest
Nov 20th, 2016
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- package com.kingclub2.jelly.gametypes;
- import com.badlogic.gdx.Gdx;
- import com.badlogic.gdx.Screen;
- import com.badlogic.gdx.graphics.GL20;
- import com.badlogic.gdx.graphics.OrthographicCamera;
- import com.kingclub2.jelly.Ghost;
- import com.kingclub2.jelly.GhostInput;
- import com.kingclub2.jelly.GhostType;
- import com.kingclub2.jelly.Human;
- import com.kingclub2kingclub2.jelly.JellyGame;
- public class SpookScreen implements Screen {
- final JellyGame game;
- Ghost ghost;
- GhostType type;
- Human human;
- float speed = 50;
- OrthographicCamera camera;
- public SpookScreen(final JellyGame game) {
- this.game = game;
- this.type = GhostType.Spooky;
- camera = new OrthographicCamera();
- camera.setToOrtho(false, 640, 480);
- ghost = game.makeGhost(type, 320, 240);
- human = game.makeSpookedHuman(100, 100);
- }
- @Override
- public void show() {
- Gdx.input.setInputProcessor(new GhostInput(ghost, this.speed));
- }
- @Override
- public void render(float delta) {
- Gdx.gl.glClearColor(0, 0, 0, 1);
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- camera.update();
- game.batch.setProjectionMatrix(camera.combined);
- ghost.update(delta);
- human.update(delta);
- game.batch.begin();
- human.draw(game.batch);
- ghost.draw(game.batch);
- game.batch.end();
- }
- @Override
- public void resize(int width, int height) {
- System.out.println(String.format("width: %s, height: %s", width, height));
- //camera.viewportWidth = width;
- //camera.viewportHeight = height;
- camera.update();
- }
- @Override
- public void pause() {
- }
- @Override
- public void resume() {
- }
- @Override
- public void hide() {
- }
- @Override
- public void dispose() {
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

