MoveEdges are outer limit of Movement

Textures renamed and reorganized
New (not optimal) obstacleTextures added
This commit is contained in:
=
2016-12-28 10:23:12 +01:00
parent 45b9c41ea4
commit decbf80ed5
117 changed files with 5437 additions and 2114 deletions

View File

@ -66,7 +66,7 @@
</ceilingTiles>
<obstacles class="java.util.ArrayList">
<obstacleData floating="true" moving="true" deadly="true" leftEdge="1.9166656" rightEdge="2.4166656" height="0.5" y="0.2766666">
<moveComponent width="0.0" height="1.717" x="2.1666656" y="0.2766666" speed="0.0"/>
<moveComponent width="0.0" height="1.717" x="2.1666656" y="0.2766666" speed="0.664"/>
</obstacleData>
<obstacleData floating="false" moving="true" deadly="false" leftEdge="5.3966713" rightEdge="5.8966713" height="0.5" y="-0.35000002">
<moveComponent width="2.841" height="0.0" x="5.6466713" y="-0.35000002" speed="0.0"/>
@ -88,8 +88,11 @@
<tileData x="0.0" width="6.0"/>
</ceilingTiles>
<obstacles class="java.util.ArrayList">
<obstacleData floating="true" moving="true" deadly="false" leftEdge="-0.15199986" rightEdge="0.19200015" height="0.357" y="0.026666664">
<moveComponent width="1.288" height="1.111" x="0.020000145" y="0.026666664" speed="0.5"/>
<obstacleData floating="false" moving="true" deadly="false" leftEdge="-0.55199987" rightEdge="-0.20799984" height="0.357" y="-0.42150003">
<moveComponent width="0.0" height="1.086" x="-0.37999985" y="-0.42150003" speed="0.5"/>
</obstacleData>
<obstacleData floating="true" moving="true" deadly="false" leftEdge="-1.6233331" rightEdge="-1.1233331" height="0.5" y="-0.35000002">
<moveComponent width="0.0" height="1.275" x="-1.3733331" y="-0.35000002" speed="0.508"/>
</obstacleData>
</obstacles>
<stars class="java.util.ArrayList"/>

View File

