Skip to content

Instantly share code, notes, and snippets.

View zacharycarter's full-sized avatar
👀
Looking for work!

Tail Wag Games zacharycarter

👀
Looking for work!
View GitHub Profile
package com.carterza.ai.path;
import com.artemis.Entity;
import com.badlogic.gdx.ai.pfa.Connection;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import com.carterza.generation.ship.grid.GridMap;
import java.util.List;
package com.carterza.system.turn;
import com.artemis.Aspect;
import com.artemis.BaseEntitySystem;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.Gdx;
import com.carterza.component.TurnComponent;
import com.carterza.entity.FutureEntityTurn;
package com.carterza.system.ai;
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.systems.IteratingSystem;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ai.GdxAI;
import com.badlogic.gdx.math.Vector2;
import com.carterza.action.BaseAction;
package com.carterza.world;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.math.Vector2;
package com.carterza.generator.spacecraft;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.carterza.generator.graph.ComparablePoint2i;
import com.carterza.generator.graph.Graph;
import com.carterza.generator.graph.Node;
import com.carterza.generator.pathfind.HallwayMover2d;
import com.carterza.generator.pathfind.HallwayPathFinder;
import com.stewsters.util.mapgen.twoDimension.MapGen2d;
public void bfs(Node rootNode){
initializeNodes();
Queue q = new LinkedList();
q.add(rootNode);
rootNode.visited=true;
int parentDistance = 0;
int parentLevel = 0;
rootNode.setLevel(parentLevel);
rootNode.setDistance(parentDistance);
List<Node> nodeList = new ArrayList<Node>();
TreeMap<Integer, List<Node>> nodesSortedByLevel = sc.roomGraph.getNodesSortedByLevel();
Iterator<Map.Entry<Integer, List<Node>>> nodesSortedByLevelIterator = nodesSortedByLevel.entrySet().iterator();
while(nodesSortedByLevelIterator.hasNext()) {
Map.Entry<Integer, List<Node>> e = nodesSortedByLevelIterator.next();
for(Node n : e.getValue()) {
if(n.getParent() == null && e.getKey() != 0) {
for(Edge edge : n.getNeighbors()) {
if(nodesSortedByLevel.get(e.getKey()-1).contains(edge.getNeighbor(n)))
n.setParent(edge.getNeighbor(n));
}
// Star Nest by Pablo Román Andrioli
// This content is under the MIT License.
#define iterations 17
#define formuparam 0.53
#define volsteps 20
#define stepsize 0.1
package com.carterza.world;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
✦ ✦✦ ✦ ✦ ✦
★★ ✦ ★✶ ★☀✳✷ ✶ ★✦★✦
★ ★✦ ☀✷☀✸★✦✳★✳✦✳✶☀✳☀★
☀ ✦ ★✳✶✦☀★☀✳☀★☀ ✦✦✶★✷★ ✦✦
★☀★✶✦✶★✳ ✦✳★ ✦✦ ✦★✳☀✦ ★ ✦