projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
5335fd9
)
rnd-19980814
author
Holger Schemel
<info@artsoft.org>
Fri, 14 Aug 1998 09:59:21 +0000
(11:59 +0200)
committer
Holger Schemel
<info@artsoft.org>
Sat, 30 Aug 2014 08:30:23 +0000
(10:30 +0200)
src/game.c
patch
|
blob
|
history
src/tools.c
patch
|
blob
|
history
diff --git
a/src/game.c
b/src/game.c
index 521cc1a8e549fcb3889e1ad86a6f055005d3bec5..f70257edee6f852965988d0bfef6e18313b0a2a8 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-1392,6
+1392,15
@@
void StartMoving(int x, int y)
if (CAN_FALL(element) && y<lev_fieldy-1)
{
if (CAN_FALL(element) && y<lev_fieldy-1)
{
+ if (PlayerPushing && PlayerMovPos)
+ {
+ int nextJX = JX + (JX - lastJX);
+ int nextJY = JY + (JY - lastJY);
+
+ if (x == nextJX && y == nextJY)
+ return;
+ }
+
if (element==EL_MORAST_VOLL)
{
if (IS_FREE(x,y+1))
if (element==EL_MORAST_VOLL)
{
if (IS_FREE(x,y+1))
@@
-3035,6
+3044,19
@@
void ScrollFigure(int init)
DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]);
*/
DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]);
*/
+
+ if (PlayerPushing)
+ {
+ int nextJX = JX + (JX - lastJX);
+ int nextJY = JY + (JY - lastJY);
+
+ if (Feld[nextJX][nextJY] == EL_SOKOBAN_FELD_VOLL)
+ DrawLevelElement(nextJX,nextJY, EL_SOKOBAN_FELD_LEER);
+ else
+ DrawLevelElement(nextJX,nextJY, EL_LEERRAUM);
+ }
+
+
DrawPlayerField();
return;
DrawPlayerField();
return;
@@
-3069,7
+3091,21
@@
void ScrollFigure(int init)
else
DrawLevelField(oldJX,oldJY);
else
DrawLevelField(oldJX,oldJY);
+ if (PlayerPushing)
+ {
+ int nextJX = JX + (JX - lastJX);
+ int nextJY = JY + (JY - lastJY);
+ if (PlayerMovPos)
+ {
+ if (Feld[nextJX][nextJY] == EL_SOKOBAN_FELD_VOLL)
+ DrawLevelElement(nextJX,nextJY, EL_SOKOBAN_FELD_LEER);
+ else
+ DrawLevelElement(nextJX,nextJY, EL_LEERRAUM);
+ }
+ else
+ DrawLevelElement(nextJX,nextJY, Feld[nextJX][nextJY]);
+ }
if (!PlayerMovPos)
{
if (!PlayerMovPos)
{
@@
-3268,7
+3304,8
@@
int DigField(int x, int y, int real_dx, int real_dy, int mode)
static long push_delay = 0;
static int push_delay_value = 5;
static long push_delay = 0;
static int push_delay_value = 5;
- PlayerPushing = FALSE;
+ if (!PlayerMovPos)
+ PlayerPushing = FALSE;
if (mode == DF_NO_PUSH)
{
if (mode == DF_NO_PUSH)
{
diff --git
a/src/tools.c
b/src/tools.c
index 8dd25fcf29c2ba0837320ab6722b1183880b4e37..85c9009f2be9c75079af182617834dbbc8d9bd7d 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-507,6
+507,26
@@
void DrawPlayerField()
*/
*/
+
+ if (PlayerPushing && PlayerMovPos)
+ {
+ int nextJX = JX + (JX - lastJX);
+ int nextJY = JY + (JY - lastJY);
+ int px = SCROLLX(nextJX), py = SCROLLY(nextJY);
+
+ if (Feld[JX][JY] == EL_SOKOBAN_FELD_LEER ||
+ Feld[nextJX][nextJY] == EL_SOKOBAN_FELD_VOLL)
+ DrawGraphicShiftedThruMask(px,py,sxx,syy,
+ GFX_SOKOBAN_OBJEKT,
+ CUT_NO_CUTTING);
+ else
+ DrawGraphicShifted(px,py,sxx,syy,
+ el2gfx(Feld[nextJX][nextJY]),
+ CUT_NO_CUTTING);
+ }
+
+
+
/* draw things in front of player (EL_DYNAMIT || EL_DYNABOMB) */
if (element == EL_DYNAMIT || element == EL_DYNABOMB)
/* draw things in front of player (EL_DYNAMIT || EL_DYNABOMB) */
if (element == EL_DYNAMIT || element == EL_DYNABOMB)