Skip to content

Commit

Permalink
Add methods to set multiple layers at once
Browse files Browse the repository at this point in the history
  • Loading branch information
silas-hw committed Aug 12, 2024
1 parent e854ab2 commit 234ebbd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/src/com/mygdx/scngame/physics/Box.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public void setMask(int maskIndex, boolean set) {
}
}

public void setMasks(int[] maskIndices, boolean set) {
for(int index : maskIndices) {
setMask(index, set);
}
}

/**
*
* @param layerIndex the 0th indexed collision layer to set
Expand All @@ -47,6 +53,12 @@ public void setLayer(int layerIndex, boolean set) {
}
}

public void setLayers(int[] layerIndices, boolean set) {
for(int index : layerIndices) {
setLayer(index, set);
}
}

/**
* determines whether a colliding Box will have a hard or soft collision with this Box
* <p>
Expand Down

0 comments on commit 234ebbd

Please sign in to comment.