Removed sound assets / Fixed text wrap / Proper screen clear

This commit is contained in:
Anuken
2018-07-19 11:06:10 -04:00
parent 091f591ffb
commit 56fc40a64d
40 changed files with 28 additions and 33 deletions

View File

@@ -70,10 +70,10 @@ public class Control extends Module{
gdxInput = Gdx.input;
Sounds.load("shoot.mp3", "place.mp3", "explosion.mp3", "enemyshoot.mp3",
"corexplode.mp3", "break.mp3", "spawn.mp3", "flame.mp3", "die.mp3",
"respawn.mp3", "purchase.mp3", "flame2.mp3", "bigshot.mp3", "laser.mp3", "lasershot.mp3",
"ping.mp3", "tesla.mp3", "waveend.mp3", "railgun.mp3", "blast.mp3", "bang2.mp3");
//Sounds.load("shoot.mp3", "place.mp3", "explosion.mp3", "enemyshoot.mp3",
// "corexplode.mp3", "break.mp3", "spawn.mp3", "flame.mp3", "die.mp3",
// "respawn.mp3", "purchase.mp3", "flame2.mp3", "bigshot.mp3", "laser.mp3", "lasershot.mp3",
// "ping.mp3", "tesla.mp3", "waveend.mp3", "railgun.mp3", "blast.mp3", "bang2.mp3");
Sounds.setFalloff(9000f);
Sounds.setPlayer((sound, volume) -> {
@@ -86,7 +86,7 @@ public class Control extends Module{
}
});
Musics.load("1.mp3", "2.mp3", "3.mp3", "4.mp3", "5.mp3", "6.mp3");
//Musics.load("1.mp3", "2.mp3", "3.mp3", "4.mp3", "5.mp3", "6.mp3");
DefaultKeybinds.load();
@@ -318,7 +318,7 @@ public class Control extends Module{
dialog.buttons().addButton("$text.ok", dialog::hide).size(100f, 60f);
dialog.content().add("The beta version you are about to play should be considered very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " +
"A large portion of content is still unimplemented. \nAll current art and UI is temporary, and will be re-drawn before release. " +
"\n\n[accent]Saves and maps may be corrupted without warning between updates.[] You have been warned!").wrap().width(500f);
"\n\n[accent]Saves and maps may be corrupted without warning between updates.[] You have been warned!").wrap().width(400f);
dialog.show();
});
@@ -330,7 +330,7 @@ public class Control extends Module{
Timers.run(4f, () -> {
FloatingDialog dialog = new FloatingDialog("[orange]Attention![]");
dialog.buttons().addButton("$text.ok", dialog::hide).size(100f, 60f);
dialog.content().add("You might have noticed that 4.0 does not have any sound.\nThis is [orange]intentional![] Sound will be added in a later update.\n\n[LIGHT_GRAY](now stop reporting this as a bug)").wrap().width(500f);
dialog.content().add("You might have noticed that 4.0 does not have any sound.\nThis is [orange]intentional![] Sound will be added in a later update.\n\n[LIGHT_GRAY](now stop reporting this as a bug)").wrap().width(400f);
dialog.show();
});

View File

@@ -53,7 +53,7 @@ public class Logic extends Module{
for(TeamData team : state.teams.getTeams()){
for(Tile tile : team.cores){
if(true){
if(debug){
for(Item item : Item.all()){
if(item.type == ItemType.material){
tile.entity.items.set(item, 1000);

View File

@@ -114,7 +114,7 @@ public class Renderer extends RendererModule{
Cursors.loadCustom("drill");
Cursors.loadCustom("unload");
clearColor = Hue.lightness(0.4f);
clearColor = Hue.lightness(0f);
clearColor.a = 1f;
background.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
@@ -157,6 +157,9 @@ public class Renderer extends RendererModule{
if(world.getSector() == null){
clampCamera(-tilesize / 2f, -tilesize / 2f + 1, world.width() * tilesize - tilesize / 2f, world.height() * tilesize - tilesize / 2f);
}else{
camera.position.x = Mathf.clamp(camera.position.x, -tilesize / 2f, world.width() * tilesize - tilesize / 2f);
camera.position.y = Mathf.clamp(camera.position.y, -tilesize / 2f, world.height() * tilesize - tilesize / 2f);
}
float prex = camera.position.x, prey = camera.position.y;
@@ -197,6 +200,8 @@ public class Renderer extends RendererModule{
Graphics.surface(pixelSurface, false);
Graphics.clear(clearColor);
drawPadding();
blocks.drawFloor();

View File

@@ -78,18 +78,6 @@ public class FloorRenderer{
int camx = Mathf.scl(camera.position.x, chunksize * tilesize);
int camy = Mathf.scl(camera.position.y, chunksize * tilesize);
for(int x = -crangex; x <= crangex; x++){
for(int y = -crangey; y <= crangey; y++){
int worldx = camx + x;
int worldy = camy + y;
if(!Mathf.inBounds(worldx, worldy, cache))
continue;
fillChunk((worldx) * chunksize * tilesize, (worldy) * chunksize * tilesize);
}
}
int layers = CacheLayer.values().length;
drawnLayers.clear();
@@ -185,7 +173,7 @@ public class FloorRenderer{
}
private void fillChunk(float x, float y){
Draw.color(Color.GRAY);
Draw.color(Color.BLACK);
Fill.crect(x, y, chunksize * tilesize, chunksize * tilesize);
Draw.color();
}
@@ -202,7 +190,7 @@ public class FloorRenderer{
Tile tile = world.tile(tilex - gutter, tiley - gutter);
Floor floor = null;
if(tile == null && sector != null){
if(tile == null && sector != null && tilex < world.width() + gutter*2 && tiley < world.height() + gutter*2){
GenResult result = world.generator().generateTile(sector.x, sector.y, tilex - gutter, tiley - gutter);
floor = (Floor) result.floor;
}else if(tile != null){
@@ -233,7 +221,7 @@ public class FloorRenderer{
Floor floor;
if(tile == null){
if(sector != null){
if(sector != null && tilex < world.width() + gutter*2 && tiley < world.height() + gutter*2){
GenResult result = world.generator().generateTile(sector.x, sector.y, tilex - gutter, tiley - gutter);
floor = (Floor)result.floor;
gutterTile.setFloor(floor);

View File

@@ -164,9 +164,7 @@ public abstract class InputHandler extends InputAdapter{
return false;
}
/**
* Handles tile tap events that are not platform specific.
*/
/**Handles tile tap events that are not platform specific.*/
boolean tileTapped(Tile tile){
tile = tile.target();

View File

@@ -443,9 +443,7 @@ public class MobileInput extends InputHandler implements GestureListener{
//call tap events
if(pointer == 0 && !selecting && mode == none){
if(!tileTapped(cursor.target()) && !tryTapPlayer(worldx, worldy)){
tryBeginMine(cursor);
}
tryTapPlayer(worldx, worldy);
}
return false;
@@ -567,6 +565,8 @@ public class MobileInput extends InputHandler implements GestureListener{
//add to selection queue if it's a valid BREAK position
cursor = cursor.target();
selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy()));
}else if(!tileTapped(cursor.target()) && !canTapPlayer(worldx, worldy)){
tryBeginMine(cursor);
}else{ //else, try and carry units
if(player.getCarry() != null){
player.dropCarry(); //drop off unit

View File

@@ -117,7 +117,7 @@ public class Sectors{
int toX = x * sectorSize / sectorImageSize;
int toY = y * sectorSize / sectorImageSize;
GenResult result = world.generator().generateTile(sector.x, sector.y, toX, toY);
GenResult result = world.generator().generateTile(sector.x, sector.y, toX, toY, false);
int color = ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation);
pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color);

View File

@@ -206,6 +206,10 @@ public class WorldGenerator{
}
public GenResult generateTile(int sectorX, int sectorY, int localX, int localY){
return generateTile(sectorX, sectorY, localX, localY, true);
}
public GenResult generateTile(int sectorX, int sectorY, int localX, int localY, boolean detailed){
int x = sectorX * sectorSize + localX;
int y = sectorY * sectorSize + localY;
@@ -243,7 +247,7 @@ public class WorldGenerator{
if(dst < elevDip){
elevation -= (elevDip - dst) / elevDip * 3.0;
}else if(r > 0.9){
}else if(detailed && r > 0.9){
floor = Blocks.water;
elevation = 0;
@@ -252,7 +256,7 @@ public class WorldGenerator{
}
}
if(wall == Blocks.air && decoration.containsKey(floor) && random.chance(0.03)){
if(detailed && wall == Blocks.air && decoration.containsKey(floor) && random.chance(0.03)){
wall = decoration.get(floor);
}