Skip to content

Commit

Permalink
cleanup formatting and test states
Browse files Browse the repository at this point in the history
  • Loading branch information
MondayHopscotch committed Mar 2, 2024
1 parent 04fec0d commit 1927b63
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 169 deletions.
16 changes: 5 additions & 11 deletions echo/util/SAT.hx
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,8 @@ class SAT {

// collisions used the transformed rect, set the collision data's shape back
// to the original rect
if (!flip) {
col.sa = r;
} else {
col.sb = r;
}
if (!flip) col.sa = r;
else col.sb = r;

return col;
}
Expand Down Expand Up @@ -415,11 +412,8 @@ class SAT {

// collisions were done with a polygon derrived from the provided rect
// so we need to set our collision data shape back to the original rectangle
if (flip) {
col.sb = r;
} else {
col.sa = r;
}
if (flip) col.sb = r;
else col.sa = r;

return col;
}
Expand Down Expand Up @@ -506,7 +500,7 @@ class SAT {
test1 = min1 - max2;
test2 = min2 - max1;

// Preform another test // TODO: What is this test doing, exactly?
// Perform another test
if (test1 > 0 || test2 > 0) {
col.put();
return null;
Expand Down
5 changes: 4 additions & 1 deletion sample/Main.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package;

import state.test.ListenerState;
import state.test.OverlappingSpawnState;
import hxd.Key;
import echo.Echo;
import echo.World;
Expand Down Expand Up @@ -46,9 +48,10 @@ class Main extends BaseApp {

// Set up our Sample States
sample_states = [
OverlappingSpawnState, ListenerState, PolygonState, StackingState, MultiShapeState, ShapesState, GroupsState, StaticState, LinecastState, Linecast2State, TileMapState, TileMapState2,
PolygonState, StackingState, MultiShapeState, ShapesState, GroupsState, StaticState, LinecastState, Linecast2State, TileMapState, TileMapState2,
BezierState, VerletState
];

index = 0;
// Create a State Manager and pass it the World and the first Sample
fsm = new FSM<World>(world, Type.createInstance(sample_states[index], []));
Expand Down
82 changes: 0 additions & 82 deletions sample/state/ListenerState.hx

This file was deleted.

72 changes: 0 additions & 72 deletions sample/state/OverlappingSpawnState.hx

This file was deleted.

2 changes: 1 addition & 1 deletion sample/state/PolygonState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PolygonState extends BaseState {
var b = new Body({
x: Random.range(60, world.width - 60),
y: Random.range(0, world.height / 2),
rotation: 0,
rotation: Random.range(0, 360),
material: material,
shape: {
type: POLYGON,
Expand Down
2 changes: 0 additions & 2 deletions sample/state/StaticState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class StaticState extends BaseState {
shape: {
type: CIRCLE,
radius: Random.range(2, 4),
width: Random.range(2, 4),
height: Random.range(2, 4)
}
});
world.add(b);
Expand Down

0 comments on commit 1927b63

Please sign in to comment.