Rev 457 |
Rev 542 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
package com.gebauz.PonPonChun.game;
import com.badlogic.gdx.Gdx;
import com.gebauz.PonPonChun.PonPonChunCustomServices;
import com.gebauz.PonPonChun.game.entities.PlayField;
public class GameModeLogicEndless
extends GameModeLogic
{
// Constants========================================================================================
// Embedded Types===================================================================================
// Members==========================================================================================
// Methods==========================================================================================
public GameModeLogicEndless
(GameLogic gameLogic
)
{
super(gameLogic, GameLogic.
GameMode.
ENDLESS);
}
@
Override
public void init
(String param
)
{
// TODO: interpret param for level/stage/speed
randomizeInitialLevel
(0);
getGameLogic
().
getPlayField().
loadPlayField(Gdx.
files.
internal("data/levels/level02.txt"));
getGameLogic
().
getPlayField().
setAdvanceSpeed(0.1f
);
}
public void randomizeInitialLevel
(int startRow
)
{
PlayField pf = getGameLogic
().
getPlayField();
pf.
clearAllBlocks();
// row by row randomization that prevents triplets
for (int dy = startRow
; dy
< (PlayField.
NUM_CELLS_Y); dy++
)
{
int[] row = generateRow
();
for (int dx =
0; dx
< row.
length; dx++
)
{
pf.
spawnBlock(row
[dx
], dx, dy
);
}
}
pf.
setNextRow(generateRow
());
}
@
Override
public void exit
()
{
}
@
Override
public void update
(float deltaTime
)
{
}
@
Override
public void render
()
{
if (getGameLogic
().
getPlayField().
isGameOver())
PonPonChunCustomServices.
getInstance().
getScoringFont().
drawText("GAME OVER",
100,
300, GameConsts.
WHITE_COLOR,
4);
}
// Getters/Setters==================================================================================
}