Initial commit.
Basic window setup, sound and level assets.
This commit is contained in:
BIN
core/assets/level.png
Normal file
BIN
core/assets/level.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
core/assets/sounds/beginning.wav
Normal file
BIN
core/assets/sounds/beginning.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/beginning_alt.wav
Normal file
BIN
core/assets/sounds/beginning_alt.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/chase.wav
Normal file
BIN
core/assets/sounds/chase.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/chomp_1.wav
Normal file
BIN
core/assets/sounds/chomp_1.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/chomp_2.wav
Normal file
BIN
core/assets/sounds/chomp_2.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/death.wav
Normal file
BIN
core/assets/sounds/death.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/eat_fruit.wav
Normal file
BIN
core/assets/sounds/eat_fruit.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/eat_ghost.wav
Normal file
BIN
core/assets/sounds/eat_ghost.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/extra_life.wav
Normal file
BIN
core/assets/sounds/extra_life.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/intermission.wav
Normal file
BIN
core/assets/sounds/intermission.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/return_base.wav
Normal file
BIN
core/assets/sounds/return_base.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/siren.wav
Normal file
BIN
core/assets/sounds/siren.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/siren_fast.wav
Normal file
BIN
core/assets/sounds/siren_fast.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/siren_faster.wav
Normal file
BIN
core/assets/sounds/siren_faster.wav
Normal file
Binary file not shown.
BIN
core/assets/sounds/siren_fastest.wav
Normal file
BIN
core/assets/sounds/siren_fastest.wav
Normal file
Binary file not shown.
6
core/build.gradle
Normal file
6
core/build.gradle
Normal file
@ -0,0 +1,6 @@
|
||||
apply plugin: "java"
|
||||
|
||||
sourceCompatibility = 1.7
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
sourceSets.main.java.srcDirs = [ "src/" ]
|
60
core/src/com/me/pacman/PacDude.java
Normal file
60
core/src/com/me/pacman/PacDude.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.me.pacman;
|
||||
|
||||
import com.badlogic.gdx.ApplicationAdapter;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.math.Matrix4;
|
||||
import com.badlogic.gdx.utils.viewport.FitViewport;
|
||||
import com.badlogic.gdx.utils.viewport.Viewport;
|
||||
|
||||
public class PacDude extends ApplicationAdapter {
|
||||
|
||||
public static final String TITLE = "Pac-Dude";
|
||||
public static final String VERSION = "v0.0.1";
|
||||
|
||||
public static final int LEVEL_WIDTH = 224;
|
||||
public static final int LEVEL_HEIGHT = 248;
|
||||
|
||||
public OrthographicCamera cam;
|
||||
public Viewport viewport;
|
||||
|
||||
public SpriteBatch batch;
|
||||
public Texture img;
|
||||
|
||||
@Override
|
||||
public void create () {
|
||||
cam = new OrthographicCamera();
|
||||
viewport = new FitViewport(LEVEL_WIDTH, LEVEL_HEIGHT, cam);
|
||||
viewport.apply(true);
|
||||
|
||||
batch = new SpriteBatch();
|
||||
img = new Texture("level.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render () {
|
||||
Gdx.gl.glClearColor(0, 0, 0, 1);
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||
batch.begin();
|
||||
batch.draw(img, 0, 0);
|
||||
batch.end();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resize(int width, int height) {
|
||||
viewport.update(width, height);
|
||||
|
||||
batch.setProjectionMatrix(cam.combined);
|
||||
|
||||
super.resize(width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose () {
|
||||
batch.dispose();
|
||||
img.dispose();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user