@ -30,6 +30,7 @@ public class Obstacle extends Entity {
this.floating = data.isFloating();
this.moving = data.isMoving();
this.moveComponent = data.getMoveComponent();
moveComponent.shrink(new Vector(super.getWidth(), super.getHeight()));
if (!floating)
super.setToTerrain(terrainEdge);
@ -55,7 +56,6 @@ public class Obstacle extends Entity {
float distanceLeft = moveProgress * totalMoveDistance - distance;
Vector direction = new Vector(nextVertex.getX(), nextVertex.getY()).translate(new Vector(lastVertex.getX(), lastVertex.getY()).negate());
direction = direction.mul(0.5f * distanceLeft);
GameLog.i("Direction: "+direction.toString());
super.setPosition(moveComponent.getPositionOfVertex(lastVertex).translate(direction));
return;
}
@ -73,10 +73,14 @@ public class Obstacle extends Entity {
}
private void setTextureAtlasIndex() {
if (deadly)
if (deadly && floating)
super.getTexture().setAtlasIndex(1);
if (floating)
else if(deadly)
super.getTexture().setAtlasIndex(2);
else if(floating)
super.getTexture().setAtlasIndex(0);
else
super.getTexture().setAtlasIndex(3);
}
public boolean isMoving() {

View File

@ -21,22 +21,15 @@ public class TexturePack {
public final Texture playerArrow;
public final Texture player;
public final Texture star;
public final Texture blueParticle;
public final Texture yellowParticle;
public final Texture redParticle;
public TexturePack(Context context) {
loader = new TextureLoader(context);
goal = loadTexture(R.drawable.goal);
player = loadTexture(R.drawable.ball);
playerArrow = loadTexture(R.drawable.playerarrow);
player = loadTexture(R.drawable.playershapes_ball);
playerArrow = loadTexture(R.drawable.guis_playerarrow);
star = loadTexture(R.drawable.star);
blueParticle = loadTexture(R.drawable.blueparticle);
yellowParticle = loadTexture(R.drawable.yellowparticle);
redParticle = loadTexture(R.drawable.redparticle);
ToolType.loadAllToolTextures(this);
World.loadAllSpecificTextures(this);
}

View File

@ -21,7 +21,7 @@ public class ToolSlot {
public int getDrawable(){
if(locked)
return R.drawable.lockedbutton;
return R.drawable.tools_lockedbutton;
else
return toolType.getButtonDrawable();
}

View File

@ -13,10 +13,10 @@ public enum ToolType {
//Check newInstance when new Tool is added!
RAMP("Ramp", R.drawable.ramp, R.drawable.rampbutton, R.raw.ramp, 3f, 0),
SPRING("Spring", R.drawable.spring, R.drawable.springbutton, R.raw.ramp, 4f, 5),
MAGNET("Magnet", R.drawable.magnet, R.drawable.magnetbutton, R.raw.ramp, 6f, 10),
BOMB("Bomb", R.drawable.bomb, R.drawable.bombbutton, R.raw.ramp, 6f, 12),
NONE("None", -1, R.drawable.emptybutton, -1, 0, 0);
SPRING("Spring", R.drawable.tools_spring, R.drawable.tools_springbutton, R.raw.ramp, 4f, 5),
MAGNET("Magnet", R.drawable.tools_magnet, R.drawable.tools_magnetbutton, R.raw.ramp, 6f, 10),
BOMB("Bomb", R.drawable.tools_bomb, R.drawable.tools_bombbutton, R.raw.ramp, 6f, 12),
NONE("None", -1, R.drawable.tools_emptybutton, -1, 0, 0);
private String name;
private int toolTextureId;

View File

@ -44,4 +44,13 @@ public class MoveComponent {
return new Vector(x, y);
}
public void shrink(Vector value){
this.width -= value.getX();
this.height -= value.getY();
if(width < 0)
width = 0;
if(height < 0)
height = 0;
}
}

View File

@ -12,9 +12,9 @@ import com.example.julian.endlessroll.entities.textures.TexturePack;
public enum World {
GRASSLANDS(0, "Grasslands", R.drawable.grasslands_preview, R.drawable.background, R.drawable.terrain, R.drawable.obstacle),
TESTCAVE(1, "Testcave", R.drawable.grasslands_preview, R.drawable.background_cave, R.drawable.terrain, R.drawable.obstacle),
ICY_MOUNTAINS(2, "Icy Mountains", R.drawable.grasslands_preview, R.drawable.background_icymountains, R.drawable.terrain, R.drawable.obstacle);
GRASSLANDS(0, "Grasslands", R.drawable.previews_grass, R.drawable.backgrounds_game_grass, R.drawable.terrain_t_grass, R.drawable.obstacles_grass),
TESTCAVE(1, "Testcave", R.drawable.previews_grass, R.drawable.backgrounds_game_cave, R.drawable.terrain_t_grass, R.drawable.obstacles_cave),
ICY_MOUNTAINS(2, "Icy Mountains", R.drawable.previews_grass, R.drawable.backgrounds_game_mountains, R.drawable.terrain_t_grass, R.drawable.obstacles_mountains);
private int index;
private String name;

View File

@ -28,7 +28,7 @@ public class BountyMessage {
}
public BountyMessage(Context context) {
this(context, R.drawable.unlockedbutton, "Tool-Slot unlocked");
this(context, R.drawable.tools_unlockedbutton, "Tool-Slot unlocked");
}
private BountyMessage(Context context, @DrawableRes int imageId, String text) {

View File

@ -49,7 +49,7 @@ public class ToolButton {
private ImageView createImageView(ToolType type, int id) {
ImageView view = (ImageView) layout.findViewById(id);
if (locked)
view.setImageResource(R.drawable.lockedbutton);
view.setImageResource(R.drawable.tools_lockedbutton);
else
view.setImageResource(type.getButtonDrawable());
view.setBackgroundDrawable(createColoredBackground());

View File

@ -59,7 +59,7 @@ public class ToolOfferSlot implements View.OnClickListener {
this.locked = locked;
if (locked) {
title.setText("Level up to unlock");
image.setImageResource(R.drawable.lockedbutton);
image.setImageResource(R.drawable.tools_lockedbutton);
} else {
title.setText(toolType.getName());
image.setImageResource(toolType.getButtonDrawable());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:context=".main.GameActivity">
<item android:state_pressed="true" android:state_enabled="true">
<shape>
<corners android:radius="20dp" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
<stroke android:width="1dp" android:color="#992f2f" />
<solid android:color="#ef4444" />
</shape>
</item>
<item android:state_pressed="false" android:state_enabled="true">
<shape>
<corners android:radius="20dp" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
<stroke android:width="1dp" android:color="#992f2f" />
<gradient android:angle="270" android:endColor="#992f2f" android:startColor="#ef4444" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners android:radius="20dp" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
<stroke android:width="1dp" android:color="#992f2f" />
<gradient android:angle="270" android:endColor="#a15d5d" android:startColor="#b73d3d" />
</shape>
</item>
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="47dp" />
<gradient
android:centerColor="#669dd4"
android:centerX="50%"
android:centerY="50%"
android:endColor="#F7F9FF"
android:gradientRadius="300"
android:startColor="#a07bbc"
android:type="radial" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="20dp" />
<size
android:width="200dp"
android:height="150dp" />
<stroke
android:width="10dp"
android:color="#b11a1a" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false"
android:drawable="@drawable/sound_off" />
<item android:state_checked="true"
android:drawable="@drawable/sound_on" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="3dp" />
<solid
android:color="#715f5f"/>
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<stroke
android:width="2dp"
android:color="#635e5e" />
</shape>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="#00fff700" />
<corners android:radius="200dp" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip android:gravity="right">
<shape android:shape="rectangle">
<gradient
android:angle="45"
android:endColor="#a06c6c6c"
android:startColor="#a0ababab" />
<corners android:radius="200dp" />
</shape>
</clip>
</item>
</layer-list>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="30dp" />
<gradient
android:centerX="50%"
android:centerY="50%"
android:endColor="#82f7f9ff"
android:startColor="#820077ff"
android:angle="45"
android:type="linear" />
<padding
android:bottom="5dp"
android:left="10dp"
android:right="15dp"
android:top="5dp" />
<stroke
android:width="2dp"
android:color="#7826adbc" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="20dp" />
<gradient
android:centerX="0%"
android:centerY="0%"
android:endColor="#ff71a5"
android:startColor="#d7fd00"
android:angle="315"
android:type="linear" />
<padding
android:bottom="10dp"
android:left="0dp"
android:right="0dp"
android:top="10dp" />
<stroke
android:width="4dp"
android:color="#74ff71d0" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -12,7 +12,7 @@
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:src="@drawable/pausebutton" />
android:src="@drawable/guis_pausebutton" />
<include
android:id="@+id/game_toolbuttonbar"

View File

@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/levelbutton_background"
android:background="@drawable/xml_levelbutton_background"
android:layout_margin="10dp">
<TextView
@ -26,7 +26,7 @@
android:id="@+id/levelbutton_lock"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/lock"
android:src="@drawable/lock_locked"
android:layout_centerInParent="true"
android:visibility="invisible"/>

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/menu_background">
android:background="@drawable/backgrounds_menu_grass">
<include
layout="@layout/topbar"

View File

@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/levelup_mainlayout"
android:background="@drawable/levelupbackground">
android:background="@drawable/backgrounds_menu_levelup">
<LinearLayout
android:layout_width="match_parent"

View File

@ -2,7 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shortmenubackground">
android:background="@drawable/backgrounds_menu_shortmenu">
<include
android:layout_width="match_parent"

View File

@ -9,7 +9,7 @@
android:layout_width="110dp"
android:layout_height="110dp"
android:text="Play"
android:background="@drawable/ball"
android:background="@drawable/playershapes_ball"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="44dp"
@ -29,7 +29,7 @@
android:id="@+id/startscreen_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/sound_toggle"
android:background="@drawable/xml_sound_toggle"
android:textOff=""
android:textOn=""
android:layout_below="@+id/startscreen_play"

View File

@ -8,7 +8,7 @@
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:background="@drawable/tool_slot_background"
android:background="@drawable/xml_tool_slot_background"
android:src="@drawable/rampbutton" />
</FrameLayout>

View File

@ -25,7 +25,7 @@
android:layout_centerInParent="true"
android:max="100"
android:progress="100"
android:progressDrawable="@drawable/toolprogressbarlayers" />
android:progressDrawable="@drawable/xml_toolprogressbarlayers" />
</RelativeLayout>

View File

@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/menu_background">
android:background="@drawable/backgrounds_menu_grass">
<include
android:id="@+id/toolshop_topbar"

View File

@ -60,7 +60,7 @@
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:layout_toStartOf="@+id/topbar_toolshop"
android:background="@drawable/sound_toggle"
android:background="@drawable/xml_sound_toggle"
android:textOff=""
android:textOn="" />

View File

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/unlock_message_background">
android:background="@drawable/xml_unlock_message_background">
<ImageView
android:layout_width="40dp"

View File

@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="220dp"
android:layout_height="match_parent"
android:background="@drawable/worldbutton_background">
android:background="@drawable/xml_worldbutton_background">
<TextView
android:id="@+id/worldbutton_title"
@ -23,7 +23,7 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:adjustViewBounds="true"
android:src="@drawable/grasslands_preview" />
android:src="@drawable/previews_grass" />
<ImageView
android:id="@+id/worldbutton_lock"
@ -32,7 +32,7 @@
android:layout_alignBottom="@+id/worldbutton_preview"
android:layout_alignLeft="@+id/worldbutton_preview"
android:layout_alignStart="@+id/worldbutton_preview"
android:src="@drawable/lock"
android:src="@drawable/lock_locked"
android:visibility="visible" />
<RelativeLayout
@ -82,7 +82,7 @@
<ImageView
android:layout_width="30sp"
android:layout_height="30sp"
android:src="@drawable/unlocked"
android:src="@drawable/lock_unlocked"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"

View File

@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/menu_background">
android:background="@drawable/backgrounds_menu_grass">
<include
android:id="@+id/worlds_topbar"

View File

@ -9,7 +9,7 @@
</style>
<style name="customButton">
<item name="android:background">@drawable/custom_button</item>
<item name="android:background">@drawable/xml_custom_button</item>
<item name="android:textColor">@android:color/white</item>
<item name="android:textSize">15sp</item>
<item name="android:shadowColor">#646363</item>