Commit 44f1bafd authored by Nils Hein's avatar Nils Hein
Browse files

Added graphics and sound

parent 5c47d38a
android/assets/Bubble.png

9.26 KB | W: | H:

android/assets/Bubble.png

11.3 KB | W: | H:

android/assets/Bubble.png
android/assets/Bubble.png
android/assets/Bubble.png
android/assets/Bubble.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -12,6 +12,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
......@@ -32,9 +33,15 @@ public class FrozenNumbersGame extends ApplicationAdapter {
Gdx.gl.glBlendFunc(Gdx.gl.GL_SRC_ALPHA, Gdx.gl.GL_ONE_MINUS_SRC_ALPHA);
assets = new AssetManager();
m_Screens = new HashMap<String,Screen>();
assets.load("badlogic.jpg", Texture.class);
assets.load("Bubble.png", Texture.class);
assets.load("BubbleTop.png", Texture.class);
assets.load("hit.ogg", Sound.class);
assets.load("shot.wav", Sound.class);
assets.load("load.wav", Sound.class);
assets.load("pop.ogg", Sound.class);
//assets.load("bg.jpg", Texture.class);
assets.finishLoading();
......
......@@ -66,7 +66,7 @@ public class Bubble extends Sprite {
//this.setSize(32, 32);
vel = new Vector2(0, 0);
force = new Vector2(0, 0);
setName("Bubble.png");
setName("data/Bubble.png");
Random r = new Random();
value = r.nextInt(10);
HSL c = new HSL(value*0.1f, 1f, 0.5f, 1f);
......
......@@ -10,6 +10,8 @@ import org.milderjoghurt.frozennumbers.model.Bubble;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.PolygonRegion;
import com.badlogic.gdx.graphics.g2d.PolygonSprite;
......@@ -71,6 +73,7 @@ public class GameScreen implements Screen {
if (p1.active == null) {
p1.active = new Bubble(p1.next);
p1.active.setPos(p1.sPos.cpy());
//FrozenNumbersGame.assets.get("load.wav",Sound.class).play();
p1.next = null;
}
if (Gdx.input.isTouched()) {
......@@ -83,6 +86,7 @@ public class GameScreen implements Screen {
p1.active.setVel(speed.cpy().scl(100.0f));
p1.active.setForce(speed.scl(100));
p1.active.isFlying = true;
//FrozenNumbersGame.assets.get("shot.wav",Sound.class).play();
}
}
}
......@@ -95,6 +99,7 @@ public class GameScreen implements Screen {
p1.active.isFlying = false;
nachbarn.put(point , new Bubble(p1.active));
p1.active = null;
FrozenNumbersGame.assets.get("hit.ogg",Sound.class).play();
break;
}
}
......@@ -106,6 +111,7 @@ public class GameScreen implements Screen {
p1.active.setVel(new Vector2(0, 0));
nachbarn.put(point, new Bubble(p1.active));
p1.active = null;
FrozenNumbersGame.assets.get("hit.ogg",Sound.class).play();
}
}
......@@ -137,12 +143,14 @@ public class GameScreen implements Screen {
}
}
if(sum%10 == bu.getValue() && nei.size() > 1){
FrozenNumbersGame.assets.get("pop.ogg",Sound.class).play();
removes.add(h);
removes.addAll(map.getNeighborsOf(h));
score += sum;
}
}
for (Hexagon hexagon : removes) {
//Gdx.audio.newSound(new FileHandle("plop")).play();
nachbarn.remove(hexagon);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment