Added juris graphics
Changed layout of shape-shop and tool-shop
This commit is contained in:
parent
7363b7d5cc
commit
2e24ef619d
@ -456,7 +456,7 @@ public final class R {
|
||||
public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f070042;
|
||||
public static final int abc_textfield_search_default_mtrl_alpha = 0x7f070043;
|
||||
public static final int abc_textfield_search_material = 0x7f070044;
|
||||
public static final int notification_template_icon_bg = 0x7f070061;
|
||||
public static final int notification_template_icon_bg = 0x7f070067;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int action0 = 0x7f080000;
|
||||
@ -619,7 +619,7 @@ public final class R {
|
||||
public static final int abc_shareactionprovider_share_with = 0x7f0d0010;
|
||||
public static final int abc_shareactionprovider_share_with_application = 0x7f0d0011;
|
||||
public static final int abc_toolbar_collapse_description = 0x7f0d0012;
|
||||
public static final int status_bar_notification_info_overflow = 0x7f0d005b;
|
||||
public static final int status_bar_notification_info_overflow = 0x7f0d005d;
|
||||
}
|
||||
public static final class style {
|
||||
public static final int AlertDialog_AppCompat = 0x7f0e0000;
|
||||
|
File diff suppressed because one or more lines are too long
@ -507,66 +507,72 @@ int drawable guis_splitter 0x7f07005d
|
||||
int drawable guis_tick 0x7f07005e
|
||||
int drawable guis_tool_shop_disabled 0x7f07005f
|
||||
int drawable guis_tool_shop_enabled 0x7f070060
|
||||
int drawable notification_template_icon_bg 0x7f070061
|
||||
int drawable obstacles_grass 0x7f070062
|
||||
int drawable obstacles_snow 0x7f070063
|
||||
int drawable playershapes_ball 0x7f070064
|
||||
int drawable playershapes_clock 0x7f070065
|
||||
int drawable playershapes_hypno_spiral 0x7f070066
|
||||
int drawable playershapes_locked 0x7f070067
|
||||
int drawable playershapes_pacman 0x7f070068
|
||||
int drawable playershapes_smiley 0x7f070069
|
||||
int drawable playershapes_sun 0x7f07006a
|
||||
int drawable playershapes_wheel 0x7f07006b
|
||||
int drawable terrain_c_grass 0x7f07006c
|
||||
int drawable terrain_c_ice 0x7f07006d
|
||||
int drawable terrain_t_grass 0x7f07006e
|
||||
int drawable terrain_t_ice 0x7f07006f
|
||||
int drawable tools_bomb 0x7f070070
|
||||
int drawable tools_bomb_button 0x7f070071
|
||||
int drawable tools_button_empty 0x7f070072
|
||||
int drawable tools_button_locked 0x7f070073
|
||||
int drawable tools_button_unlocked 0x7f070074
|
||||
int drawable tools_magnet 0x7f070075
|
||||
int drawable tools_magnet_button 0x7f070076
|
||||
int drawable tools_power_mushroom 0x7f070077
|
||||
int drawable tools_power_mushroom_button 0x7f070078
|
||||
int drawable tools_ramp 0x7f070079
|
||||
int drawable tools_ramp_button 0x7f07007a
|
||||
int drawable tools_spring 0x7f07007b
|
||||
int drawable tools_spring_button 0x7f07007c
|
||||
int drawable tools_stasis 0x7f07007d
|
||||
int drawable tools_stasis_button 0x7f07007e
|
||||
int drawable tutorial_place_ramp_air_1 0x7f07007f
|
||||
int drawable tutorial_place_ramp_air_2 0x7f070080
|
||||
int drawable tutorial_place_ramp_gap 0x7f070081
|
||||
int drawable tutorial_place_ramp_obstacle 0x7f070082
|
||||
int drawable tutorial_place_tools 0x7f070083
|
||||
int drawable tutorial_switch_tools 0x7f070084
|
||||
int drawable tutorial_to_toolshop 0x7f070085
|
||||
int drawable world_previews_grasslands 0x7f070086
|
||||
int drawable world_previews_icymountains 0x7f070087
|
||||
int drawable xml_background_bountymessage 0x7f070088
|
||||
int drawable xml_background_dialog_button 0x7f070089
|
||||
int drawable xml_background_exit_confirm_dialog 0x7f07008a
|
||||
int drawable xml_background_game_over_message_button 0x7f07008b
|
||||
int drawable xml_background_levelbutton 0x7f07008c
|
||||
int drawable xml_background_toolslot 0x7f07008d
|
||||
int drawable xml_background_topbar 0x7f07008e
|
||||
int drawable xml_background_tutorialimageview 0x7f07008f
|
||||
int drawable xml_background_tutorialtextview 0x7f070090
|
||||
int drawable xml_background_worldbutton 0x7f070091
|
||||
int drawable xml_layers_levelprogressbar 0x7f070092
|
||||
int drawable xml_layers_toolprogressbar 0x7f070093
|
||||
int drawable xml_selector_backbutton 0x7f070094
|
||||
int drawable xml_selector_gamebutton 0x7f070095
|
||||
int drawable xml_selector_music 0x7f070096
|
||||
int drawable xml_selector_pricebutton 0x7f070097
|
||||
int drawable xml_selector_settings_button 0x7f070098
|
||||
int drawable xml_selector_settingsbutton 0x7f070099
|
||||
int drawable xml_selector_shapeshopbutton 0x7f07009a
|
||||
int drawable xml_selector_sound 0x7f07009b
|
||||
int drawable xml_selector_toolshopbutton 0x7f07009c
|
||||
int drawable juri_background_game_grass_2 0x7f070061
|
||||
int drawable juri_background_game_grass_3 0x7f070062
|
||||
int drawable juri_background_game_snow_2 0x7f070063
|
||||
int drawable juri_background_game_snow_3 0x7f070064
|
||||
int drawable juri_obstacles_grass 0x7f070065
|
||||
int drawable jury_playershapes_ball_omg_im_blue 0x7f070066
|
||||
int drawable notification_template_icon_bg 0x7f070067
|
||||
int drawable obstacles_grass 0x7f070068
|
||||
int drawable obstacles_snow 0x7f070069
|
||||
int drawable playershapes_ball 0x7f07006a
|
||||
int drawable playershapes_clock 0x7f07006b
|
||||
int drawable playershapes_hypno_spiral 0x7f07006c
|
||||
int drawable playershapes_locked 0x7f07006d
|
||||
int drawable playershapes_pacman 0x7f07006e
|
||||
int drawable playershapes_smiley 0x7f07006f
|
||||
int drawable playershapes_sun 0x7f070070
|
||||
int drawable playershapes_wheel 0x7f070071
|
||||
int drawable terrain_c_grass 0x7f070072
|
||||
int drawable terrain_c_ice 0x7f070073
|
||||
int drawable terrain_t_grass 0x7f070074
|
||||
int drawable terrain_t_ice 0x7f070075
|
||||
int drawable tools_bomb 0x7f070076
|
||||
int drawable tools_bomb_button 0x7f070077
|
||||
int drawable tools_button_empty 0x7f070078
|
||||
int drawable tools_button_locked 0x7f070079
|
||||
int drawable tools_button_unlocked 0x7f07007a
|
||||
int drawable tools_magnet 0x7f07007b
|
||||
int drawable tools_magnet_button 0x7f07007c
|
||||
int drawable tools_power_mushroom 0x7f07007d
|
||||
int drawable tools_power_mushroom_button 0x7f07007e
|
||||
int drawable tools_ramp 0x7f07007f
|
||||
int drawable tools_ramp_button 0x7f070080
|
||||
int drawable tools_spring 0x7f070081
|
||||
int drawable tools_spring_button 0x7f070082
|
||||
int drawable tools_stasis 0x7f070083
|
||||
int drawable tools_stasis_button 0x7f070084
|
||||
int drawable tutorial_place_ramp_air_1 0x7f070085
|
||||
int drawable tutorial_place_ramp_air_2 0x7f070086
|
||||
int drawable tutorial_place_ramp_gap 0x7f070087
|
||||
int drawable tutorial_place_ramp_obstacle 0x7f070088
|
||||
int drawable tutorial_place_tools 0x7f070089
|
||||
int drawable tutorial_switch_tools 0x7f07008a
|
||||
int drawable tutorial_to_toolshop 0x7f07008b
|
||||
int drawable world_previews_grasslands 0x7f07008c
|
||||
int drawable world_previews_icymountains 0x7f07008d
|
||||
int drawable xml_background_bountymessage 0x7f07008e
|
||||
int drawable xml_background_dialog_button 0x7f07008f
|
||||
int drawable xml_background_exit_confirm_dialog 0x7f070090
|
||||
int drawable xml_background_game_over_message_button 0x7f070091
|
||||
int drawable xml_background_levelbutton 0x7f070092
|
||||
int drawable xml_background_toolslot 0x7f070093
|
||||
int drawable xml_background_topbar 0x7f070094
|
||||
int drawable xml_background_tutorialimageview 0x7f070095
|
||||
int drawable xml_background_tutorialtextview 0x7f070096
|
||||
int drawable xml_background_worldbutton 0x7f070097
|
||||
int drawable xml_layers_levelprogressbar 0x7f070098
|
||||
int drawable xml_layers_toolprogressbar 0x7f070099
|
||||
int drawable xml_selector_backbutton 0x7f07009a
|
||||
int drawable xml_selector_gamebutton 0x7f07009b
|
||||
int drawable xml_selector_music 0x7f07009c
|
||||
int drawable xml_selector_pricebutton 0x7f07009d
|
||||
int drawable xml_selector_settings_button 0x7f07009e
|
||||
int drawable xml_selector_settingsbutton 0x7f07009f
|
||||
int drawable xml_selector_shapeshopbutton 0x7f0700a0
|
||||
int drawable xml_selector_sound 0x7f0700a1
|
||||
int drawable xml_selector_toolshopbutton 0x7f0700a2
|
||||
int id action0 0x7f080000
|
||||
int id action_bar 0x7f080001
|
||||
int id action_bar_activity_content 0x7f080002
|
||||
@ -943,76 +949,78 @@ int string placeholder_button 0x7f0d0038
|
||||
int string placeholder_number 0x7f0d0039
|
||||
int string placeholder_textview 0x7f0d003a
|
||||
int string playershape_description_ball 0x7f0d003b
|
||||
int string playershape_description_clock 0x7f0d003c
|
||||
int string playershape_description_hypno_spiral 0x7f0d003d
|
||||
int string playershape_description_locked 0x7f0d003e
|
||||
int string playershape_description_pacman 0x7f0d003f
|
||||
int string playershape_description_smiley 0x7f0d0040
|
||||
int string playershape_description_sun 0x7f0d0041
|
||||
int string playershape_description_wheel 0x7f0d0042
|
||||
int string playershape_name_ball 0x7f0d0043
|
||||
int string playershape_name_clock 0x7f0d0044
|
||||
int string playershape_name_hypno_spiral 0x7f0d0045
|
||||
int string playershape_name_locked 0x7f0d0046
|
||||
int string playershape_name_pacman 0x7f0d0047
|
||||
int string playershape_name_smiley 0x7f0d0048
|
||||
int string playershape_name_sun 0x7f0d0049
|
||||
int string playershape_name_wheel 0x7f0d004a
|
||||
int string pre_start_screen_loading 0x7f0d004b
|
||||
int string price_button_buy 0x7f0d004c
|
||||
int string price_button_upgrade 0x7f0d004d
|
||||
int string settings_boost_performance 0x7f0d004e
|
||||
int string settings_credits 0x7f0d004f
|
||||
int string settings_music 0x7f0d0050
|
||||
int string settings_reset 0x7f0d0051
|
||||
int string settings_show_fps 0x7f0d0052
|
||||
int string settings_sounds 0x7f0d0053
|
||||
int string short_menu_continue 0x7f0d0054
|
||||
int string short_menu_exit 0x7f0d0055
|
||||
int string start_screen_finish_world_1 0x7f0d0056
|
||||
int string start_screen_gain_90_ep 0x7f0d0057
|
||||
int string start_screen_play 0x7f0d0058
|
||||
int string start_screen_to_gl_test_screen 0x7f0d0059
|
||||
int string start_screen_unlock_all_levels 0x7f0d005a
|
||||
int string status_bar_notification_info_overflow 0x7f0d005b
|
||||
int string task_collect_energy_format_d 0x7f0d005c
|
||||
int string task_collect_energy_progress_format_ddd 0x7f0d005d
|
||||
int string task_collect_stars_format_d 0x7f0d005e
|
||||
int string task_collect_stars_progress_format_ddd 0x7f0d005f
|
||||
int string task_complete_world_format_d 0x7f0d0060
|
||||
int string task_empty 0x7f0d0061
|
||||
int string tool_description_bomb 0x7f0d0062
|
||||
int string tool_description_locked_format_d 0x7f0d0063
|
||||
int string tool_description_magnet 0x7f0d0064
|
||||
int string tool_description_power_mushroom 0x7f0d0065
|
||||
int string tool_description_ramp 0x7f0d0066
|
||||
int string tool_description_spring 0x7f0d0067
|
||||
int string tool_description_stasis 0x7f0d0068
|
||||
int string tool_level_format_d 0x7f0d0069
|
||||
int string tool_name_bomb 0x7f0d006a
|
||||
int string tool_name_locked 0x7f0d006b
|
||||
int string tool_name_magnet 0x7f0d006c
|
||||
int string tool_name_power_mushroom 0x7f0d006d
|
||||
int string tool_name_ramp 0x7f0d006e
|
||||
int string tool_name_spring 0x7f0d006f
|
||||
int string tool_name_stasis 0x7f0d0070
|
||||
int string topbar_level_format_d 0x7f0d0071
|
||||
int string topbar_level_placeholder 0x7f0d0072
|
||||
int string tutorial_leveled_up_to_toolshop 0x7f0d0073
|
||||
int string tutorial_place_ramp_air 0x7f0d0074
|
||||
int string tutorial_place_ramp_air_2 0x7f0d0075
|
||||
int string tutorial_place_ramp_gap 0x7f0d0076
|
||||
int string tutorial_place_ramp_obstacle 0x7f0d0077
|
||||
int string tutorial_place_tools 0x7f0d0078
|
||||
int string tutorial_placeholder 0x7f0d0079
|
||||
int string tutorial_spring_equipped 0x7f0d007a
|
||||
int string tutorial_switch_tools_switch 0x7f0d007b
|
||||
int string tutorial_switch_tools_two_neccessary 0x7f0d007c
|
||||
int string tutorial_welcome 0x7f0d007d
|
||||
int string unlock_message_placeholder 0x7f0d007e
|
||||
int string world_button_count_format_dd 0x7f0d007f
|
||||
int string world_button_progress_placeholder 0x7f0d0080
|
||||
int string world_button_title_placeholder 0x7f0d0081
|
||||
int string playershape_description_blue 0x7f0d003c
|
||||
int string playershape_description_clock 0x7f0d003d
|
||||
int string playershape_description_hypno_spiral 0x7f0d003e
|
||||
int string playershape_description_locked 0x7f0d003f
|
||||
int string playershape_description_pacman 0x7f0d0040
|
||||
int string playershape_description_smiley 0x7f0d0041
|
||||
int string playershape_description_sun 0x7f0d0042
|
||||
int string playershape_description_wheel 0x7f0d0043
|
||||
int string playershape_name_ball 0x7f0d0044
|
||||
int string playershape_name_blue 0x7f0d0045
|
||||
int string playershape_name_clock 0x7f0d0046
|
||||
int string playershape_name_hypno_spiral 0x7f0d0047
|
||||
int string playershape_name_locked 0x7f0d0048
|
||||
int string playershape_name_pacman 0x7f0d0049
|
||||
int string playershape_name_smiley 0x7f0d004a
|
||||
int string playershape_name_sun 0x7f0d004b
|
||||
int string playershape_name_wheel 0x7f0d004c
|
||||
int string pre_start_screen_loading 0x7f0d004d
|
||||
int string price_button_buy 0x7f0d004e
|
||||
int string price_button_upgrade 0x7f0d004f
|
||||
int string settings_boost_performance 0x7f0d0050
|
||||
int string settings_credits 0x7f0d0051
|
||||
int string settings_music 0x7f0d0052
|
||||
int string settings_reset 0x7f0d0053
|
||||
int string settings_show_fps 0x7f0d0054
|
||||
int string settings_sounds 0x7f0d0055
|
||||
int string short_menu_continue 0x7f0d0056
|
||||
int string short_menu_exit 0x7f0d0057
|
||||
int string start_screen_finish_world_1 0x7f0d0058
|
||||
int string start_screen_gain_90_ep 0x7f0d0059
|
||||
int string start_screen_play 0x7f0d005a
|
||||
int string start_screen_to_gl_test_screen 0x7f0d005b
|
||||
int string start_screen_unlock_all_levels 0x7f0d005c
|
||||
int string status_bar_notification_info_overflow 0x7f0d005d
|
||||
int string task_collect_energy_format_d 0x7f0d005e
|
||||
int string task_collect_energy_progress_format_ddd 0x7f0d005f
|
||||
int string task_collect_stars_format_d 0x7f0d0060
|
||||
int string task_collect_stars_progress_format_ddd 0x7f0d0061
|
||||
int string task_complete_world_format_d 0x7f0d0062
|
||||
int string task_empty 0x7f0d0063
|
||||
int string tool_description_bomb 0x7f0d0064
|
||||
int string tool_description_locked_format_d 0x7f0d0065
|
||||
int string tool_description_magnet 0x7f0d0066
|
||||
int string tool_description_power_mushroom 0x7f0d0067
|
||||
int string tool_description_ramp 0x7f0d0068
|
||||
int string tool_description_spring 0x7f0d0069
|
||||
int string tool_description_stasis 0x7f0d006a
|
||||
int string tool_level_format_d 0x7f0d006b
|
||||
int string tool_name_bomb 0x7f0d006c
|
||||
int string tool_name_locked 0x7f0d006d
|
||||
int string tool_name_magnet 0x7f0d006e
|
||||
int string tool_name_power_mushroom 0x7f0d006f
|
||||
int string tool_name_ramp 0x7f0d0070
|
||||
int string tool_name_spring 0x7f0d0071
|
||||
int string tool_name_stasis 0x7f0d0072
|
||||
int string topbar_level_format_d 0x7f0d0073
|
||||
int string topbar_level_placeholder 0x7f0d0074
|
||||
int string tutorial_leveled_up_to_toolshop 0x7f0d0075
|
||||
int string tutorial_place_ramp_air 0x7f0d0076
|
||||
int string tutorial_place_ramp_air_2 0x7f0d0077
|
||||
int string tutorial_place_ramp_gap 0x7f0d0078
|
||||
int string tutorial_place_ramp_obstacle 0x7f0d0079
|
||||
int string tutorial_place_tools 0x7f0d007a
|
||||
int string tutorial_placeholder 0x7f0d007b
|
||||
int string tutorial_spring_equipped 0x7f0d007c
|
||||
int string tutorial_switch_tools_switch 0x7f0d007d
|
||||
int string tutorial_switch_tools_two_neccessary 0x7f0d007e
|
||||
int string tutorial_welcome 0x7f0d007f
|
||||
int string unlock_message_placeholder 0x7f0d0080
|
||||
int string world_button_count_format_dd 0x7f0d0081
|
||||
int string world_button_progress_placeholder 0x7f0d0082
|
||||
int string world_button_title_placeholder 0x7f0d0083
|
||||
int style AlertDialog_AppCompat 0x7f0e0000
|
||||
int style AlertDialog_AppCompat_Light 0x7f0e0001
|
||||
int style Animation_AppCompat_Dialog 0x7f0e0002
|
||||
|
@ -1,56 +1,49 @@
|
||||
package de.frajul.endlessroll.entities;
|
||||
|
||||
import de.frajul.endlessroll.data.SynchronizedArrayList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import de.frajul.endlessroll.data.Vector;
|
||||
import de.frajul.endlessroll.entities.textures.Texture;
|
||||
|
||||
/**
|
||||
* Created by Julian on 20.07.2016.
|
||||
*/
|
||||
public class Background extends SynchronizedArrayList<Entity> {
|
||||
public class Background {
|
||||
|
||||
private final float PART_WIDTH = 5;
|
||||
private final float HALF_PART_WIDTH = PART_WIDTH / 2;
|
||||
private final float HEIGHT = 2.5f;
|
||||
private Texture texture;
|
||||
private List<BackgroundLayer> layers = Collections
|
||||
.synchronizedList(new ArrayList<BackgroundLayer>());
|
||||
|
||||
public Background(Texture texture) {
|
||||
this.texture = texture;
|
||||
super.add(createPart(-HALF_PART_WIDTH));
|
||||
public Background(List<Texture> textures) {
|
||||
changeTextures(textures);
|
||||
}
|
||||
|
||||
public void changeTexture(Texture texture) {
|
||||
this.texture = texture;
|
||||
synchronized (this) {
|
||||
for (Entity entity : this)
|
||||
entity.setTexture(texture);
|
||||
public void changeTextures(List<Texture> textures) {
|
||||
layers.clear();
|
||||
for (int i = 0; i < textures.size(); i++) {
|
||||
Texture texture = textures.get(i);
|
||||
float speed = (float) Math.pow(0.95f, Math.pow(i + 1, Math.sqrt(i + 1)));
|
||||
layers.add(new BackgroundLayer(texture, speed));
|
||||
}
|
||||
}
|
||||
|
||||
private Entity createPart(float xLeftEdge) {
|
||||
return new Entity(texture, new Vector(xLeftEdge + HALF_PART_WIDTH, (HEIGHT - 2) / 2), PART_WIDTH, HEIGHT);
|
||||
}
|
||||
|
||||
public void move(float x, float cameraX) {
|
||||
Vector movement = new Vector(x, 0);
|
||||
synchronized (this) {
|
||||
for (Entity part : this)
|
||||
part.move(movement);
|
||||
}
|
||||
if (!super.isEmpty()) {
|
||||
Entity last = super.get(super.size() - 1);
|
||||
if (last.getRightEdge() - cameraX < 3) {
|
||||
super.add(createPart(last.getRightEdge() - 0.001f));
|
||||
}
|
||||
if (super.get(0).getRightEdge() - cameraX < -3) {
|
||||
super.remove(0);
|
||||
public void move(float playerMoveX, float cameraX) {
|
||||
synchronized (layers){
|
||||
for(BackgroundLayer layer : layers){
|
||||
layer.move(playerMoveX, cameraX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetPosition() {
|
||||
super.clear();
|
||||
super.add(createPart(-HALF_PART_WIDTH));
|
||||
synchronized (layers){
|
||||
for(BackgroundLayer layer : layers)
|
||||
layer.resetPosition();
|
||||
}
|
||||
}
|
||||
|
||||
public List<BackgroundLayer> getLayers() {
|
||||
return layers;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package de.frajul.endlessroll.entities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.frajul.endlessroll.data.SynchronizedArrayList;
|
||||
import de.frajul.endlessroll.data.Vector;
|
||||
import de.frajul.endlessroll.entities.textures.Texture;
|
||||
|
||||
public class BackgroundLayer extends SynchronizedArrayList<Entity> {
|
||||
|
||||
private final float PART_WIDTH = 5;
|
||||
private final float HALF_PART_WIDTH = PART_WIDTH / 2f;
|
||||
private final float HEIGHT = 2.5f;
|
||||
private Texture texture;
|
||||
private float speed;
|
||||
|
||||
public BackgroundLayer(Texture texture, float speed) {
|
||||
this.texture = texture;
|
||||
this.speed = speed;
|
||||
super.add(createPart(-HALF_PART_WIDTH));
|
||||
}
|
||||
|
||||
private Entity createPart(float xLeftEdge) {
|
||||
return new Entity(texture, new Vector(xLeftEdge + HALF_PART_WIDTH, (HEIGHT - 2) / 2), PART_WIDTH, HEIGHT);
|
||||
}
|
||||
|
||||
public void move(float playerMovX, float cameraX) {
|
||||
Vector movement = new Vector(playerMovX * speed, 0);
|
||||
synchronized (this) {
|
||||
for (Entity part : this)
|
||||
part.move(movement);
|
||||
}
|
||||
if (!super.isEmpty()) {
|
||||
Entity last = super.get(super.size() - 1);
|
||||
if (last.getRightEdge() - cameraX < 3) {
|
||||
super.add(createPart(last.getRightEdge() - 0.001f));
|
||||
}
|
||||
if (super.get(0).getRightEdge() - cameraX < -3) {
|
||||
super.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetPosition() {
|
||||
super.clear();
|
||||
super.add(createPart(-HALF_PART_WIDTH));
|
||||
}
|
||||
|
||||
}
|
@ -26,7 +26,9 @@ public enum PlayerShape {
|
||||
WHEEL(R.string.playershape_name_wheel, R.string.playershape_description_wheel,
|
||||
R.drawable.playershapes_wheel, new CollectStarTask(45)),
|
||||
SUN(R.string.playershape_name_sun, R.string.playershape_description_sun,
|
||||
R.drawable.playershapes_sun, new CollectEnergyTask(10));
|
||||
R.drawable.playershapes_sun, new CollectEnergyTask(10)),
|
||||
BLUE(R.string.playershape_name_blue, R.string.playershape_description_blue,
|
||||
R.drawable.jury_playershapes_ball_omg_im_blue, new CompleteWorldTask(2));
|
||||
|
||||
@StringRes
|
||||
private int nameId;
|
||||
|
@ -2,6 +2,10 @@ package de.frajul.endlessroll.levels.worlds;
|
||||
|
||||
import android.support.annotation.DrawableRes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.frajul.endlessroll.R;
|
||||
import de.frajul.endlessroll.entities.textures.Texture;
|
||||
import de.frajul.endlessroll.entities.textures.TexturePack;
|
||||
@ -12,32 +16,38 @@ import de.frajul.endlessroll.entities.textures.TexturePack;
|
||||
|
||||
public enum World {
|
||||
|
||||
GRASSLANDS(R.drawable.world_previews_grasslands, R.drawable.backgrounds_game_grass, R.drawable.terrain_t_grass, R.drawable.terrain_c_grass, R.drawable.obstacles_grass),
|
||||
ICY_MOUNTAINS(R.drawable.world_previews_icymountains, R.drawable.backgrounds_game_snow, R.drawable.terrain_t_ice, R.drawable.terrain_c_ice, R.drawable.obstacles_snow);
|
||||
GRASSLANDS(R.drawable.world_previews_grasslands, R.drawable.terrain_t_grass,
|
||||
R.drawable.terrain_c_grass, R.drawable.juri_obstacles_grass,
|
||||
R.drawable.backgrounds_game_grass),
|
||||
ICY_MOUNTAINS(R.drawable.world_previews_icymountains, R.drawable.terrain_t_ice,
|
||||
R.drawable.terrain_c_ice, R.drawable.obstacles_snow, R.drawable.backgrounds_game_snow),
|
||||
TEST_WORLD_GRASS(R.drawable.world_previews_grasslands, R.drawable.terrain_t_grass,
|
||||
R.drawable.terrain_c_grass, R.drawable.juri_obstacles_grass,
|
||||
R.drawable.backgrounds_game_grass, R.drawable.juri_background_game_grass_2, R.drawable.juri_background_game_grass_3),
|
||||
TEST_WORLD_SNOW(R.drawable.world_previews_icymountains, R.drawable.terrain_t_ice,
|
||||
R.drawable.terrain_c_ice, R.drawable.obstacles_snow, R.drawable.backgrounds_game_snow, R.drawable.juri_background_game_snow_2, R.drawable.juri_background_game_snow_3);
|
||||
|
||||
private String name;
|
||||
@DrawableRes
|
||||
private int previewId;
|
||||
@DrawableRes
|
||||
private int backgroundId;
|
||||
@DrawableRes
|
||||
private int terrainId;
|
||||
@DrawableRes
|
||||
private int ceilingId;
|
||||
@DrawableRes
|
||||
private int obstacleId;
|
||||
private List<Integer> backgroundIds;
|
||||
|
||||
private Texture background;
|
||||
private List<Texture> backgroundTextures = new ArrayList<>();
|
||||
private Texture terrain;
|
||||
private Texture ceiling;
|
||||
private Texture obstacle;
|
||||
|
||||
World(@DrawableRes int previewId, @DrawableRes int backgroundId, @DrawableRes int terrainId, @DrawableRes int ceilingId, @DrawableRes int obstacleId) {
|
||||
World(@DrawableRes int previewId, @DrawableRes int terrainId, @DrawableRes int ceilingId, @DrawableRes int obstacleId, @DrawableRes Integer... backgroundIds) {
|
||||
this.previewId = previewId;
|
||||
this.backgroundId = backgroundId;
|
||||
this.terrainId = terrainId;
|
||||
this.ceilingId = ceilingId;
|
||||
this.obstacleId = obstacleId;
|
||||
this.backgroundIds = Arrays.asList(backgroundIds);
|
||||
}
|
||||
|
||||
public static void loadAllSpecificTextures(TexturePack texturePack) {
|
||||
@ -46,7 +56,8 @@ public enum World {
|
||||
}
|
||||
|
||||
private void loadSpecificTextures(TexturePack texturePack) {
|
||||
background = texturePack.loadTexture(backgroundId);
|
||||
for (int backgroundId : backgroundIds)
|
||||
backgroundTextures.add(texturePack.loadTexture(backgroundId));
|
||||
terrain = texturePack.loadTexture(terrainId);
|
||||
ceiling = texturePack.loadTexture(ceilingId);
|
||||
obstacle = texturePack.loadAtlas(obstacleId, 8, 8);
|
||||
@ -56,8 +67,8 @@ public enum World {
|
||||
return previewId;
|
||||
}
|
||||
|
||||
public Texture getBackgroundTexture() {
|
||||
return background;
|
||||
public List<Texture> getBackgroundTextures() {
|
||||
return backgroundTextures;
|
||||
}
|
||||
|
||||
public Texture getTerrainTexture() {
|
||||
|
@ -45,7 +45,7 @@ public class GameScene extends Scene {
|
||||
public void loadLevel(Level level, World world, PlayerShape playerShape) throws Exception {
|
||||
this.currentWorld = world;
|
||||
super.reset();
|
||||
background.changeTexture(world.getBackgroundTexture());
|
||||
background.changeTextures(world.getBackgroundTextures());
|
||||
terrain.loadData(world, level.getTerrainEdge(), level.getTerrainTiles());
|
||||
ceiling.loadData(world, level.getCeilingEdge(), level.getCeilingTiles());
|
||||
uncategorizedEntities.add(goal);
|
||||
|
@ -58,7 +58,7 @@ public abstract class Scene {
|
||||
setTexturePack(texturePack);
|
||||
camera = new Camera();
|
||||
playerArrow = new Entity(textures.playerArrow, new Vector(0, 0.9f), .2f, .2f);
|
||||
background = new Background(World.GRASSLANDS.getBackgroundTexture());
|
||||
background = new Background(World.GRASSLANDS.getBackgroundTextures());
|
||||
terrain = new Terrain(World.GRASSLANDS.getTerrainTexture());
|
||||
ceiling = new Ceiling(World.GRASSLANDS.getTerrainTexture());
|
||||
player = new Player();
|
||||
@ -144,7 +144,7 @@ public abstract class Scene {
|
||||
|
||||
private void moveEnviroment(float x) {
|
||||
camera.moveX(x);
|
||||
background.move(x * 0.95f, camera.getX());
|
||||
background.move(x, camera.getX());
|
||||
terrain.update(camera.getX());
|
||||
ceiling.update(camera.getX());
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class StartScene extends Scene {
|
||||
public void loadTexturesForCurrentWorld() {
|
||||
terrain.clear();
|
||||
terrain.createEndless(currentWorld, TERRAIN_EDGE);
|
||||
background.changeTexture(currentWorld.getBackgroundTexture());
|
||||
background.changeTextures(currentWorld.getBackgroundTextures());
|
||||
}
|
||||
|
||||
}
|
@ -13,10 +13,10 @@ public class TestScreenScene extends Scene {
|
||||
public TestScreenScene(GameActivity gameActivity, TexturePack texturePack, ParticleSystem particleSystem) {
|
||||
super(gameActivity, texturePack, particleSystem);
|
||||
// terrain.createEndless(World.GRASSLANDS, 0.6f);
|
||||
// background.changeTexture(World.ICY_MOUNTAINS.getBackgroundTexture());
|
||||
// background.changeTextures(World.ICY_MOUNTAINS.getBackgroundTexture());
|
||||
//
|
||||
// player.init(PlayerShape.BALL, 0.6f, 0.5f, 0.5f, particleSystem);
|
||||
// uncategorizedEntities.add(player);
|
||||
uncategorizedEntities.add(new Entity(World.GRASSLANDS.getBackgroundTexture(), new Vector(), 1, 1));
|
||||
uncategorizedEntities.add(new Entity(World.GRASSLANDS.getBackgroundTextures().get(0), new Vector(), 1, 1));
|
||||
}
|
||||
}
|
@ -36,19 +36,22 @@ public class PlayerShapeShopScreen extends Screen<RelativeLayout> implements Pla
|
||||
private void createViews() {
|
||||
topRow.removeAllViews();
|
||||
bottomRow.removeAllViews();
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
params.setMargins(30, 0, 30, 0);
|
||||
|
||||
int i = 0;
|
||||
int totalShapes = PlayerShape.values().length;
|
||||
for (PlayerShape playerShape : PlayerShape.values()) {
|
||||
playerShape.getUnlockTask().update(gameActivity.getLevelManager());
|
||||
boolean lastInRow = i == totalShapes / 2 || i == totalShapes - 1;
|
||||
boolean locked = !playerShape.getUnlockTask()
|
||||
.isConditionFulfilled();
|
||||
PlayerShapeButton button = new PlayerShapeButton(gameActivity, playerShape, this,
|
||||
locked, !lastInRow);
|
||||
if (i < totalShapes / 2 + 1)
|
||||
topRow.addView(button.getView());
|
||||
locked);
|
||||
if (i % 2 == 0)
|
||||
topRow.addView(button.getView(), params);
|
||||
else
|
||||
bottomRow.addView(button.getView());
|
||||
bottomRow.addView(button.getView(), params);
|
||||
|
||||
if (playerShape.equals(gameActivity.getUser().getCurrentPlayerShape())) {
|
||||
this.activeButton = button;
|
||||
|
@ -62,7 +62,7 @@ public class ToolShopScreen extends Screen<RelativeLayout> implements View.OnCli
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
params.setMargins(10, 0, 10, 0);
|
||||
params.setMargins(30, 0, 30, 0);
|
||||
|
||||
int i = 0;
|
||||
for (ToolType type : ToolType.values()) {
|
||||
@ -70,7 +70,7 @@ public class ToolShopScreen extends Screen<RelativeLayout> implements View.OnCli
|
||||
ToolOfferSlot slot = new ToolOfferSlot(this, gameActivity, gameActivity.getTypeface(),
|
||||
type);
|
||||
toolOfferSlots.add(slot);
|
||||
if (i > 5)
|
||||
if (i % 2 == 0)
|
||||
toolOfferBottomRow.addView(slot.getLayout(), params);
|
||||
else
|
||||
toolOfferTopRow.addView(slot.getLayout(), params);
|
||||
|
@ -9,6 +9,7 @@ import java.util.List;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
import de.frajul.endlessroll.entities.BackgroundLayer;
|
||||
import de.frajul.endlessroll.entities.Entity;
|
||||
import de.frajul.endlessroll.entities.Obstacle;
|
||||
import de.frajul.endlessroll.entities.textures.TexturePack;
|
||||
@ -127,9 +128,14 @@ public class GameRenderer implements GLSurfaceView.Renderer {
|
||||
private void renderBackground(GL10 gl, Scene scene) {
|
||||
entityShader.start();
|
||||
entityShader.loadMVPMatrix(matrixCreator, scene.getCamera());
|
||||
synchronized (scene.getBackground()) {
|
||||
for (Entity backgroundPart : scene.getBackground())
|
||||
renderEntity(gl, backgroundPart);
|
||||
List<BackgroundLayer> layers = scene.getBackground().getLayers();
|
||||
synchronized (layers) {
|
||||
for(BackgroundLayer layer : layers){
|
||||
synchronized (layer){
|
||||
for(Entity backgroundPart : layer)
|
||||
renderEntity(gl, backgroundPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
entityShader.stop();
|
||||
}
|
||||
|
@ -29,12 +29,11 @@ public class PlayerShapeButton implements View.OnClickListener {
|
||||
|
||||
private boolean locked;
|
||||
|
||||
public PlayerShapeButton(GameActivity gameActivity, PlayerShape playerShape, PlayerShapeButtonOnClickListener clickListener, boolean locked, boolean marginToRight) {
|
||||
public PlayerShapeButton(GameActivity gameActivity, PlayerShape playerShape, PlayerShapeButtonOnClickListener clickListener, boolean locked) {
|
||||
this.clickListener = clickListener;
|
||||
this.playerShape = playerShape;
|
||||
this.locked = locked;
|
||||
view = LayoutInflater.from(gameActivity).inflate(R.layout.shape_button, null);
|
||||
view.setLayoutParams(createLayoutParams(marginToRight));
|
||||
textView = (TextView) view.findViewById(R.id.shape_button_textview);
|
||||
textView.setTypeface(gameActivity.getTypeface());
|
||||
textView.setText(locked ? R.string.playershape_name_locked : playerShape.getNameId());
|
||||
@ -45,14 +44,6 @@ public class PlayerShapeButton implements View.OnClickListener {
|
||||
rotation = AnimationUtils.loadAnimation(gameActivity, R.anim.shape_button_rotation);
|
||||
}
|
||||
|
||||
private LinearLayout.LayoutParams createLayoutParams(boolean marginToRight) {
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
if (marginToRight)
|
||||
params.setMargins(0, 0, 60, 0);
|
||||
return params;
|
||||
}
|
||||
|
||||
public void startRotating() {
|
||||
button.startAnimation(rotation);
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable/juri_background_game_grass_2.png
Normal file
BIN
app/src/main/res/drawable/juri_background_game_grass_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
BIN
app/src/main/res/drawable/juri_background_game_grass_3.png
Normal file
BIN
app/src/main/res/drawable/juri_background_game_grass_3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
app/src/main/res/drawable/juri_background_game_snow_2.png
Normal file
BIN
app/src/main/res/drawable/juri_background_game_snow_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
app/src/main/res/drawable/juri_background_game_snow_3.png
Normal file
BIN
app/src/main/res/drawable/juri_background_game_snow_3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable/juri_obstacles_grass.png
Normal file
BIN
app/src/main/res/drawable/juri_obstacles_grass.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable/jury_playershapes_ball_omg_im_blue.png
Normal file
BIN
app/src/main/res/drawable/jury_playershapes_ball_omg_im_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -15,10 +15,21 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/shape_shop_topbar">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/shape_shop_shape_inspector"
|
||||
android:layout_toLeftOf="@id/shape_shop_shape_inspector">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
@ -51,6 +62,10 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/shape_shop_shape_inspector"
|
||||
layout="@layout/shape_inspector"
|
||||
|
@ -12,24 +12,25 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/backgrounds_menu_grasslands"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/toolshop_topbar">
|
||||
android:layout_below="@+id/toolshop_topbar"
|
||||
android:background="@drawable/backgrounds_menu_grasslands">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:layout_toLeftOf="@+id/toolshop_toolinspector"
|
||||
android:layout_toStartOf="@+id/toolshop_toolinspector">
|
||||
android:layout_toStartOf="@+id/toolshop_toolinspector"
|
||||
android:clipChildren="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include
|
||||
@ -67,32 +68,53 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:layout_below="@+id/linearLayout4">
|
||||
android:layout_below="@+id/linearLayout4"
|
||||
android:clipChildren="false">
|
||||
|
||||
<LinearLayout
|
||||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:clipChildren="false"
|
||||
android:orientation="vertical">
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/toolshop_tool_offer_top_row"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal"/>
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/toolshop_tool_offer_bottom_row"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal"/>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:layout_weight="1">
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/toolshop_tool_offer_top_row"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/toolshop_tool_offer_bottom_row"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal"/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -77,4 +77,6 @@
|
||||
<string name="settings_music">Musik</string>
|
||||
<string name="settings_show_fps">Fps anzeigen</string>
|
||||
<string name="settings_boost_performance">Leistung erhöhen</string>
|
||||
<string name="playershape_name_blue">Ich bin blau</string>
|
||||
<string name="playershape_description_blue">Warum bin ich blau?</string>
|
||||
</resources>
|
@ -54,6 +54,7 @@
|
||||
<string name="playershape_name_smiley">Smiley</string>
|
||||
<string name="playershape_name_wheel">Wheel</string>
|
||||
<string name="playershape_name_sun">Sun</string>
|
||||
<string name="playershape_name_blue">I\'m blue</string>
|
||||
<string name="playershape_name_locked" translatable="false">\?\?\?</string>
|
||||
<string name="playershape_description_ball" translatable="false">Keep calm and roll on</string>
|
||||
<string name="playershape_description_clock" translatable="false">Tick tack!</string>
|
||||
@ -62,6 +63,7 @@
|
||||
<string name="playershape_description_smiley" translatable="false">Don\'t worry, roll happy!</string>
|
||||
<string name="playershape_description_wheel">A nice car without the... car</string>
|
||||
<string name="playershape_description_sun">Shine bright like the sun</string>
|
||||
<string name="playershape_description_blue">Why am I blue?</string>
|
||||
<string name="playershape_description_locked">A new shape for more fun</string>
|
||||
|
||||
<string name="task_empty">Empty task</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user