Commit ecf1a6c4 authored by Matyáš Latner's avatar Matyáš Latner

#309 Nasazení nové grafiky psa a trezoru

parent 60d621ec
obb/potme/gfx/objects/safe.png

3 KB | W: | H:

obb/potme/gfx/objects/safe.png

3.25 KB | W: | H:

obb/potme/gfx/objects/safe.png
obb/potme/gfx/objects/safe.png
obb/potme/gfx/objects/safe.png
obb/potme/gfx/objects/safe.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -68,7 +68,8 @@ public class ResourceManager {
private static final String ASSET_OBSTACLES = "obstacles/";
public static final String OBSTACLE_DOOR_CLOSED = ASSET_OBSTACLES + "door_closed.png";
public static final String OBSTACLE_DOOR_OPENED = ASSET_OBSTACLES + "door_opened.png";
public static final String OBSTACLE_DOG = ASSET_OBSTACLES + "dog.png";
public static final String OBSTACLE_DOG_SLEEP = ASSET_OBSTACLES + "dog_sleep.png";
public static final String OBSTACLE_DOG_ATTACK = ASSET_OBSTACLES + "dog_attack.png";
private static final String ASSET_ACTIONS = "actions/";
public static final String ACTION_GO = ASSET_ACTIONS + "go.png";
......@@ -190,7 +191,8 @@ public class ResourceManager {
loadTexture(engine, context, OBSTACLE_DOOR_CLOSED);
loadTexture(engine, context, OBSTACLE_DOOR_OPENED);
loadTiledTexture(engine, context, OBSTACLE_DOG, 5, 2);
loadTexture(engine, context, OBSTACLE_DOG_SLEEP);
loadTexture(engine, context, OBSTACLE_DOG_ATTACK);
loadTexture(engine, context, ACTION_GO);
loadTexture(engine, context, ACTION_LEFT);
......
......@@ -54,7 +54,7 @@ public class GoActionRule extends AbstractActionTypeRule {
} else if (obstacleInDirection != null && obstacleInDirection.isEnabled()){
crashToTileMapPosition(potmeActivity, true, tileMap, player, mapStartPositionX, mapStartPositionY, actualTileMapPosition, nextTileMapPosition);
playRandomSoundFromGroup(obstacleInDirection.getMapObstacleType().getSoundGroup());
obstacleInDirection.tryToPlayAnimatedObstacleActiveSprite();
obstacleInDirection.reactWithPlayer();
performOnActionFinishWithDelay(player, finishedListener, false, PotmeActivity.ERROR_ACTION_DELAY);
} else {
player.walkToTileMapPosition(tileMap, mapStartPositionX, mapStartPositionY, actualTileMapPosition, nextTileMapPosition, new EntityModifierListenerAdapter() {
......
......@@ -83,9 +83,11 @@ public class MapObstacle {
}
}
public void tryToPlayAnimatedObstacleActiveSprite() {
public void reactWithPlayer() {
if (mapObstacleActiveSprite != null && mapObstacleType.isAnimated()) {
((AnimatedSprite)mapObstacleActiveSprite).animate(ANIMATION_FRAME_DURATION, false);
} else {
setInactive();
}
}
......
......@@ -36,8 +36,8 @@ public enum MapObstacleType {
DOOR_H(ResourceManager.OBSTACLE_DOOR_CLOSED, false, ResourceManager.OBSTACLE_DOOR_OPENED, 0, ResourceManager.BUMPS, new ArrayList<MapObstaclePosition>(Arrays.asList(new MapObstaclePosition[] {MapObstaclePosition.BOTTOM_POSITION})), 1),
DOOR_V(ResourceManager.OBSTACLE_DOOR_CLOSED, false, ResourceManager.OBSTACLE_DOOR_OPENED, 1, ResourceManager.BUMPS, new ArrayList<MapObstaclePosition>(Arrays.asList(new MapObstaclePosition[] {MapObstaclePosition.LEFT_POSITION})), 1),
DOG_H (ResourceManager.OBSTACLE_DOG, true, null, 0, ResourceManager.BARKS, new ArrayList<MapObstaclePosition>(Arrays.asList(new MapObstaclePosition[] {MapObstaclePosition.BOTTOM_POSITION})), 1.5f),
DOG_V (ResourceManager.OBSTACLE_DOG, true, null, 3, ResourceManager.BARKS, new ArrayList<MapObstaclePosition>(Arrays.asList(new MapObstaclePosition[] {MapObstaclePosition.LEFT_POSITION})), 1.5f);
DOG_H (ResourceManager.OBSTACLE_DOG_SLEEP, false, ResourceManager.OBSTACLE_DOG_ATTACK, 0, ResourceManager.BARKS, new ArrayList<MapObstaclePosition>(Arrays.asList(new MapObstaclePosition[] {MapObstaclePosition.BOTTOM_POSITION})), 1.5f),
DOG_V (ResourceManager.OBSTACLE_DOG_SLEEP, false, ResourceManager.OBSTACLE_DOG_ATTACK, 3, ResourceManager.BARKS, new ArrayList<MapObstaclePosition>(Arrays.asList(new MapObstaclePosition[] {MapObstaclePosition.LEFT_POSITION})), 1.5f);
public enum MapObstaclePosition {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment