1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-10-26 09:13:28 +03:00

Fixed some minor bugs

This commit is contained in:
Anuken 2017-10-02 17:14:32 -04:00
parent 77f574e974
commit 3e9aca023a
10 changed files with 18 additions and 14 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
/desktop/packr-out/
/desktop/packr-export/
/core/lib/
*.gif
## Java

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry"
android:versionCode="9"
android:versionName="1.2" >
android:versionCode="10"
android:versionName="2.0" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />

View File

@ -79,7 +79,7 @@ project(":core") {
apply plugin: "java"
dependencies {
compile 'com.github.anuken:ucore:5633a3df2f'
compile 'com.github.anuken:ucore:2a0a7a54cc'
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
}

View File

@ -2,5 +2,7 @@
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "https://raw.githubusercontent.com/gwtproject/gwt/master/distro-source/core/src/gwt-module.dtd">
<module>
<source path="io/anuke/mindustry" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.entities.enemies" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.entities" />
<extend-configuration-property name="gdx.reflect.include" value="java.lang.Class" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.ucore.function.DelayRun" />
</module>

View File

@ -3,6 +3,7 @@ package io.anuke.mindustry.entities;
import static io.anuke.mindustry.Vars.*;
import com.badlogic.gdx.Input.Buttons;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
@ -51,7 +52,7 @@ public class Player extends DestructibleEntity{
float speed = this.speed;
if(Vars.debug)
if(Vars.debug && Inputs.keyDown(Keys.SHIFT_LEFT))
speed *= 3f;
if(health < maxhealth && Timers.get(this, 50))

View File

@ -108,10 +108,9 @@ public class Enemy extends DestructibleEntity{
int x2 = path[node].x, y2 = path[node].y;
if(World.raycast(Mathf.scl2(x, Vars.tilesize), Mathf.scl2(y, Vars.tilesize), x2, y2) != null){
Timers.run(Mathf.random(10f), ()->{
Timers.run(Mathf.random(15f), ()->{
set(x2 * Vars.tilesize, y2 * Vars.tilesize);
});
}
}
@ -173,7 +172,7 @@ public class Enemy extends DestructibleEntity{
String region = ClassReflection.getSimpleName(getClass()).toLowerCase() + "-t" + Mathf.clamp(tier, 1, 3);
//TODO is this necessary?
//TODO is this really necessary?
Draw.getShader(Outline.class).color.set(tierColors[tier-1]);
Draw.getShader(Outline.class).region = Draw.region(region);

View File

@ -205,6 +205,8 @@ public class World{
Tile tile = tile(x, y);
if(tile == null) return false;
if(tile.block() != type && type.canReplace(tile.block())){
return true;
}

View File

@ -68,6 +68,7 @@ public class ProductionBlocks{
dir = (dir+4)%4;
Tile to = tile.getNearby()[dir];
Timers.run(10, ()->{
if(to == null || to.entity == null) return;
to.block().handleItem(to, item, tile);
});
@ -146,7 +147,7 @@ public class ProductionBlocks{
@Override
public String description(){
return "Takes in iron + water, outputs coal.";
return "Takes in iron + water, outputs titanium.";
}
},

View File

@ -105,7 +105,6 @@ public class WeaponBlocks{
}
},
//TODO
mortarturret = new Turret("mortarturret"){
{
rotatespeed = 0.1f;
@ -116,10 +115,10 @@ public class WeaponBlocks{
ammo = Item.coal;
ammoMultiplier = 5;
health = 110;
overPrediction = 0.09f;
}
},
//TODO
laserturret = new LaserTurret("laserturret"){
@ -135,7 +134,6 @@ public class WeaponBlocks{
}
},
//TODO
teslaturret = new Turret("waveturret"){
{
formalName = "tesla turret";
@ -156,7 +154,6 @@ public class WeaponBlocks{
}
},
//TODO
plasmaturret = new Turret("plasmaturret"){
{
inaccuracy = 7f;

View File

@ -34,6 +34,7 @@ public class Turret extends Block{
protected int maxammo = 400;
protected float rotatespeed = 0.2f;
protected float shootCone = 8f;
protected float overPrediction = 0f;
public Turret(String name) {
super(name);
@ -108,7 +109,7 @@ public class Turret extends Block{
if(entity.target != null){
float targetRot = Angles.predictAngle(tile.worldx(), tile.worldy(),
entity.target.x, entity.target.y, entity.target.xvelocity, entity.target.yvelocity, bullet.speed);
entity.target.x, entity.target.y, entity.target.xvelocity, entity.target.yvelocity, bullet.speed + overPrediction);
entity.rotation = MathUtils.lerpAngleDeg(entity.rotation, targetRot,
rotatespeed*Timers.delta());