-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from AlxTray/new-platforms-overlay-textures
New platforms overlay textures
- Loading branch information
Showing
32 changed files
with
390 additions
and
254 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
"platforms": [ | ||
{ | ||
"type": "normal", | ||
"orientation": "NORTH", | ||
"x": 0, | ||
"y": 0, | ||
"height": 54, | ||
|
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 was deleted.
Oops, something went wrong.
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.
33 changes: 0 additions & 33 deletions
33
core/src/main/java/io/github/alxtray/groundclimber/bodies/CrackedPlatform.java
This file was deleted.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
core/src/main/java/io/github/alxtray/groundclimber/bodies/EnvironmentObject.java
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,9 +1,12 @@ | ||
package io.github.alxtray.groundclimber.bodies; | ||
|
||
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | ||
import io.github.alxtray.groundclimber.renderers.EnvironmentObjectVisitor; | ||
import io.github.alxtray.groundclimber.enums.ObjectStatus; | ||
import io.github.alxtray.groundclimber.visitors.EnvironmentObjectListenerVisitor; | ||
import io.github.alxtray.groundclimber.visitors.EnvironmentObjectRenderVisitor; | ||
|
||
public abstract class EnvironmentObject { | ||
public abstract void acceptRender(EnvironmentObjectVisitor visitor, SpriteBatch batch); | ||
public abstract void acceptRender(EnvironmentObjectRenderVisitor visitor, SpriteBatch batch); | ||
public abstract ObjectStatus acceptContact(EnvironmentObjectListenerVisitor visitor, Player player); | ||
|
||
} |
11 changes: 0 additions & 11 deletions
11
core/src/main/java/io/github/alxtray/groundclimber/bodies/NormalPlatform.java
This file was deleted.
Oops, something went wrong.
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
27 changes: 27 additions & 0 deletions
27
core/src/main/java/io/github/alxtray/groundclimber/bodies/platforms/BouncyPlatform.java
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,27 @@ | ||
package io.github.alxtray.groundclimber.bodies.platforms; | ||
|
||
import com.badlogic.gdx.graphics.Texture; | ||
import com.badlogic.gdx.physics.box2d.World; | ||
import io.github.alxtray.groundclimber.bodies.Player; | ||
import io.github.alxtray.groundclimber.enums.PlatformOrientation; | ||
import io.github.alxtray.groundclimber.enums.ObjectStatus; | ||
import io.github.alxtray.groundclimber.utilities.AssetLibrary; | ||
import io.github.alxtray.groundclimber.visitors.EnvironmentObjectListenerVisitor; | ||
|
||
public class BouncyPlatform extends Platform { | ||
public BouncyPlatform(World world, PlatformOrientation orientation, float x, float y, float height, float width) { | ||
super(world, orientation, x, y, height, width); | ||
body.setUserData(this); | ||
} | ||
|
||
public Texture getOverlayTexture() { | ||
return AssetLibrary.getInstance().getAsset("bouncy_platform_overlay", Texture.class); | ||
} | ||
|
||
@Override | ||
public ObjectStatus acceptContact(EnvironmentObjectListenerVisitor visitor, Player player) { | ||
visitor.visitBouncyPlatform(player); | ||
return ObjectStatus.NoChange; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
core/src/main/java/io/github/alxtray/groundclimber/bodies/platforms/CrackedPlatform.java
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,45 @@ | ||
package io.github.alxtray.groundclimber.bodies.platforms; | ||
|
||
import com.badlogic.gdx.graphics.Texture; | ||
import com.badlogic.gdx.physics.box2d.World; | ||
import io.github.alxtray.groundclimber.bodies.Player; | ||
import io.github.alxtray.groundclimber.enums.LogLevel; | ||
import io.github.alxtray.groundclimber.enums.PlatformOrientation; | ||
import io.github.alxtray.groundclimber.enums.ObjectStatus; | ||
import io.github.alxtray.groundclimber.utilities.AssetLibrary; | ||
import io.github.alxtray.groundclimber.utilities.Logger; | ||
import io.github.alxtray.groundclimber.visitors.EnvironmentObjectListenerVisitor; | ||
import text.formic.Stringf; | ||
|
||
public class CrackedPlatform extends Platform { | ||
private int crackLevel; | ||
|
||
public CrackedPlatform(World world, PlatformOrientation orientation, float x, float y, float height, float width) { | ||
super(world, orientation, x, y, height, width); | ||
crackLevel = 0; | ||
body.setUserData(this); | ||
} | ||
|
||
public Texture getOverlayTexture() { | ||
return AssetLibrary.getInstance().getAsset("cracked_platform_overlay", Texture.class); | ||
} | ||
|
||
@Override | ||
public ObjectStatus acceptContact(EnvironmentObjectListenerVisitor visitor, Player player) { | ||
visitor.visitCrackedPlatform(this); | ||
return (crackLevel >= 3) ? ObjectStatus.Remove : ObjectStatus.NoChange; | ||
} | ||
|
||
public void incrementCrackLevel() { | ||
crackLevel++; | ||
Logger.log( | ||
"CrackedPlatform", | ||
Stringf.format( | ||
"Cracked level for platform at (%s, %s) is now %s", | ||
body.getPosition().x, | ||
body.getPosition().y, | ||
crackLevel), | ||
LogLevel.DEBUG); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
core/src/main/java/io/github/alxtray/groundclimber/bodies/platforms/GravityPlatform.java
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,27 @@ | ||
package io.github.alxtray.groundclimber.bodies.platforms; | ||
|
||
import com.badlogic.gdx.graphics.Texture; | ||
import com.badlogic.gdx.physics.box2d.World; | ||
import io.github.alxtray.groundclimber.bodies.Player; | ||
import io.github.alxtray.groundclimber.enums.PlatformOrientation; | ||
import io.github.alxtray.groundclimber.enums.ObjectStatus; | ||
import io.github.alxtray.groundclimber.utilities.AssetLibrary; | ||
import io.github.alxtray.groundclimber.visitors.EnvironmentObjectListenerVisitor; | ||
|
||
public class GravityPlatform extends Platform { | ||
public GravityPlatform(World world, PlatformOrientation orientation, float x, float y, float height, float width) { | ||
super(world, orientation, x, y, height, width); | ||
body.setUserData(this); | ||
} | ||
|
||
public Texture getOverlayTexture() { | ||
return AssetLibrary.getInstance().getAsset("gravity_platform_overlay", Texture.class); | ||
} | ||
|
||
@Override | ||
public ObjectStatus acceptContact(EnvironmentObjectListenerVisitor visitor, Player player) { | ||
visitor.visitGravityPlatform(player); | ||
return ObjectStatus.NoChange; | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
core/src/main/java/io/github/alxtray/groundclimber/bodies/platforms/NormalPlatform.java
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,12 @@ | ||
package io.github.alxtray.groundclimber.bodies.platforms; | ||
|
||
import com.badlogic.gdx.physics.box2d.World; | ||
import io.github.alxtray.groundclimber.enums.PlatformOrientation; | ||
|
||
public class NormalPlatform extends Platform { | ||
public NormalPlatform(World world, PlatformOrientation orientation, float x, float y, float height, float width) { | ||
super(world, orientation, x, y, height, width); | ||
body.setUserData(this); | ||
} | ||
|
||
} |
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
Oops, something went wrong.