up
This commit is contained in:
1 parent
ae660adb4a
commit
0c24eff46b
33 files changed
+26
-13
No files matched your search
@@ -52,7 +52,7 @@ public class GameLogic extends SurfaceView implements SurfaceHolder.Callback {
|
||||
private Vibrator v;
|
||||
|
||||
static int BOARD_TILE_SIZE=17;
|
||||
static int BOARD_HEIGHT = 42;
|
||||
static int BOARD_HEIGHT = 31;
|
||||
static int BOARD_WIDTH = 28;
|
||||
static int GHOST_EAT_POINT = 200;
|
||||
static int FOODUP_POINT = 150;
|
||||
@@ -106,6 +106,7 @@ public class GameLogic extends SurfaceView implements SurfaceHolder.Callback {
|
||||
SoundStuff.sp.stop(ID);
|
||||
eatInRow = 0;
|
||||
first = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -243,7 +244,7 @@ public class GameLogic extends SurfaceView implements SurfaceHolder.Callback {
|
||||
path = boardGame.getPath();
|
||||
food = boardGame.getbGame();
|
||||
pacman = new PacMan(getResources(), new Vect((BOARD_TILE_SIZE
|
||||
* BOARD_WIDTH / 2), BOARD_TILE_SIZE * 34), getContext(),
|
||||
* BOARD_WIDTH / 2), BOARD_TILE_SIZE * 23), getContext(),
|
||||
boardGame.getBlock(), BOARD_TILE_SIZE, 100f);
|
||||
ghosts = new LinkedList<Ghost>();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Ghost extends GameObject {
|
||||
private int farame = 0;
|
||||
private int framecount = 0;
|
||||
private float frameTicker;
|
||||
private int framePeriod = 500;
|
||||
private float framePeriod = 0.5f;
|
||||
private boolean swap;
|
||||
|
||||
private double time; // do mrugania;
|
||||
@@ -134,9 +134,10 @@ public class Ghost extends GameObject {
|
||||
|
||||
}
|
||||
} else if (eatable && blinking) {
|
||||
after += gameTime - before;
|
||||
if (gameTime > frameTicker + framePeriod) {
|
||||
frameTicker = gameTime;
|
||||
frameTicker+= gameTime;
|
||||
time+=gameTime;
|
||||
if (frameTicker > framePeriod) {
|
||||
frameTicker = 0;
|
||||
// increment the frame
|
||||
if (!swap)
|
||||
currentFrame++;
|
||||
@@ -144,14 +145,14 @@ public class Ghost extends GameObject {
|
||||
currentFrame--;
|
||||
if (currentFrame == 0 || currentFrame == 1) {
|
||||
swap = !swap;
|
||||
if (after > 1000) {
|
||||
after = 0;
|
||||
framePeriod -= 80;
|
||||
if (time > 1) {
|
||||
time = 0;
|
||||
framePeriod -= 0.08;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
before = gameTime;
|
||||
|
||||
}
|
||||
// define the rectangle to cut out sprite
|
||||
sourceEatRect.left = currentFrame * spriteEatWidth;
|
||||
|
||||
Reference in new issue
Block a user