-Release Version 1.0 [9 APR 97]
-------------------------------
- - the game now contains many really playable levels,
- not only a few levels for testing
- - the game is now even better playable by keyboard
- (now you have the same gameplay functionality
- compared to playing with a joystick. Especially
- there are diagonal directions with keyboard playing
- and the fire buttons are mapped to the shift keys)
- - a lot of new elements for better emulation of levels
- from the games "Boulderdash", "Emerald Mine" and
- "Sokoban". New elements to build "Dynablaster" style
- levels.
- - enhanced functionality of the level tape recorder
- to make it possible to go on with a game at any tape
- position
-
Prerelease Version 0.9b [4 NOV 95]
-----------------------------------
+------------------------------------
- the game is now completely Freeware
- the game is now better playable by keyboard
(in the last version, the player was making more than
+++ /dev/null
-This program is copyrighted (c) 1995 by Holger Schemel.
-
-It is freely distributable as long as no profit is made with it
-and as long as the package is left complete and unmodified.
-
-The fact that this program comes with full source does not mean
-that you can do what you want with it - it is only intended to
-give you the chance to build it on your own machine.
-
-If you want to distribute this program on CDROM, you have to ask for
-permission first -- just send me E-Mail and tell me what kind of
-CDROM it is. Normally I will give my permission if
- - the CDROM itself contains only freely distributable software
- - the author of this program (me!) gets a free copy of the CDROM
- - the program is distributed in its original, unmodified package
-
-If the three conditions above are fulfilled, this permission will
-automatically given to the following CDROM distributions:
- - InfoMagic "LINUX Developer's Resource"
- - The Debian Linux Distribution CDROM
- - any CDROM with a mirror of sunsite.unc.edu or a mirror of another
- FTP server that contains this program
-
-If you are in doubt (e.g., want to distribute a pre-installed version),
-feel free to mail me about it (see the file 'README' in this archive).
+++ /dev/null
-
-THIS GAME IS PROVIDED "AS IS" -- USE IT AT YOUR OWN RISK!
-IF THIS GAME BLOWS UP YOUR COMPUTER OR OPERATING SYSTEM
-OR ANYTHING ELSE, IT'S NOT MY FAULT! I'M NOT RESPONSIBLE
-FOR ANY DAMAGE THAT MIGHT BE CAUSED BY MY PROGRAM!
+++ /dev/null
-
-WHAT TO DO TO INSTALL "ROCKS_N_DIAMONDS-0.9" ON YOUR SYSTEM
-===========================================================
-
-If you have a Linux system (Intel based, a.out, kernel 1.2.x), you
-can use the precompiled binary.
-
-If you have another Unix system, or an ELF system or just want to
-compile the program by yourself, do the following:
-
-Edit the file "Makefile" and set the following options:
-
-XPM_INCLUDE_FILE - change this to the location where you
- have your XPM-Library include file.
-
- You must have the XPM-Library "libXpm"
- installed on your system to run this game.
- If you don't have it, look at your local
- FTP site with X11 archive to get it! :)
-
-GAME_DIR - You can leave these values untouched
- if you use the default location for
- the game directory.
- If you want to move it to other places in
- your directory tree, just change them
- accordingly. (You can use symlinks instead,
- of course.)
- You might want to set GAME_DIR to the full
- path of the game in your file system, so
- you don't have to go to the game directory
- when you want to play it.
-
-SOUNDS - If you never want to hear any sounds,
- set this to "-DNO_SOUNDS", but be warned:
- It's much less fun playing without sound! :)
- (The program detects by itself if it can
- play sounds or not, anyway.)
-
-SCORE_ENTRIES - Set this to "-DONE_PER_NAME" if you want
- to allow only one entry per player in the
- score file for each level. This is useful
- if there are many players to prevent one
- single player to "flood" the Hall Of Fame
- of every level completely with his name...
- On single user systems, "-DMANY_PER_NAME"
- might be useful to have your name more
- than once in the list.
-
-SYSTEM - If you have problems with the default
- settings, it might be useful to uncomment
- one of the defines for "SYSTEM" in the
- Makefile, which defines values like
- "-DSYSV" and something like that.
-
-CC, INCL, LIBS - Set these ones to the appropriate values
- you usually use on your system to compile.
-
-
-Now you can 'make clean' and 'make' and the game binary should be
-compiled right out of the box. I have tested it with "-Wall" on my
-system, so I hope that it compiles fine on other systems, too.
-
-The program should compile and run on Linux (of course),
-HP-UX, AIX, Net-BSD, SUN and IRIX.
-
-Have fun!
-
-Holger Schemel, 22. Oktober 1995
+++ /dev/null
-
-Some recommendations for more fun playing Rocks'n'Diamonds:
-===========================================================
-
-About sound
------------
-It is highly recommended to have a decent sound interface for playing
-this game (although it only comes with bad-quality 8000-Hz-samples to
-save memory and to be compatible with /dev/audio).
-
-The best sound platform is an actual Linux system with (at least) kernel
-1.2.x, because it offers some nice real-time sound features which are
-needed to have background music loops in the game.
-
-On all other systems you don't have music loops, but you still have all
-the other sounds.
-
-
-About game speed
-----------------
-You should have a relatively fast hardware.
-
-The game was developed on a i486/33 (which is three years old now),
-and you should probably better not try to run it on a slower system.
-
-You should have an accelerated graphic card; I have found out that it
-starts being playable on my 486/33 with an old ISA cirrus logic 5426
-graphic card, which has a blitter that is supported by XFree86[tm],
-but that it was nearly unplayable on a 486/66 with old, unaccelerated
-ET4000.
-
-If all works fine, you should have something around 30 frames per second.
-
-If you think that the game is to slow to play, you should try out the
-following things:
-
-- Set "Buffered Gfx" to "off" in the setup menu. Normally (on a fast
- enough system) you should use buffered graphics, which means that
- all graphics is drawn into an invisible Pixmap and is then copied
- to the X11 window to avoid flickering. If you disable this double
- buffering, the graphic is directly drawn into the window. This can
- cause some slight flickering, but makes graphic operations roughly
- twice as fast compared to double buffering.
-
-- Set "Game Music" to "off" in the setup menu (and maybe "sound loops"
- too). Where disabling buffered graphics may be required with slow
- graphics hardware, disabling sound is especially recommended on slow
- CPU systems (486/33 and slower), because the sound server eats up a
- significant amount of CPU time when playing long sounds.
-
-You might also notice that bigger levels tend to be slower on slow
-systems.
-
-About the option "Fading" in the setup menu: It gives a nice looking
-fading when switching to a new screen, but you should really only try
-this out if you think that you have a very fast graphics hardware.
-
-
-About music
------------
-The background music loops are ripped out from several nice music albums.
-Just have a look at the info screen to find out from which album each
-sound loop came from -- they are all very well done pieces of music, but
-unfortunately they don't sound better after converting them to 8 kHz
-samples (to conform to standard SUN /dev/audio). Maybe I change this to
-a better quality in the future, but at the moment, where the sounds
-directory has a size of nearly a megabyte, I'll stay with 8 kHz samples.
-
-So, if you have a non-Linux system (which cannot play sound loops) or
-don't like the "telephone quality" of the music loops, just get some of
-these CDs and play them while your playing the game! ;-)
-
-
-About game-play
----------------
-It is *strongly recommended* to play this game with a high-quality joystick.
-That means, throw your $10 joystick out of the window and buy a decent
-Competition-Pro Digital PC joystick or a high-quality CH Products Analog
-joystick. Believe me, it doubles the fun of playing the game.
-
-If you only have a normal Unix system (and no fine Linux system), you
-are forced to play with the keyboard. It works, but is not only less fun,
-but also more difficult with some levels, because you cannot move in
-diagonal directions with keyboard control at the moment. Another bad thing
-is that you will have some problems when pressing many keys at the same
-time. This might change in the future, when I implement a better keyboard
-handling which not only solves these problems but allows diagonal directions,
-too.
-
+++ /dev/null
-
-THIS GAME IS NOW COMPLETELY FREEWARE!
-=====================================
-
-In version 0.9, I planned to offer the possibility to become a
-registered user and get special level series for registered users
-only and some more things.
-
-Now I have decided that it is better to distribute it as Freeware,
-that means: Freely distributable, but still copyrighted software.
-
-If you like this game, please send me mail about it!
-
- aeglos@valinor.owl.de
-
-or SnailMail:
-
- Holger Schemel
- Sennehof 28
- 33659 Bielefeld
- GERMANY
-
-Have fun!
# because the GIF loading routines are still a bit beta.
# If you use the Xpm library, convert the GIF files to Xpm
# files (and the mask files ('*Maske.gif') to xbm files).
-# XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
+XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK) \
$(SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
# LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
# # for SunOS and others
-# LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
-LIBS = -L/usr/X11R6/lib -lX11 -lm
+LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
+# LIBS = -L/usr/X11R6/lib -lX11 -lm
# CFLAGS = -O2 $(CONFIG) $(SYSTEM)
CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
clean:
$(RM) $(OBJS)
+BACKUP_DIR = /home/aeglos/BACKUP/rnd
+BACKUP_DATE = `date +%y%m%d`
+BACKUP_FILE = $(BACKUP_DIR)/rnd-$(BACKUP_DATE).tgz
+
backup:
- @echo "tar cvzf /usr/AEGLOS/BACKUP/rnd-`date +%Y%m%d | cut -b 3-8`.tgz *.c *.h Makefile"
- @tar cvzf /usr/AEGLOS/BACKUP/rnd-`date +%Y%m%d | cut -b 3-8`.tgz *.c *.h Makefile
+ @echo "tar cvzf $(BACKUP_FILE) *.c *.h Makefile"
+ @tar cvzf $(BACKUP_FILE) *.c *.h Makefile
depend:
for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
int Gamespeed = 4;
int Movemethod = 0;
int Movespeed[2] = { 10, 3 };
+char *Movespeed_text[2] = { "asynchron", "syncron" };
void HandleKey(KeySym key, int key_status)
{
joy |= JOY_BUTTON_1 | JOY_DOWN;
break;
case XK_Shift_L: /* Linker Feuerknopf */
+ case XK_Control_L:
+ case XK_Alt_L:
+ case XK_Meta_L:
joy |= JOY_BUTTON_1;
break;
case XK_Shift_R: /* Rechter Feuerknopf */
+ case XK_Control_R:
+ case XK_Alt_R:
+ case XK_Meta_R:
case XK_B: /* (Bombe legen) */
case XK_b:
joy |= JOY_BUTTON_2;
case XK_8:
case XK_9:
Movespeed[Movemethod] = (Movemethod == 0 ? 4 : 0) + (key - XK_0);
- printf("method == %d, speed == %d\n",
- Movemethod, Movespeed[Movemethod]);
+ printf("method == %d, speed == %d (%s)\n",
+ Movemethod, Movespeed[Movemethod],
+ Movespeed_text[Movemethod]);
break;
case XK_a:
Movemethod = !Movemethod;
- printf("method == %d, speed == %d\n",
- Movemethod, Movespeed[Movemethod]);
+ printf("method == %d, speed == %d (%s)\n",
+ Movemethod, Movespeed[Movemethod],
+ Movespeed_text[Movemethod]);
break;
case XK_f:
#endif
case XK_x:
- /*
+
{
- int i,j,k, num_steps = 4, step_size = TILEX / num_steps;
+ int i,j,k, num_steps = 16, step_size = TILEX / num_steps;
+ static long scroll_delay=0;
+ long scroll_delay_value = 4*4 / num_steps;
+
+ printf("Scroll test\n");
for(i=0;i<10;i++)
{
for(k=0;k<num_steps;k++)
{
int xxx = j*TILEX+k*step_size;
-
- XCopyArea(display,backbuffer,window,gc,
- REAL_SX+xxx,REAL_SY,
- FULL_SXSIZE-xxx,FULL_SYSIZE,
- REAL_SX,REAL_SY);
- XCopyArea(display,backbuffer,window,gc,
- REAL_SX,REAL_SY,
- xxx,FULL_SYSIZE,
- REAL_SX+FULL_SXSIZE-xxx,REAL_SY);
-
- XFlush(display);
- XSync(display,FALSE);
+ int done = 0;
+
+ while(!done)
+ {
+ if (DelayReached(&scroll_delay, scroll_delay_value))
+ {
+ XCopyArea(display,backbuffer,window,gc,
+ SX+xxx,SY,
+ SXSIZE-xxx,SYSIZE,
+ SX,SY);
+ XCopyArea(display,backbuffer,window,gc,
+ SX,SY,
+ xxx,SYSIZE,
+ SX+SXSIZE-xxx,SY);
+
+ XFlush(display);
+ XSync(display,FALSE);
+
+ done = 1;
+ }
+ else
+ {
+ Delay(1000);
+ }
+ }
+
+ /*
+ Delay(160000 / num_steps);
+ */
+ /*
Delay(120000 / num_steps);
+ */
}
}
}
}
- */
+
break;
default:
return;
}
+
+
+ if (PlayerMovPos)
+ ScrollFigure(0);
+
+
+
if (tape.pausing || PlayerGone)
joy = 0;
JX = newJX;
JY = newJY;
+
+ JX2 = oldJX;
+ JY2 = oldJY;
+
+ PlayerMovPos = TILEX/4;
+ PlayerMovPos = (dx > 0 || dy > 0 ? -1 : 1) * 3*TILEX/4;
+
+ ScrollFigure(-1);
+
if (Store[oldJX][oldJY])
{
DrawGraphic(SCROLLX(oldJX),SCROLLY(oldJY),el2gfx(Store[oldJX][oldJY]));
return(moved);
}
+void ScrollFigure(int init)
+{
+ static long actual_frame_counter;
+
+ if (init)
+ {
+ actual_frame_counter = FrameCounter;
+ return;
+ }
+ else if (!FrameReached(&actual_frame_counter,1))
+ return;
+
+ PlayerMovPos += (PlayerMovPos > 0 ? -1 : 1) * TILEX/4;
+
+ DrawLevelElement(JX2,JY2, Feld[JX2][JY2]);
+ DrawPlayerField();
+}
+
void TestIfGoodThingHitsBadThing(int goodx, int goody)
{
int i, killx = goodx, killy = goody;
void ScrollLevel(int, int);
BOOL MoveFigureOneStep(int, int, int, int);
BOOL MoveFigure(int, int);
+
+void ScrollFigure(int);
+
void TestIfGoodThingHitsBadThing(int, int);
void TestIfBadThingHitsGoodThing(int, int);
void TestIfHeroHitsBadThing(void);
register int dwx, dwy;
byte *data;
- data = (byte *)malloc(width * height);
+ data = (byte *)malloc(width * height * depth);
old_image = *image;
+
+ /*
new_image = XCreateImage(display,visual,depth,
ZPixmap,0,data,width,height,8,0);
+ */
+
+ new_image = XGetImage(display,RootWindow(display,screen),
+ 0,0,width,height,0xffffffff,ZPixmap);
+
+
if (!new_image)
return(GIF_NoMemory);
}
else /* other format change than 8 bit -> 4 bit */
{
- register unsigned long pixel_value;
+ unsigned long pixel_value;
for (dwx=0; dwx<width; dwx++)
{
for (dwy=0; dwy<height; dwy++)
{
pixel_value = XGetPixel(old_image, dwx, dwy);
+
+ if (pixel_value > 0xff)
+ printf("pixel = %lx", pixel_value);
+
XPutPixel(new_image, dwx, dwy, pixel_value);
}
}
pix[PIX_DB_DOOR] = XCreatePixmap(display, window,
3*DXSIZE,DYSIZE+VYSIZE,
XDefaultDepth(display,screen));
+ pix[PIX_DB_FIELD] = XCreatePixmap(display, window,
+ SXSIZE+2*TILEX,SYSIZE+2*TILEY,
+ XDefaultDepth(display,screen));
if (!pix[PIX_DB_BACK] || !pix[PIX_DB_DOOR])
{
}
drawto = drawto_field = backbuffer = pix[PIX_DB_BACK];
+ fieldbuffer = pix[PIX_DB_FIELD];
XCopyArea(display,pix[PIX_BACK],backbuffer,gc,
0,0, WIN_XSIZE,WIN_YSIZE, 0,0);
XpmAttributes xpm_att[NUM_PICTURES];
#endif
-Drawable drawto, drawto_field, backbuffer;
+Drawable drawto, drawto_field, backbuffer, fieldbuffer;
Colormap cmap;
int sound_pipe[2];
int level_nr, leveldir_nr, num_leveldirs;
int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
-int JX,JY, ZX,ZY, ExitX,ExitY;
-int PlayerMovDir, PlayerFrame, PlayerPushing;
+int JX,JY, JX2,JY2, ZX,ZY, ExitX,ExitY;
+int PlayerMovDir, PlayerMovPos, PlayerFrame, PlayerPushing;
int PlayerGone,LevelSolved,GameOver;
int FrameCounter,TimeFrames,TimeLeft,Score;
int Gems,SokobanFields,Lights,Friends;
#define IN_SCR_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
#define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
+/*
#define IS_PLAYER(x,y) (JX==(x) && JY==(y))
+*/
+
+#define IS_PLAYER(x,y) ((JX==(x) && JY==(y)) || (JX2==(x) && JY2==(y)))
+
#define IS_FREE(x,y) (Feld[x][y]==EL_LEERRAUM && !IS_PLAYER(x,y))
#define IS_FREE_OR_PLAYER(x,y) (Feld[x][y]==EL_LEERRAUM)
#define IS_MOVING(x,y) (MovPos[x][y]!=0)
/* Pixmaps without them */
#define PIX_DB_BACK 6
#define PIX_DB_DOOR 7
+#define PIX_DB_FIELD 8
#define NUM_PICTURES 6
-#define NUM_PIXMAPS 8
+#define NUM_PIXMAPS 9
/* boundaries of arrays etc. */
#define MAX_NAMELEN (10+1)
extern XpmAttributes xpm_att[];
#endif
-extern Drawable drawto, drawto_field, backbuffer;
+extern Drawable drawto, drawto_field, backbuffer, fieldbuffer;
extern Colormap cmap;
extern int sound_pipe[2];
extern int level_nr, leveldir_nr, num_leveldirs;
extern int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
-extern int JX,JY, ZX,ZY, ExitX,ExitY;
-extern int PlayerMovDir, PlayerFrame, PlayerPushing;
+extern int JX,JY, JX2,JY2, ZX,ZY, ExitX,ExitY;
+extern int PlayerMovDir, PlayerMovPos, PlayerFrame, PlayerPushing;
extern int PlayerGone,LevelSolved,GameOver;
extern int FrameCounter,TimeFrames,TimeLeft,Score;
extern int Gems,SokobanFields,Lights,Friends;
#define VERSION_STRING "1.1"
#define GAMETITLE_STRING "Rocks'n'Diamonds"
#define WINDOWTITLE_STRING GAMETITLE_STRING " " VERSION_STRING
-#define COPYRIGHT_STRING "Copyright ^1995-97 by Holger Schemel"
+#define COPYRIGHT_STRING "Copyright ^1995-98 by Holger Schemel"
/* Leerer Login- und Alias-Name */
#define EMPTY_LOGIN "NO_LOGIN"
#include <ansidecl.h>
#include <errno.h>
#include <limits.h>
-#include <stddef.h>
#include <stdlib.h>
#include "random.h"
{
int x = JX, y = JY;
int sx = SCROLLX(x), sy = SCROLLY(y);
+
+ int sxx = 0, syy = 0;
+
int element = Feld[x][y];
int graphic, phase;
BOOL draw_thru_mask = FALSE;
graphic += PlayerFrame;
+
+ if (PlayerMovPos)
+ {
+ if (PlayerMovDir == MV_LEFT || PlayerMovDir == MV_RIGHT)
+ sxx = PlayerMovPos;
+ else
+ syy = PlayerMovPos;
+ }
+
+
if (draw_thru_mask)
- DrawGraphicThruMask(sx,sy, graphic);
+ DrawGraphicThruMask(sx + sxx, sy + syy, graphic);
else
- DrawGraphic(sx,sy, graphic);
+ DrawGraphicShifted(sx,sy,sxx,syy,graphic,CUT_NO_CUTTING);
+ /*
+ DrawGraphic(sx + sxx, sy + syy, graphic);
+ */
+
/* draw things in front of player (EL_DYNAMIT || EL_DYNABOMB) */