Energy Drawable created + animation for Entity -> AnimatedEntity

A Scene will automatically update all AnimatedEntities
LevelUpBounties no longer grant EP
This commit is contained in:
= 2017-02-20 16:07:12 +01:00
parent 0bad3e064c
commit f252bfd4bd
33 changed files with 295 additions and 199 deletions

View File

@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />

View File

@ -456,7 +456,7 @@ public final class R {
public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f020042;
public static final int abc_textfield_search_default_mtrl_alpha = 0x7f020043;
public static final int abc_textfield_search_material = 0x7f020044;
public static final int notification_template_icon_bg = 0x7f020070;
public static final int notification_template_icon_bg = 0x7f020072;
}
public static final class id {
public static final int action0 = 0x7f0d006a;

View File

@ -1621,44 +1621,46 @@ containing a value of this type.
public static final int backgrounds_menu_grass=0x7f020048;
public static final int backgrounds_menu_levelup=0x7f020049;
public static final int backgrounds_menu_shortmenu=0x7f02004a;
public static final int goal=0x7f02004b;
public static final int guis_pausebutton=0x7f02004c;
public static final int guis_playerarrow=0x7f02004d;
public static final int guis_sound_off=0x7f02004e;
public static final int guis_sound_on=0x7f02004f;
public static final int lock_locked=0x7f020050;
public static final int lock_unlocked=0x7f020051;
public static final int notification_template_icon_bg=0x7f020070;
public static final int obstacles_cave=0x7f020052;
public static final int obstacles_grass=0x7f020053;
public static final int obstacles_mountains=0x7f020054;
public static final int playershapes_ball=0x7f020055;
public static final int previews_grass=0x7f020056;
public static final int purple=0x7f020057;
public static final int ramp=0x7f020058;
public static final int rampbutton=0x7f020059;
public static final int splitter=0x7f02005a;
public static final int star=0x7f02005b;
public static final int star_empty=0x7f02005c;
public static final int star_icon=0x7f02005d;
public static final int terrain_c_grass=0x7f02005e;
public static final int terrain_t_grass=0x7f02005f;
public static final int tools_bomb=0x7f020060;
public static final int tools_bombbutton=0x7f020061;
public static final int tools_emptybutton=0x7f020062;
public static final int tools_lockedbutton=0x7f020063;
public static final int tools_magnet=0x7f020064;
public static final int tools_magnetbutton=0x7f020065;
public static final int tools_spring=0x7f020066;
public static final int tools_springbutton=0x7f020067;
public static final int tools_unlockedbutton=0x7f020068;
public static final int xml_custom_button=0x7f020069;
public static final int xml_levelbutton_background=0x7f02006a;
public static final int xml_sound_toggle=0x7f02006b;
public static final int xml_tool_slot_background=0x7f02006c;
public static final int xml_toolprogressbarlayers=0x7f02006d;
public static final int xml_unlock_message_background=0x7f02006e;
public static final int xml_worldbutton_background=0x7f02006f;
public static final int currency_energy=0x7f02004b;
public static final int currency_energy_atlas=0x7f02004c;
public static final int currency_star=0x7f02004d;
public static final int goal=0x7f02004e;
public static final int guis_pausebutton=0x7f02004f;
public static final int guis_playerarrow=0x7f020050;
public static final int guis_sound_off=0x7f020051;
public static final int guis_sound_on=0x7f020052;
public static final int lock_locked=0x7f020053;
public static final int lock_unlocked=0x7f020054;
public static final int notification_template_icon_bg=0x7f020072;
public static final int obstacles_cave=0x7f020055;
public static final int obstacles_grass=0x7f020056;
public static final int obstacles_mountains=0x7f020057;
public static final int playershapes_ball=0x7f020058;
public static final int previews_grass=0x7f020059;
public static final int purple=0x7f02005a;
public static final int ramp=0x7f02005b;
public static final int rampbutton=0x7f02005c;
public static final int splitter=0x7f02005d;
public static final int star_empty=0x7f02005e;
public static final int star_icon=0x7f02005f;
public static final int terrain_c_grass=0x7f020060;
public static final int terrain_t_grass=0x7f020061;
public static final int tools_bomb=0x7f020062;
public static final int tools_bombbutton=0x7f020063;
public static final int tools_emptybutton=0x7f020064;
public static final int tools_lockedbutton=0x7f020065;
public static final int tools_magnet=0x7f020066;
public static final int tools_magnetbutton=0x7f020067;
public static final int tools_spring=0x7f020068;
public static final int tools_springbutton=0x7f020069;
public static final int tools_unlockedbutton=0x7f02006a;
public static final int xml_custom_button=0x7f02006b;
public static final int xml_levelbutton_background=0x7f02006c;
public static final int xml_sound_toggle=0x7f02006d;
public static final int xml_tool_slot_background=0x7f02006e;
public static final int xml_toolprogressbarlayers=0x7f02006f;
public static final int xml_unlock_message_background=0x7f020070;
public static final int xml_worldbutton_background=0x7f020071;
}
public static final class id {
public static final int action0=0x7f0d006a;
@ -1712,8 +1714,8 @@ containing a value of this type.
public static final int ifRoom=0x7f0d001d;
public static final int image=0x7f0d0026;
public static final int imageView=0x7f0d0064;
public static final int imageView2=0x7f0d00a4;
public static final int imageView3=0x7f0d00a2;
public static final int imageView2=0x7f0d00a6;
public static final int imageView3=0x7f0d00a4;
public static final int info=0x7f0d0075;
public static final int levelbutton_lock=0x7f0d005c;
public static final int levelbutton_star1=0x7f0d0059;
@ -1805,28 +1807,30 @@ containing a value of this type.
public static final int toolshop_topbar=0x7f0d008a;
public static final int toolslot_image=0x7f0d0082;
public static final int topPanel=0x7f0d002e;
public static final int topbar_energycount=0x7f0d0099;
public static final int topbar_energyview=0x7f0d0098;
public static final int topbar_layout=0x7f0d0092;
public static final int topbar_leveldisplay=0x7f0d0094;
public static final int topbar_levellayout=0x7f0d0093;
public static final int topbar_levelprogress=0x7f0d0095;
public static final int topbar_resetButton=0x7f0d009a;
public static final int topbar_soundtoggle=0x7f0d0098;
public static final int topbar_resetButton=0x7f0d009d;
public static final int topbar_soundtoggle=0x7f0d009a;
public static final int topbar_starcount=0x7f0d0097;
public static final int topbar_starcount_decrease=0x7f0d009b;
public static final int topbar_starcount_decrease=0x7f0d009c;
public static final int topbar_starview=0x7f0d0096;
public static final int topbar_toolshop=0x7f0d0099;
public static final int unlockmessage_message=0x7f0d009d;
public static final int unlockmessage_toolimage=0x7f0d009c;
public static final int topbar_toolshop=0x7f0d009b;
public static final int unlockmessage_message=0x7f0d009f;
public static final int unlockmessage_toolimage=0x7f0d009e;
public static final int up=0x7f0d0008;
public static final int useLogo=0x7f0d0012;
public static final int withText=0x7f0d001f;
public static final int worldbutton_levelcount=0x7f0d00a1;
public static final int worldbutton_lock=0x7f0d00a0;
public static final int worldbutton_preview=0x7f0d009f;
public static final int worldbutton_starcount=0x7f0d00a3;
public static final int worldbutton_title=0x7f0d009e;
public static final int worlds_layout=0x7f0d00a6;
public static final int worlds_topbar=0x7f0d00a5;
public static final int worldbutton_levelcount=0x7f0d00a3;
public static final int worldbutton_lock=0x7f0d00a2;
public static final int worldbutton_preview=0x7f0d00a1;
public static final int worldbutton_starcount=0x7f0d00a5;
public static final int worldbutton_title=0x7f0d00a0;
public static final int worlds_layout=0x7f0d00a8;
public static final int worlds_topbar=0x7f0d00a7;
public static final int wrap_content=0x7f0d0020;
}
public static final class integer {

View File

@ -67,6 +67,10 @@
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\lock_unlocked.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\lock_unlocked.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\currency_energy_atlas.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\currency_energy_atlas.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\tools_springbutton.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\tools_springbutton.png"
@ -135,10 +139,6 @@
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\abc_btn_default_mtrl_shape.xml",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\exploded-aar\\com.android.support\\appcompat-v7\\23.1.1\\res\\drawable\\abc_btn_default_mtrl_shape.xml"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\star.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\star.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\backgrounds_menu_grass.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\backgrounds_menu_grass.png"
@ -223,10 +223,18 @@
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\guis_sound_off.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\guis_sound_off.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\currency_energy.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\currency_energy.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\tools_magnetbutton.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\tools_magnetbutton.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\currency_star.png",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\src\\main\\res\\drawable\\currency_star.png"
},
{
"merged": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\res\\merged\\debug\\drawable\\abc_seekbar_track_material.xml",
"source": "C:\\Users\\Julian\\AndroidStudioProjects\\EndlessRoll\\app\\build\\intermediates\\exploded-aar\\com.android.support\\appcompat-v7\\23.1.1\\res\\drawable\\abc_seekbar_track_material.xml"

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/topbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -40,14 +41,35 @@
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/topbar_levellayout"
android:background="@drawable/star" />
android:background="@drawable/currency_star" />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/currency_energy"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/topbar_starcount"
android:layout_toEndOf="@+id/topbar_starcount"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:id="@+id/topbar_energyview" />
<TextView
android:id="@+id/topbar_starcount"
android:id="@+id/topbar_starcount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/topbar_starview"
android:text="100"
android:textColor="#000000"
android:textSize="25sp" />
<TextView
android:id="@+id/topbar_energycount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/topbar_starview"
android:layout_toEndOf="@+id/topbar_energyview"
android:text="100"
android:textColor="#000000"
android:textSize="25sp" />
@ -74,15 +96,6 @@
android:layout_marginRight="5dp"
android:text="Tool-Shop" />
<Button
android:id="@+id/topbar_resetButton"
style="@style/customButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Reset" />
<TextView
android:id="@+id/topbar_starcount_decrease"
android:layout_width="wrap_content"
@ -94,5 +107,18 @@
android:layout_centerVertical="true"
android:layout_alignEnd="@+id/topbar_starcount" />
<Button
android:id="@+id/topbar_resetButton"
style="@style/customButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reset"
android:layout_marginLeft="64dp"
android:layout_marginStart="64dp"
android:layout_alignBaseline="@+id/topbar_soundtoggle"
android:layout_alignBottom="@+id/topbar_soundtoggle"
android:layout_toRightOf="@+id/topbar_energycount"
android:layout_toEndOf="@+id/topbar_energycount" />
</RelativeLayout>

View File

@ -76,7 +76,7 @@
android:layout_marginRight="4dp"
android:layout_toLeftOf="@+id/worldbutton_starcount"
android:layout_toStartOf="@+id/worldbutton_starcount"
android:src="@drawable/star"
android:src="@drawable/currency_star"
android:id="@+id/imageView2" />
<ImageView

View File

@ -469,44 +469,46 @@ int drawable backgrounds_game_mountains 0x7f020047
int drawable backgrounds_menu_grass 0x7f020048
int drawable backgrounds_menu_levelup 0x7f020049
int drawable backgrounds_menu_shortmenu 0x7f02004a
int drawable goal 0x7f02004b
int drawable guis_pausebutton 0x7f02004c
int drawable guis_playerarrow 0x7f02004d
int drawable guis_sound_off 0x7f02004e
int drawable guis_sound_on 0x7f02004f
int drawable lock_locked 0x7f020050
int drawable lock_unlocked 0x7f020051
int drawable notification_template_icon_bg 0x7f020070
int drawable obstacles_cave 0x7f020052
int drawable obstacles_grass 0x7f020053
int drawable obstacles_mountains 0x7f020054
int drawable playershapes_ball 0x7f020055
int drawable previews_grass 0x7f020056
int drawable purple 0x7f020057
int drawable ramp 0x7f020058
int drawable rampbutton 0x7f020059
int drawable splitter 0x7f02005a
int drawable star 0x7f02005b
int drawable star_empty 0x7f02005c
int drawable star_icon 0x7f02005d
int drawable terrain_c_grass 0x7f02005e
int drawable terrain_t_grass 0x7f02005f
int drawable tools_bomb 0x7f020060
int drawable tools_bombbutton 0x7f020061
int drawable tools_emptybutton 0x7f020062
int drawable tools_lockedbutton 0x7f020063
int drawable tools_magnet 0x7f020064
int drawable tools_magnetbutton 0x7f020065
int drawable tools_spring 0x7f020066
int drawable tools_springbutton 0x7f020067
int drawable tools_unlockedbutton 0x7f020068
int drawable xml_custom_button 0x7f020069
int drawable xml_levelbutton_background 0x7f02006a
int drawable xml_sound_toggle 0x7f02006b
int drawable xml_tool_slot_background 0x7f02006c
int drawable xml_toolprogressbarlayers 0x7f02006d
int drawable xml_unlock_message_background 0x7f02006e
int drawable xml_worldbutton_background 0x7f02006f
int drawable currency_energy 0x7f02004b
int drawable currency_energy_atlas 0x7f02004c
int drawable currency_star 0x7f02004d
int drawable goal 0x7f02004e
int drawable guis_pausebutton 0x7f02004f
int drawable guis_playerarrow 0x7f020050
int drawable guis_sound_off 0x7f020051
int drawable guis_sound_on 0x7f020052
int drawable lock_locked 0x7f020053
int drawable lock_unlocked 0x7f020054
int drawable notification_template_icon_bg 0x7f020072
int drawable obstacles_cave 0x7f020055
int drawable obstacles_grass 0x7f020056
int drawable obstacles_mountains 0x7f020057
int drawable playershapes_ball 0x7f020058
int drawable previews_grass 0x7f020059
int drawable purple 0x7f02005a
int drawable ramp 0x7f02005b
int drawable rampbutton 0x7f02005c
int drawable splitter 0x7f02005d
int drawable star_empty 0x7f02005e
int drawable star_icon 0x7f02005f
int drawable terrain_c_grass 0x7f020060
int drawable terrain_t_grass 0x7f020061
int drawable tools_bomb 0x7f020062
int drawable tools_bombbutton 0x7f020063
int drawable tools_emptybutton 0x7f020064
int drawable tools_lockedbutton 0x7f020065
int drawable tools_magnet 0x7f020066
int drawable tools_magnetbutton 0x7f020067
int drawable tools_spring 0x7f020068
int drawable tools_springbutton 0x7f020069
int drawable tools_unlockedbutton 0x7f02006a
int drawable xml_custom_button 0x7f02006b
int drawable xml_levelbutton_background 0x7f02006c
int drawable xml_sound_toggle 0x7f02006d
int drawable xml_tool_slot_background 0x7f02006e
int drawable xml_toolprogressbarlayers 0x7f02006f
int drawable xml_unlock_message_background 0x7f020070
int drawable xml_worldbutton_background 0x7f020071
int id action0 0x7f0d006a
int id action_bar 0x7f0d0041
int id action_bar_activity_content 0x7f0d0000
@ -558,8 +560,8 @@ int id icon 0x7f0d0029
int id ifRoom 0x7f0d001d
int id image 0x7f0d0026
int id imageView 0x7f0d0064
int id imageView2 0x7f0d00a4
int id imageView3 0x7f0d00a2
int id imageView2 0x7f0d00a6
int id imageView3 0x7f0d00a4
int id info 0x7f0d0075
int id levelbutton_lock 0x7f0d005c
int id levelbutton_star1 0x7f0d0059
@ -651,28 +653,30 @@ int id toolshop_tool_offer_layout 0x7f0d0090
int id toolshop_topbar 0x7f0d008a
int id toolslot_image 0x7f0d0082
int id topPanel 0x7f0d002e
int id topbar_energycount 0x7f0d0099
int id topbar_energyview 0x7f0d0098
int id topbar_layout 0x7f0d0092
int id topbar_leveldisplay 0x7f0d0094
int id topbar_levellayout 0x7f0d0093
int id topbar_levelprogress 0x7f0d0095
int id topbar_resetButton 0x7f0d009a
int id topbar_soundtoggle 0x7f0d0098
int id topbar_resetButton 0x7f0d009d
int id topbar_soundtoggle 0x7f0d009a
int id topbar_starcount 0x7f0d0097
int id topbar_starcount_decrease 0x7f0d009b
int id topbar_starcount_decrease 0x7f0d009c
int id topbar_starview 0x7f0d0096
int id topbar_toolshop 0x7f0d0099
int id unlockmessage_message 0x7f0d009d
int id unlockmessage_toolimage 0x7f0d009c
int id topbar_toolshop 0x7f0d009b
int id unlockmessage_message 0x7f0d009f
int id unlockmessage_toolimage 0x7f0d009e
int id up 0x7f0d0008
int id useLogo 0x7f0d0012
int id withText 0x7f0d001f
int id worldbutton_levelcount 0x7f0d00a1
int id worldbutton_lock 0x7f0d00a0
int id worldbutton_preview 0x7f0d009f
int id worldbutton_starcount 0x7f0d00a3
int id worldbutton_title 0x7f0d009e
int id worlds_layout 0x7f0d00a6
int id worlds_topbar 0x7f0d00a5
int id worldbutton_levelcount 0x7f0d00a3
int id worldbutton_lock 0x7f0d00a2
int id worldbutton_preview 0x7f0d00a1
int id worldbutton_starcount 0x7f0d00a5
int id worldbutton_title 0x7f0d00a0
int id worlds_layout 0x7f0d00a8
int id worlds_topbar 0x7f0d00a7
int id wrap_content 0x7f0d0020
int integer abc_config_activityDefaultDur 0x7f0b0001
int integer abc_config_activityShortDur 0x7f0b0002

View File

@ -0,0 +1,25 @@
package com.example.julian.endlessroll.entities;
import com.example.julian.endlessroll.data.Vector;
import com.example.julian.endlessroll.entities.textures.Texture;
import com.example.julian.endlessroll.main.game.Timer;
/**
* Created by Julian on 20.02.2017.
*/
public class AnimatedEntity extends Entity {
protected Animation animation;
public AnimatedEntity(Texture texture, Vector position, float width, float height) {
super(texture, position, width, height);
animation = new Animation();
}
public void update(Timer timer){
animation.update(timer);
super.setTextureAtlasIndex(animation.getCurrentTexIndex());
}
}

View File

@ -4,11 +4,13 @@ import com.example.julian.endlessroll.data.Vector;
import com.example.julian.endlessroll.entities.textures.Texture;
import com.example.julian.endlessroll.levels.PositionData;
public class Energy extends Entity {
public class Energy extends AnimatedEntity {
private final static float SIZE = 0.3f;
public Energy(Texture texture, PositionData data) {
super(texture, new Vector(data.getX(), data.getY()), SIZE, SIZE);
animation.setLooping(true);
animation.setRequiredDelta(130);
}
}

View File

@ -18,6 +18,7 @@ public class TexturePack {
public final Texture playerArrow;
public final Texture player;
public final Texture star;
public final Texture energy;
public TexturePack(Context context) {
loader = new TextureLoader(context);
@ -25,7 +26,8 @@ public class TexturePack {
player = loadTexture(R.drawable.playershapes_ball);
playerArrow = loadTexture(R.drawable.guis_playerarrow);
star = loadTexture(R.drawable.star);
star = loadTexture(R.drawable.currency_star);
energy = loadAtlas(R.drawable.currency_energy_atlas, 2, 2);
ToolType.loadAllToolTextures(this);
Theme.loadAllSpecificTextures(this);

View File

@ -26,11 +26,6 @@ public class Magnet extends Tool {
particleSource.start();
}
@Override
public void update(Timer timer) {
super.update(timer);
}
@Override
public void destroy(DestroyEffect destroyEffect) {
super.destroy(destroyEffect);

View File

@ -11,7 +11,6 @@ import com.example.julian.endlessroll.main.game.Timer;
*/
public class Ramp extends Tool {
public Ramp(Vector position) {
super(ToolType.RAMP, position, .4f, .35f, true, true);
animation.setLooping(true);
@ -32,11 +31,6 @@ public class Ramp extends Tool {
return getBottomEdge() + super.getHeight() * ratio;
}
@Override
public void update(Timer timer) {
super.update(timer);
}
@Override
public void onPlayerCollision(Player player) {
float necessaryY = calcNecessaryPlayerY(player);

View File

@ -1,6 +1,7 @@
package com.example.julian.endlessroll.entities.tools;
import com.example.julian.endlessroll.data.Vector;
import com.example.julian.endlessroll.entities.AnimatedEntity;
import com.example.julian.endlessroll.entities.Animation;
import com.example.julian.endlessroll.entities.Entity;
import com.example.julian.endlessroll.entities.Player;
@ -10,27 +11,20 @@ import com.example.julian.endlessroll.main.game.Timer;
/**
* Created by Julian on 04.01.2016.
*/
public abstract class Tool extends Entity {
public abstract class Tool extends AnimatedEntity {
private boolean placedByRightEdge;
private boolean updateBounds;
private Geometry collisionBounds;
protected Animation animation;
private boolean floating = false;
public Tool(ToolType type, Vector position, float width, float height, boolean updateBounds, boolean placedByRightEdge) {
super(type.getToolTexture(), position, width, height);
this.updateBounds = updateBounds;
this.placedByRightEdge = placedByRightEdge;
animation = new Animation();
collisionBounds = createCollisionBounds();
}
public void update(Timer timer) {
animation.update(timer);
super.setTextureAtlasIndex(animation.getCurrentTexIndex());
}
public abstract void onPlayerCollision(Player player);
protected abstract Geometry createCollisionBounds();

View File

@ -19,7 +19,9 @@ public class LevelUpBounties extends HashMap<Integer, LevelBounty> {
super.put(2, new LevelBounty(5, 0, ToolType.SPRING, false));
super.put(3, new LevelBounty(6, 0, ToolType.MAGNET, true));
super.put(4, new LevelBounty(7, 0, ToolType.BOMB, true));
super.put(5, new LevelBounty(8, 0, ToolType.NONE, false));
super.put(5, new LevelBounty(8, 2, ToolType.NONE, false));
super.put(6, new LevelBounty(8, 1, ToolType.NONE, false));
super.put(7, new LevelBounty(8, 1, ToolType.NONE, false));
loadAllForLevel(level);
}

View File

@ -85,6 +85,13 @@ public class GameActivity extends Activity implements ExceptionHandler, User.LvU
relativeLayout.addView(flipper);
relativeLayout.addView(levelupMessage.getLayout());
//TODO: add Tutorial
//TODO: add Energy count on TopBar
//TODO: show Energy on levelButton if collected
//TODO: Scroll up
//TODO: World button tick for completed levels
//TODO: World/level button: energy
//TODO: Goal animation!
//TODO: Goal screen animation!
setContentView(relativeLayout);
} catch (Exception e) {
onException(e);

View File

@ -229,12 +229,12 @@ public class Game extends Rendering<GameScene> {
for (int i = 1; i <= 3; i++) {
if (collectedStars.contains(i)) {
level.setStarCollected(i, true);
user.increaseStarCount();
user.onStarCollected();
}
}
level.setEnergyCollected(true);
user.increaseEnergyCount();
user.onEnergyCollected();
viewManager.showMessage(levelPack.isLastLevel(level), MessageType.WIN);

View File

@ -71,7 +71,7 @@ public class GameScene extends Scene {
private void tryToAddEnergy(Level level){
PositionData data = level.getEnergyData();
if(data != null && !level.isEnergyCollected()) {
energy = new Energy(textures.player, data);
energy = new Energy(textures.energy, data);
super.add(energy);
}
}
@ -130,7 +130,6 @@ public class GameScene extends Scene {
player.setSpeedByProgress(player.getProgress() / goalX);
synchronized (tools) {
for (Tool tool : tools) {
tool.update(timer);
if (tool instanceof Bomb) {
Bomb bomb = (Bomb) tool;
if (bomb.isExploding())

View File

@ -37,7 +37,6 @@ public class Physics {
public void applyGravity(GameScene scene, Timer timer) {
float gravity = GRAVITY_FORCE * timer.getFrameTime();
GameLog.i("FrameTime: " + timer.getFrameTime());
scene.getPlayer().getMovement().y -= gravity;
synchronized (scene.getTools()) {
@ -47,7 +46,6 @@ public class Physics {
if (tool instanceof Bomb) {
for (Obstacle obstacle : scene.getObstacles()) {
if (detector.quadQuadCollision(obstacle, tool)) {
GameLog.i("collision");
tool.setFloating(true);
tool.getMovement().y = 0;
break;

View File

@ -2,6 +2,7 @@ package com.example.julian.endlessroll.main.game;
import com.example.julian.endlessroll.data.SynchronizedArrayList;
import com.example.julian.endlessroll.data.Vector;
import com.example.julian.endlessroll.entities.AnimatedEntity;
import com.example.julian.endlessroll.entities.Background;
import com.example.julian.endlessroll.entities.Entity;
import com.example.julian.endlessroll.entities.Obstacle;
@ -50,6 +51,8 @@ public abstract class Scene extends SynchronizedArrayList<Entity> {
Iterator<Entity> iterator = super.iterator();
while (iterator.hasNext()) {
Entity entity = iterator.next();
if(entity instanceof AnimatedEntity)
((AnimatedEntity) entity).update(timer);
Vector movement = entity.getMovement();
Vector finalMovement = new Vector(movement).mul(timer.getFrameTime());
entity.move(finalMovement);

View File

@ -3,6 +3,7 @@ package com.example.julian.endlessroll.main.game;
import com.example.julian.endlessroll.entities.tools.ToolSlotSettings;
import com.example.julian.endlessroll.levels.levelup.LevelBounty;
import com.example.julian.endlessroll.levels.levelup.LevelUpBounties;
import com.example.julian.endlessroll.main.GameLog;
/**
* Created by Julian on 10.07.2016.
@ -46,21 +47,23 @@ public class User {
toolSlotSettings.reset();
}
public void increaseStarCount() {
increaseStarCount(1);
public void onStarCollected() {
increaseStarCount(1, true);
}
public void increaseStarCount(int starCount) {
public void increaseStarCount(int starCount, boolean gainEp) {
this.starCount += starCount;
if(gainEp)
gainEp(STAR_EP * starCount);
}
public void increaseEnergyCount() {
increaseEnergyCount(1);
public void onEnergyCollected() {
increaseEnergyCount(1, true);
}
public void increaseEnergyCount(int energyCount) {
public void increaseEnergyCount(int energyCount, boolean gainEp) {
this.energyCount += energyCount;
if(gainEp)
gainEp(ENERGY_EP * energyCount);
}
@ -83,8 +86,8 @@ public class User {
toolSlotSettings.unlockSlotsIfLevelReached(levelUpBounties);
LevelBounty bounty = levelUpBounties.get(level);
if (bounty != null) {
increaseStarCount(bounty.getStarCount());
increaseEnergyCount(bounty.getEnergyCount());
increaseStarCount(bounty.getStarCount(), false);
increaseEnergyCount(bounty.getEnergyCount(), false);
}
lvUpListener.onLvUp(level);
}

View File

@ -139,7 +139,7 @@ public class ToolShopScreen extends Screen<RelativeLayout> implements View.OnCli
} else if (v.equals(priceButton)) {
int costs = selectedToolOfferSlot.getToolType().getCosts();
topBar.showStarcountDecrease(-costs);
user.increaseStarCount(-costs);
user.increaseStarCount(-costs, false);
selectedToolOfferSlot.buy();
priceButton.setVisibility(View.INVISIBLE);
topBar.update();

View File

@ -44,11 +44,11 @@ public class LevelButton extends RelativeLayout {
public void showCollectedStars(boolean[] stars) {
if (stars[0])
this.star1.setImageResource(R.drawable.star);
this.star1.setImageResource(R.drawable.currency_star);
if (stars[1])
this.star2.setImageResource(R.drawable.star);
this.star2.setImageResource(R.drawable.currency_star);
if (stars[2])
this.star3.setImageResource(R.drawable.star);
this.star3.setImageResource(R.drawable.currency_star);
}
public boolean isLocked() {

View File

@ -1,6 +1,7 @@
package com.example.julian.endlessroll.views;
import android.graphics.Typeface;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -11,6 +12,7 @@ import android.widget.TextView;
import com.example.julian.endlessroll.R;
import com.example.julian.endlessroll.levels.levelup.LevelBounty;
import com.example.julian.endlessroll.main.GameActivity;
import com.example.julian.endlessroll.main.GameLog;
import com.example.julian.endlessroll.main.game.User;
import com.example.julian.endlessroll.main.screens.Screen;

View File

@ -25,6 +25,7 @@ public class TopBar extends TopBarData implements View.OnClickListener {
private TextView levelDisplay;
private ProgressBar levelProgress;
private TextView starCount;
private TextView energyCount;
private ToggleButton soundToggle;
private Button toolshopButton;
private Button resetButton;
@ -41,6 +42,8 @@ public class TopBar extends TopBarData implements View.OnClickListener {
levelProgress = (ProgressBar) layout.findViewById(R.id.topbar_levelprogress);
starCount = (TextView) layout.findViewById(R.id.topbar_starcount);
starCount.setTypeface(typeface);
energyCount = (TextView) layout.findViewById(R.id.topbar_energycount);
energyCount.setTypeface(typeface);
soundToggle = (ToggleButton) layout.findViewById(R.id.topbar_soundtoggle);
soundToggle.setTypeface(typeface);
soundToggle.setOnClickListener(this);
@ -52,6 +55,8 @@ public class TopBar extends TopBarData implements View.OnClickListener {
resetButton = (Button) layout.findViewById(R.id.topbar_resetButton);
resetButton.setTypeface(typeface);
resetButton.setOnClickListener(this);
if (parent == Screen.ScreenType.GAME)
resetButton.setEnabled(false);
starCountDecrease = (TextView) layout.findViewById(R.id.topbar_starcount_decrease);
starCountDecrease.setTypeface(typeface);
}
@ -64,6 +69,7 @@ public class TopBar extends TopBarData implements View.OnClickListener {
levelDisplay.setText("Level: " + user.getLevel());
levelProgress.setProgress(user.getEp());
starCount.setText(user.getStarCount() + "");
energyCount.setText(user.getEnergyCount() + "");
soundToggle.setChecked(soundManager.isSoundOn());
}
@ -91,10 +97,6 @@ public class TopBar extends TopBarData implements View.OnClickListener {
for (ToolType type : ToolType.values())
type.setBought(false);
dataStorageHandler.writeBoughtTools();
user.gainLvFinishedEp();
user.gainLvFinishedEp();
user.gainLvFinishedEp();
user.gainLvFinishedEp();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/topbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -40,14 +41,35 @@
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/topbar_levellayout"
android:background="@drawable/star" />
android:background="@drawable/currency_star" />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/currency_energy"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/topbar_starcount"
android:layout_toEndOf="@+id/topbar_starcount"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:id="@+id/topbar_energyview" />
<TextView
android:id="@+id/topbar_starcount"
android:id="@+id/topbar_starcount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/topbar_starview"
android:text="100"
android:textColor="#000000"
android:textSize="25sp" />
<TextView
android:id="@+id/topbar_energycount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/topbar_starview"
android:layout_toEndOf="@+id/topbar_energyview"
android:text="100"
android:textColor="#000000"
android:textSize="25sp" />
@ -74,15 +96,6 @@
android:layout_marginRight="5dp"
android:text="Tool-Shop" />
<Button
android:id="@+id/topbar_resetButton"
style="@style/customButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Reset" />
<TextView
android:id="@+id/topbar_starcount_decrease"
android:layout_width="wrap_content"
@ -94,5 +107,18 @@
android:layout_centerVertical="true"
android:layout_alignEnd="@+id/topbar_starcount" />
<Button
android:id="@+id/topbar_resetButton"
style="@style/customButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reset"
android:layout_marginLeft="64dp"
android:layout_marginStart="64dp"
android:layout_alignBaseline="@+id/topbar_soundtoggle"
android:layout_alignBottom="@+id/topbar_soundtoggle"
android:layout_toRightOf="@+id/topbar_energycount"
android:layout_toEndOf="@+id/topbar_energycount" />
</RelativeLayout>

View File

@ -76,7 +76,7 @@
android:layout_marginRight="4dp"
android:layout_toLeftOf="@+id/worldbutton_starcount"
android:layout_toStartOf="@+id/worldbutton_starcount"
android:src="@drawable/star"
android:src="@drawable/currency_star"
android:id="@+id/imageView2" />
<ImageView

View File

@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />