-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The torque is torqueing my head
- Loading branch information
Showing
36 changed files
with
563 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#define HIGHP | ||
|
||
uniform sampler2D u_texture; | ||
uniform sampler2D u_normalMap; | ||
uniform vec2 u_lightDirection; | ||
uniform float u_lightIntensity; | ||
varying vec2 v_texCoords; | ||
|
||
void main() { | ||
vec3 normal = texture2D(u_normalMap, v_texCoords).rgb; | ||
normal = normalize(normal * 2.0 - 1.0); // Transform normal from [0,1] range to [-1,1] range | ||
|
||
vec3 lightDir = normalize(vec3(u_lightDirection, 0.0)); | ||
float diff = max(dot(normal, lightDir), 0.0); | ||
|
||
vec4 color = texture2D(u_texture, v_texCoords); | ||
vec3 diffuse = diff * u_lightIntensity * vec3(1.0, 1.0, 1.0); // Adjust light color as needed | ||
|
||
gl_FragColor = vec4(color.rgb * diffuse, color.a); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#define HIGHP | ||
|
||
attribute vec4 a_position; | ||
attribute vec2 a_texCoord; | ||
|
||
varying vec2 v_texCoords; | ||
|
||
void main() { | ||
v_texCoords = a_texCoord; | ||
gl_Position = a_position; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+423 Bytes
assets/sprites/blocks/craftersTemp/bauxite-harvester-rotator-bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package aquarion; | ||
|
||
import arc.graphics.Color; | ||
import arc.graphics.g2d.Draw; | ||
import arc.util.Disposable; | ||
|
||
public class LoadRenderer implements Disposable { | ||
public void draw() { | ||
Draw.color(Color.black); | ||
} | ||
|
||
@Override | ||
public void dispose() { | ||
// Dispose of any resources if necessary | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
package aquarion.blocks; | ||
|
||
import aquarion.AquaAttributes; | ||
import aquarion.AquaItems; | ||
import aquarion.world.blocks.rotPower.TorqueWallCrafter; | ||
import mindustry.content.Items; | ||
import mindustry.type.Category; | ||
import mindustry.world.Block; | ||
import mindustry.world.blocks.production.WallCrafter; | ||
import mindustry.world.meta.Env; | ||
|
||
import static mindustry.gen.Sounds.drill; | ||
import static mindustry.type.ItemStack.with; | ||
|
||
public class AquaCrafters { | ||
public static Block bauxiteHarvester; | ||
public static void loadContent(){ | ||
bauxiteHarvester = new TorqueWallCrafter("bauxite-harvester"){{ | ||
size = 4; | ||
requirements(Category.production, with(Items.lead, 30, AquaItems.bauxite, 65)); | ||
researchCost = with(Items.lead, 15, AquaItems.bauxite, 10); | ||
drillTime = 95; | ||
attribute = AquaAttributes.bauxite; | ||
output = AquaItems.bauxite; | ||
ambientSound = drill; | ||
ambientSoundVolume = 0.04F; | ||
envEnabled|= Env.terrestrial | Env.underwater; | ||
envDisabled|= Env.spores | Env.scorching; | ||
}}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package aquarion.world; | ||
|
||
import aquarion.world.graphs.TorqueGraph; | ||
import arc.util.io.*; | ||
import mindustry.world.modules.*; | ||
|
||
public class TorqueModule{ | ||
public TorqueGraph graph = new TorqueGraph(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
package aquarion.world.blocks.rotPower; | ||
|
||
public interface TorqueBlock { | ||
/** | ||
* Returns the current amount of torque. | ||
*/ | ||
float torque(); | ||
public boolean hasTorque = true; | ||
/** @return rotPower as a fraction of max heat */ | ||
float torqueFract(); | ||
|
||
/** | ||
* Sets the current amount of torque. | ||
*/ | ||
void setTorque(float newTorque); | ||
|
||
/** | ||
* Returns the current amount of torque. | ||
*/ | ||
float getTorque(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package aquarion.world.blocks.rotPower; | ||
|
||
public interface TorqueConsumer{ | ||
public interface TorqueConsumer { | ||
float[] torqueSide(); | ||
float torqueRequirement(); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package aquarion.world.blocks.rotPower; | ||
|
||
import arc.struct.IntSet; | ||
import mindustry.gen.Building; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class TorqueNetwork { | ||
private List<TorqueBlock> connectedTorqueBlocks = new ArrayList<>(); | ||
private float sharedTorque = 0f; // Shared torque value | ||
|
||
public List<TorqueBlock> getConnectedTorqueBlocks(Building start) { | ||
connectedTorqueBlocks.clear(); | ||
collectConnectedTorqueBlocks(start, new IntSet()); | ||
return connectedTorqueBlocks; | ||
} | ||
|
||
private void collectConnectedTorqueBlocks(Building start, IntSet cameFrom) { | ||
if (!cameFrom.add(start.id)) return; // Avoid cycles | ||
|
||
if (start instanceof TorqueBlock torqueBlock) { | ||
connectedTorqueBlocks.add(torqueBlock); | ||
} | ||
|
||
for (var build : start.proximity) { | ||
if (build != null && build.team == start.team && build instanceof TorqueBlock torqueE) { | ||
if (!build.block.rotate || relativeTo(build) == build.rotation) { | ||
collectConnectedTorqueBlocks(build, cameFrom); | ||
} | ||
} | ||
} | ||
} | ||
|
||
public void setSharedTorque(Building start, float torque) { | ||
this.sharedTorque = torque; | ||
// Propagate torque to all connected blocks | ||
for (TorqueBlock block : getConnectedTorqueBlocks(start)) { | ||
block.setTorque(torque); | ||
} | ||
} | ||
|
||
public float getSharedTorque() { | ||
return sharedTorque; | ||
} | ||
|
||
// Helper method to determine relative direction | ||
private int relativeTo(Building build) { | ||
// Implementation of relativeTo method | ||
return 0; // Placeholder | ||
} | ||
} |
Oops, something went wrong.