Test-Tutorial screen added
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<levelPack id="0">
|
||||
<levelPack id="2">
|
||||
<theme>GRASSLANDS</theme>
|
||||
<levels class="java.util.ArrayList">
|
||||
<level packId="0" id="1" goalX="22.606565" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="1" goalX="22.606565" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.5854988" width="7.1709976"/>
|
||||
<tileData x="10.153494" width="10.408993"/>
|
||||
@ -20,7 +20,7 @@
|
||||
<positionData x="22.043303" y="-0.20666662"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="2" goalX="22.366613" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="2" goalX="22.366613" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.9448314" width="7.8896627"/>
|
||||
<tileData x="8.345928" width="4.4445295"/>
|
||||
@ -47,7 +47,7 @@
|
||||
<positionData x="18.893328" y="-0.12666662"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="3" goalX="19.200012" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="3" goalX="19.200012" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.4151678" width="5.1696644"/>
|
||||
<tileData x="7.1337633" width="8.020197"/>
|
||||
@ -68,7 +68,7 @@
|
||||
<positionData x="12.253348" y="-0.13333318"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="4" goalX="23.933224" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="4" goalX="23.933224" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="6.06402" width="18.12804"/>
|
||||
<tileData x="19.269924" width="3.0757751"/>
|
||||
@ -92,7 +92,7 @@
|
||||
<positionData x="21.9833" y="-0.099999994"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="5" goalX="16.249996" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="5" goalX="16.249996" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="1.9915047" width="9.983009"/>
|
||||
<tileData x="12.045149" width="7.65627"/>
|
||||
@ -110,7 +110,7 @@
|
||||
<positionData x="11.85002" y="-0.4533334"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="6" goalX="27.539873" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="6" goalX="27.539873" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.4867487" width="6.9734974"/>
|
||||
<tileData x="7.8615937" width="5.390193"/>
|
||||
@ -140,7 +140,7 @@
|
||||
<positionData x="20.64665" y="0.39999995"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="7" goalX="25.866587" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="7" goalX="25.866587" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="2.1916704" width="10.383341"/>
|
||||
<tileData x="11.639271" width="7.31187"/>
|
||||
@ -171,7 +171,7 @@
|
||||
<positionData x="20.679989" y="0.85333335"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="8" goalX="17.896662" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="8" goalX="17.896662" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-2.0766673" width="1.8466654"/>
|
||||
<tileData x="2.5266657" width="0.7200012"/>
|
||||
@ -197,7 +197,7 @@
|
||||
<positionData x="17.523336" y="0.4799996"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="0" id="9" goalX="3.0" startSpeed="0.0" endSpeed="0.0" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="9" goalX="3.0" startSpeed="0.0" endSpeed="0.0" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.0" width="6.0"/>
|
||||
</terrainTiles>
|
||||
@ -220,7 +220,7 @@
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level packId="0" id="10" goalX="3.0" startSpeed="0.0" endSpeed="0.0" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="10" goalX="3.0" startSpeed="0.0" endSpeed="0.0" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.0" width="6.0"/>
|
||||
</terrainTiles>
|
||||
@ -234,7 +234,7 @@
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level packId="0" id="11" goalX="22.569973" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="11" goalX="22.569973" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.23241591" width="6.464832"/>
|
||||
<tileData x="8.307598" width="7.651533"/>
|
||||
@ -256,7 +256,7 @@
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level packId="0" id="12" goalX="28.746628" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="2" id="12" goalX="28.746628" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="-0.34033322" width="5.3193336"/>
|
||||
<tileData x="9.0306835" width="10.206701"/>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<levelPack id="1">
|
||||
<levelPack id="5">
|
||||
<theme>TESTCAVE</theme>
|
||||
<levels class="java.util.ArrayList">
|
||||
<level packId="1" id="1" goalX="33.663338" startSpeed="0.6" endSpeed="0.6" terrainEdge="-0.979" ceilingEdge="1.0">
|
||||
<level packId="5" id="1" goalX="33.663338" startSpeed="0.6" endSpeed="0.6" terrainEdge="-0.979" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="15.331669" width="36.663338"/>
|
||||
</terrainTiles>
|
||||
@ -24,7 +24,7 @@
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level packId="1" id="2" goalX="13.38005" startSpeed="0.5" endSpeed="0.6" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="5" id="2" goalX="13.38005" startSpeed="0.5" endSpeed="0.6" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="2.2557545" width="10.511509"/>
|
||||
<tileData x="8.660347" width="0.8236685"/>
|
||||
@ -56,7 +56,7 @@
|
||||
<positionData x="13.110031" y="0.8466663"/>
|
||||
</stars>
|
||||
</level>
|
||||
<level packId="1" id="3" goalX="16.630037" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="0.692">
|
||||
<level packId="5" id="3" goalX="16.630037" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="0.692">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="6.8150187" width="19.630037"/>
|
||||
</terrainTiles>
|
||||
@ -80,7 +80,7 @@
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level packId="1" id="4" goalX="3.0" startSpeed="0.0" endSpeed="0.0" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="5" id="4" goalX="3.0" startSpeed="0.0" endSpeed="0.0" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.0" width="6.0"/>
|
||||
</terrainTiles>
|
||||
@ -97,7 +97,7 @@
|
||||
</obstacles>
|
||||
<stars class="java.util.ArrayList"/>
|
||||
</level>
|
||||
<level packId="1" id="9" goalX="3.0" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<level packId="5" id="9" goalX="3.0" startSpeed="0.5" endSpeed="0.5" terrainEdge="-0.6" ceilingEdge="1.0">
|
||||
<terrainTiles class="java.util.ArrayList">
|
||||
<tileData x="0.0" width="6.0"/>
|
||||
</terrainTiles>
|
||||
|
144
app/src/main/assets/particleEffects/collectEnergy.pe
Normal file
144
app/src/main/assets/particleEffects/collectEnergy.pe
Normal file
@ -0,0 +1,144 @@
|
||||
Untitled
|
||||
- Delay -
|
||||
active: false
|
||||
- Duration -
|
||||
lowMin: 100.0
|
||||
lowMax: 100.0
|
||||
- Count -
|
||||
min: 0
|
||||
max: 30
|
||||
- Emission -
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 60.0
|
||||
highMax: 60.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Life -
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 481.0
|
||||
highMax: 481.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Life Offset -
|
||||
active: false
|
||||
- X Offset -
|
||||
active: false
|
||||
- Y Offset -
|
||||
active: false
|
||||
- Spawn Shape -
|
||||
shape: point
|
||||
- Spawn Width -
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 0.0
|
||||
highMax: 0.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Spawn Height -
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 0.0
|
||||
highMax: 0.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Scale -
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 32.0
|
||||
highMax: 32.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Velocity -
|
||||
active: true
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 300.0
|
||||
highMax: 400.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Angle -
|
||||
active: true
|
||||
lowMin: 360.0
|
||||
lowMax: 0.0
|
||||
highMin: 0.0
|
||||
highMax: 360.0
|
||||
relative: false
|
||||
scalingCount: 2
|
||||
scaling0: 1.0
|
||||
scaling1: 0.0
|
||||
timelineCount: 2
|
||||
timeline0: 0.0
|
||||
timeline1: 1.0
|
||||
- Rotation -
|
||||
active: false
|
||||
- Wind -
|
||||
active: true
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 0.0
|
||||
highMax: 0.0
|
||||
relative: false
|
||||
scalingCount: 1
|
||||
scaling0: 1.0
|
||||
timelineCount: 1
|
||||
timeline0: 0.0
|
||||
- Gravity -
|
||||
active: false
|
||||
- Tint -
|
||||
colorsCount: 9
|
||||
colors0: 0.2784314
|
||||
colors1: 0.047058824
|
||||
colors2: 1.0
|
||||
colors3: 1.0
|
||||
colors4: 0.047058824
|
||||
colors5: 0.9490196
|
||||
colors6: 0.047058824
|
||||
colors7: 1.0
|
||||
colors8: 0.9647059
|
||||
timelineCount: 3
|
||||
timeline0: 0.0
|
||||
timeline1: 0.8674699
|
||||
timeline2: 1.0
|
||||
- Transparency -
|
||||
lowMin: 0.0
|
||||
lowMax: 0.0
|
||||
highMin: 1.0
|
||||
highMax: 1.0
|
||||
relative: false
|
||||
scalingCount: 3
|
||||
scaling0: 1.0
|
||||
scaling1: 0.6315789
|
||||
scaling2: 0.0
|
||||
timelineCount: 3
|
||||
timeline0: 0.0
|
||||
timeline1: 0.80136985
|
||||
timeline2: 1.0
|
||||
- Options -
|
||||
attached: false
|
||||
continuous: false
|
||||
aligned: false
|
||||
additive: true
|
||||
behind: false
|
||||
premultipliedAlpha: false
|
||||
- Image Path -
|
||||
particle.png
|
@ -12,7 +12,7 @@ import com.example.julian.endlessroll.entities.particles.ParticleSystem;
|
||||
*/
|
||||
public enum DestroyEffect {
|
||||
|
||||
EXPLOSION, STAR_EXPLOSION, NONE;
|
||||
EXPLOSION, STAR_EXPLOSION, ENERGY_COLLECT, NONE;
|
||||
|
||||
@Nullable
|
||||
public ParticleSource createEffect(ParticleSystem system, Vector position, Vector size) {
|
||||
@ -29,6 +29,8 @@ public enum DestroyEffect {
|
||||
return system.explosion;
|
||||
case STAR_EXPLOSION:
|
||||
return system.starCollect;
|
||||
case ENERGY_COLLECT:
|
||||
return system.energyCollect;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ public class ParticleSystem {
|
||||
public final ParticleEffect explosion;
|
||||
public final ParticleEffect magnet;
|
||||
public final ParticleEffect starCollect;
|
||||
public final ParticleEffect energyCollect;
|
||||
private ParticleEffect[] effects;
|
||||
|
||||
private TextureLoader textureLoader;
|
||||
@ -24,8 +25,9 @@ public class ParticleSystem {
|
||||
explosion = reader.read("particleEffects/explosion.pe");
|
||||
magnet = reader.read("particleEffects/magnet.pe");
|
||||
starCollect = reader.read("particleEffects/collectStar.pe");
|
||||
energyCollect = reader.read("particleEffects/collectEnergy.pe");
|
||||
|
||||
effects = new ParticleEffect[]{explosion, magnet, starCollect};
|
||||
effects = new ParticleEffect[]{explosion, magnet, starCollect, energyCollect};
|
||||
}
|
||||
|
||||
public void update(Timer timer) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.example.julian.endlessroll.main;
|
||||
|
||||
import com.example.julian.endlessroll.main.game.User;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
|
||||
/**
|
||||
* Created by Julian on 15.07.2016.
|
||||
|
@ -4,11 +4,11 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.example.julian.endlessroll.entities.tools.ToolSlotSettings;
|
||||
import com.example.julian.endlessroll.user.ToolSlotSettings;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
import com.example.julian.endlessroll.levels.Level;
|
||||
import com.example.julian.endlessroll.levels.LevelPack;
|
||||
import com.example.julian.endlessroll.main.game.User;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
import com.example.julian.endlessroll.sqlDatabase.MyDatabase;
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,6 @@ import android.widget.RelativeLayout;
|
||||
import com.example.julian.endlessroll.levels.Level;
|
||||
import com.example.julian.endlessroll.levels.LevelManager;
|
||||
import com.example.julian.endlessroll.levels.LevelPack;
|
||||
import com.example.julian.endlessroll.main.game.User;
|
||||
import com.example.julian.endlessroll.main.screens.GameScreen;
|
||||
import com.example.julian.endlessroll.main.screens.LevelsScreen;
|
||||
import com.example.julian.endlessroll.main.screens.Screen;
|
||||
@ -23,8 +22,12 @@ import com.example.julian.endlessroll.main.screens.ScreenFlipper;
|
||||
import com.example.julian.endlessroll.main.screens.StartScreen;
|
||||
import com.example.julian.endlessroll.main.screens.ToolShopScreen;
|
||||
import com.example.julian.endlessroll.main.screens.WorldsScreen;
|
||||
import com.example.julian.endlessroll.main.tutorial.BreakPoint;
|
||||
import com.example.julian.endlessroll.main.tutorial.Tutorial;
|
||||
import com.example.julian.endlessroll.main.tutorial.TutorialView;
|
||||
import com.example.julian.endlessroll.rendering.renderer.GameRenderer;
|
||||
import com.example.julian.endlessroll.sounds.SoundManager;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
import com.example.julian.endlessroll.views.LevelupMessage;
|
||||
import com.example.julian.endlessroll.views.TopBarData;
|
||||
|
||||
@ -47,6 +50,7 @@ public class GameActivity extends Activity implements ExceptionHandler, User.LvU
|
||||
private GameScreen gameScreen;
|
||||
|
||||
private LevelupMessage levelupMessage;
|
||||
private TutorialView tutorialView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -78,14 +82,15 @@ public class GameActivity extends Activity implements ExceptionHandler, User.LvU
|
||||
gameScreen = new GameScreen(topBarData, glSurfaceView);
|
||||
|
||||
levelupMessage = new LevelupMessage(this, typeface, user);
|
||||
tutorialView = new TutorialView(this);
|
||||
|
||||
flipper = new ScreenFlipper(this, startScreen, worldsScreen, levelsScreen, gameScreen, toolShopScreen);
|
||||
RelativeLayout relativeLayout = new RelativeLayout(this);
|
||||
relativeLayout.addView(glSurfaceView);
|
||||
relativeLayout.addView(flipper);
|
||||
relativeLayout.addView(levelupMessage.getLayout());
|
||||
relativeLayout.addView(tutorialView.getLayout());
|
||||
//TODO: add Tutorial
|
||||
//TODO: show Energy on levelButton if collected
|
||||
//TODO: Scroll up
|
||||
//TODO: Goal animation!
|
||||
//TODO: Goal screen animation!
|
||||
@ -137,6 +142,19 @@ public class GameActivity extends Activity implements ExceptionHandler, User.LvU
|
||||
});
|
||||
}
|
||||
|
||||
public void showTutorialScreen(final BreakPoint breakPoint) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tutorialView.show(breakPoint);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void onTutorialViewHidden(){
|
||||
gameScreen.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
try {
|
||||
|
@ -2,7 +2,10 @@ package com.example.julian.endlessroll.main;
|
||||
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.example.julian.endlessroll.levels.Level;
|
||||
import com.example.julian.endlessroll.main.screens.Screen;
|
||||
import com.example.julian.endlessroll.main.tutorial.BreakPoint;
|
||||
import com.example.julian.endlessroll.main.tutorial.Tutorial;
|
||||
|
||||
/**
|
||||
* Created by Julian on 08.12.2015.
|
||||
@ -15,4 +18,6 @@ public interface GameHandler extends ExceptionHandler {
|
||||
|
||||
RelativeLayout getRootLayout();
|
||||
|
||||
void showTutorialScreen(BreakPoint breakPoint);
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.example.julian.endlessroll.main.game;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.data.Vector;
|
||||
import com.example.julian.endlessroll.entities.DestroyEffect;
|
||||
import com.example.julian.endlessroll.entities.Energy;
|
||||
@ -15,13 +17,16 @@ import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
import com.example.julian.endlessroll.levels.Level;
|
||||
import com.example.julian.endlessroll.levels.LevelManager;
|
||||
import com.example.julian.endlessroll.levels.LevelPack;
|
||||
import com.example.julian.endlessroll.levels.levelup.LevelUpBounties;
|
||||
import com.example.julian.endlessroll.main.tutorial.BreakPoint;
|
||||
import com.example.julian.endlessroll.main.tutorial.Tutorial;
|
||||
import com.example.julian.endlessroll.user.LevelUpBounties;
|
||||
import com.example.julian.endlessroll.main.DataStorageHandler;
|
||||
import com.example.julian.endlessroll.main.GameHandler;
|
||||
import com.example.julian.endlessroll.main.GameLog;
|
||||
import com.example.julian.endlessroll.main.screens.Screen;
|
||||
import com.example.julian.endlessroll.rendering.Rendering;
|
||||
import com.example.julian.endlessroll.sounds.SoundManager;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
import com.example.julian.endlessroll.views.MessageType;
|
||||
import com.example.julian.endlessroll.views.ToolButton;
|
||||
import com.example.julian.endlessroll.views.ToolButtonBar;
|
||||
@ -57,6 +62,8 @@ public class Game extends Rendering<GameScene> {
|
||||
private List<Integer> collectedStars = new ArrayList<>();
|
||||
private boolean energyCollected;
|
||||
|
||||
private Tutorial currentTutorial;
|
||||
|
||||
public Game(GameHandler handler, TopBarData topBarData) throws Exception {
|
||||
super(topBarData.getGameActivity());
|
||||
this.handler = handler;
|
||||
@ -96,7 +103,9 @@ public class Game extends Rendering<GameScene> {
|
||||
this.level = level;
|
||||
this.levelPack = levelPack;
|
||||
if (scene != null) {
|
||||
currentTutorial = new Tutorial(new BreakPoint(5,R.layout.tutorial_test));
|
||||
collectedStars.clear();
|
||||
energyCollected = false;
|
||||
particleSystem.deleteAllSources();
|
||||
scene.loadLevel(level, levelPack.getTheme());
|
||||
player = scene.getPlayer();
|
||||
@ -123,7 +132,6 @@ public class Game extends Rendering<GameScene> {
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
// GameLog.d("update GAME");
|
||||
particleSystem.update(timer);
|
||||
float playerProgress = 0;
|
||||
float playerSpeed = 0;
|
||||
@ -147,6 +155,11 @@ public class Game extends Rendering<GameScene> {
|
||||
physics.applyGravity(scene, timer);
|
||||
scene.update(timer);
|
||||
collisionManager.update(physics, scene);
|
||||
currentTutorial.update(playerProgress);
|
||||
if(currentTutorial.isOverNewBreakPoint()){
|
||||
gameState = GameState.PAUSED;
|
||||
handler.showTutorialScreen(currentTutorial.getCurrentBreakPoint());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -202,6 +215,10 @@ public class Game extends Rendering<GameScene> {
|
||||
}
|
||||
}
|
||||
|
||||
public void setRunning(){
|
||||
gameState = GameState.RUNNING;
|
||||
}
|
||||
|
||||
private void addTool(float x, float y) {
|
||||
try {
|
||||
sounds.playSound(currentTool.getPlacingSound());
|
||||
@ -233,8 +250,10 @@ public class Game extends Rendering<GameScene> {
|
||||
}
|
||||
}
|
||||
|
||||
level.setEnergyCollected(true);
|
||||
user.onEnergyCollected();
|
||||
if(energyCollected) {
|
||||
level.setEnergyCollected(true);
|
||||
user.onEnergyCollected();
|
||||
}
|
||||
|
||||
viewManager.showMessage(levelPack.isLastLevel(level), MessageType.WIN);
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class GameScene extends Scene {
|
||||
}
|
||||
|
||||
public void onEnergyCollision(Energy energy){
|
||||
energy.destroy(DestroyEffect.STAR_EXPLOSION);
|
||||
energy.destroy(DestroyEffect.ENERGY_COLLECT);
|
||||
}
|
||||
|
||||
public void addObstacle(ObstacleData data) {
|
||||
|
@ -10,6 +10,8 @@ import com.example.julian.endlessroll.main.GameHandler;
|
||||
import com.example.julian.endlessroll.main.MyGlSurfaceView;
|
||||
import com.example.julian.endlessroll.main.game.Game;
|
||||
import com.example.julian.endlessroll.main.game.GameState;
|
||||
import com.example.julian.endlessroll.main.tutorial.BreakPoint;
|
||||
import com.example.julian.endlessroll.main.tutorial.Tutorial;
|
||||
import com.example.julian.endlessroll.views.TopBarData;
|
||||
|
||||
/**
|
||||
@ -37,6 +39,10 @@ public class GameScreen extends GLScreen<RelativeLayout> {
|
||||
game.pause();
|
||||
}
|
||||
|
||||
public void onResume(){
|
||||
game.setRunning();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackKeyDown() {
|
||||
if (game.getGameState() == GameState.RUNNING)
|
||||
@ -69,6 +75,11 @@ public class GameScreen extends GLScreen<RelativeLayout> {
|
||||
return layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showTutorialScreen(BreakPoint breakPoint) {
|
||||
activity.showTutorialScreen(breakPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onException(Exception e) {
|
||||
activity.onException(e);
|
||||
|
@ -12,7 +12,7 @@ import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.levels.LevelManager;
|
||||
import com.example.julian.endlessroll.main.GameActivity;
|
||||
import com.example.julian.endlessroll.main.MyGlSurfaceView;
|
||||
import com.example.julian.endlessroll.main.game.User;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
import com.example.julian.endlessroll.rendering.Rendering;
|
||||
import com.example.julian.endlessroll.sounds.SoundManager;
|
||||
|
||||
|
@ -11,12 +11,12 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolSlotSettings;
|
||||
import com.example.julian.endlessroll.user.ToolSlotSettings;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
import com.example.julian.endlessroll.levels.levelup.LevelUpBounties;
|
||||
import com.example.julian.endlessroll.user.LevelUpBounties;
|
||||
import com.example.julian.endlessroll.main.DataStorageHandler;
|
||||
import com.example.julian.endlessroll.main.GameActivity;
|
||||
import com.example.julian.endlessroll.main.game.User;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
import com.example.julian.endlessroll.views.ToolOfferSlot;
|
||||
import com.example.julian.endlessroll.views.TopBar;
|
||||
import com.example.julian.endlessroll.views.TopBarData;
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.example.julian.endlessroll.main.tutorial;
|
||||
|
||||
import android.support.annotation.IdRes;
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Created by Julian on 14.03.2017.
|
||||
*/
|
||||
|
||||
public class BreakPoint {
|
||||
|
||||
private float x;
|
||||
private @LayoutRes int viewId;
|
||||
|
||||
public BreakPoint(float x, @LayoutRes int viewId)
|
||||
{
|
||||
this.x = x;
|
||||
this.viewId = viewId;
|
||||
}
|
||||
|
||||
public float getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getViewId() {
|
||||
return viewId;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.example.julian.endlessroll.main.tutorial;
|
||||
|
||||
import com.example.julian.endlessroll.main.GameLog;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Julian on 14.03.2017.
|
||||
*/
|
||||
|
||||
public class Tutorial {
|
||||
|
||||
private List<BreakPoint> breakPoints;
|
||||
|
||||
private int currentBreakPointId = -1;
|
||||
private boolean overNewBreakPoint;
|
||||
|
||||
public Tutorial(BreakPoint... breakPoints){
|
||||
this.breakPoints = Arrays.asList(breakPoints);
|
||||
}
|
||||
|
||||
public void update(float playerProgress) {
|
||||
int nextBreakPoint = currentBreakPointId + 1;
|
||||
if (breakPoints.size() > nextBreakPoint && playerProgress >= breakPoints.get(nextBreakPoint).getX()) {
|
||||
currentBreakPointId++;
|
||||
overNewBreakPoint = true;
|
||||
} else
|
||||
overNewBreakPoint = false;
|
||||
}
|
||||
|
||||
public boolean isOverNewBreakPoint() {
|
||||
return overNewBreakPoint;
|
||||
}
|
||||
|
||||
public BreakPoint getCurrentBreakPoint() {
|
||||
return breakPoints.get(currentBreakPointId);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.example.julian.endlessroll.main.tutorial;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.example.julian.endlessroll.main.GameActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Julian on 24.02.2017.
|
||||
*/
|
||||
|
||||
public class TutorialView implements View.OnClickListener{
|
||||
|
||||
private RelativeLayout layout;
|
||||
private GameActivity activity;
|
||||
private LayoutInflater inflater;
|
||||
|
||||
public TutorialView(GameActivity activity){
|
||||
this.activity = activity;
|
||||
inflater = LayoutInflater.from(activity);
|
||||
layout = new RelativeLayout(activity);
|
||||
layout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
layout.setVisibility(View.GONE);
|
||||
layout.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public RelativeLayout getLayout() {
|
||||
return layout;
|
||||
}
|
||||
|
||||
public void show(BreakPoint breakPoint){
|
||||
inflater.inflate(breakPoint.getViewId(), layout);
|
||||
layout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v){
|
||||
layout.setVisibility(View.GONE);
|
||||
layout.removeAllViews();
|
||||
activity.onTutorialViewHidden();
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.julian.endlessroll.user;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
import com.example.julian.endlessroll.main.screens.Screen;
|
||||
import com.example.julian.endlessroll.views.BountyMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Julian on 26.01.2017.
|
||||
*/
|
||||
|
||||
public class LevelBounty {
|
||||
|
||||
private int starCount = 0;
|
||||
private int energyCount = 0;
|
||||
private ToolType toolType = ToolType.NONE;
|
||||
private boolean toolSlot = false;
|
||||
|
||||
public LevelBounty(int starCount, int energyCount, ToolType toolType, boolean toolSlot) {
|
||||
this.starCount = starCount;
|
||||
this.energyCount = energyCount;
|
||||
this.toolType = toolType;
|
||||
this.toolSlot = toolSlot;
|
||||
}
|
||||
|
||||
public List<BountyMessage> createBountyMessages(Context context, BountyMessage.ScreenSwitchCaller caller) {
|
||||
List<BountyMessage> list = new ArrayList();
|
||||
if (starCount != 0)
|
||||
list.add(new BountyMessage(context, R.drawable.currency_star, starCount + "", caller, Screen.ScreenType.NONE));
|
||||
if (energyCount != 0)
|
||||
list.add(new BountyMessage(context, R.drawable.currency_energy, energyCount + "", caller, Screen.ScreenType.NONE));
|
||||
if (toolType != ToolType.NONE)
|
||||
list.add(new BountyMessage(context, toolType.getButtonDrawable(), toolType.getName() + " unlocked!", caller, Screen.ScreenType.TOOL_SHOP));
|
||||
if (toolSlot)
|
||||
list.add(new BountyMessage(context, R.drawable.tools_unlockedbutton, "You unlocked a ToolSlot!", caller, Screen.ScreenType.TOOL_SHOP));
|
||||
return list;
|
||||
}
|
||||
|
||||
public ToolType getToolType() {
|
||||
return toolType;
|
||||
}
|
||||
|
||||
public boolean isToolSlot() {
|
||||
return toolSlot;
|
||||
}
|
||||
|
||||
public int getStarCount() {
|
||||
return starCount;
|
||||
}
|
||||
|
||||
public int getEnergyCount() {
|
||||
return energyCount;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.example.julian.endlessroll.levels.levelup;
|
||||
package com.example.julian.endlessroll.user;
|
||||
|
||||
import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.example.julian.endlessroll.entities.tools;
|
||||
package com.example.julian.endlessroll.user;
|
||||
|
||||
import com.example.julian.endlessroll.levels.levelup.LevelUpBounties;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolSlot;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
import com.example.julian.endlessroll.user.LevelUpBounties;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -1,9 +1,4 @@
|
||||
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;
|
||||
package com.example.julian.endlessroll.user;
|
||||
|
||||
/**
|
||||
* Created by Julian on 10.07.2016.
|
@ -1,7 +1,6 @@
|
||||
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;
|
||||
@ -10,10 +9,9 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.levels.levelup.LevelBounty;
|
||||
import com.example.julian.endlessroll.user.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.user.User;
|
||||
import com.example.julian.endlessroll.main.screens.Screen;
|
||||
|
||||
/**
|
||||
@ -59,7 +57,6 @@ public class LevelupMessage implements View.OnClickListener, BountyMessage.Scree
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
layout.clearAnimation();
|
||||
layout.setVisibility(View.GONE);
|
||||
unlockMessages.removeAllViews();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.example.julian.endlessroll.R;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolSlotSettings;
|
||||
import com.example.julian.endlessroll.user.ToolSlotSettings;
|
||||
import com.example.julian.endlessroll.entities.tools.ToolType;
|
||||
import com.example.julian.endlessroll.main.game.Game;
|
||||
import com.example.julian.endlessroll.main.game.GameState;
|
||||
|
@ -5,7 +5,7 @@ import android.graphics.Typeface;
|
||||
import com.example.julian.endlessroll.levels.LevelManager;
|
||||
import com.example.julian.endlessroll.main.DataStorageHandler;
|
||||
import com.example.julian.endlessroll.main.GameActivity;
|
||||
import com.example.julian.endlessroll.main.game.User;
|
||||
import com.example.julian.endlessroll.user.User;
|
||||
import com.example.julian.endlessroll.sounds.SoundManager;
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="20dp" />
|
||||
<padding
|
||||
android:bottom="9dp"
|
||||
android:left="9dp"
|
||||
android:right="9dp"
|
||||
android:top="9dp" />
|
||||
<stroke
|
||||
android:width="5dp"
|
||||
android:color="#000000" />
|
||||
<solid
|
||||
android:color="#ffffff"/>
|
||||
</shape>
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="6"
|
||||
android:id="@+id/button3"
|
||||
style="@style/customButton" />
|
||||
</LinearLayout>
|
20
app/src/main/res/layout/tutorial_test.xml
Normal file
20
app/src/main/res/layout/tutorial_test.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/backgrounds_menu_shortmenu">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/xml_tutorial_speechbubble_background"
|
||||
android:textColor="#000000"
|
||||
android:text="Welcome to Endless Roll!\nThis is a test tutorial screen!\nHave fun!"
|
||||
android:layout_marginRight="52dp"
|
||||
android:layout_marginEnd="52dp"
|
||||
android:layout_marginTop="39dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true" />
|
||||
</RelativeLayout>
|
Reference in New Issue
Block a user