xjump-2.7.5.orig/0040755000175000017500000000000007424152512012345 5ustar tarutaruxjump-2.7.5.orig/xjump-icon.xpm0100644000175000017500000000240307206206256015163 0ustar tarutaru/* XPM */ static char * xjump_icon_xpm[] = { "32 32 5 1", " c None", ". c #000000", "+ c #FFE7C7", "@ c #FF0000", "# c #00FF00", " ", " ", " ", " ..... ", " ......... ", " ........... ", " ............. ", " .......+++++. ", " ......++++++++. ", " .....+++++++++. ", " ....++++++..++. ", " ...+++++++..++. ", " ..++++++++++++. ", " ..+++++++++++.. ......", " .+++++++++++. ..@@@@@.", " ...........+++++++++...@@@@@@. ", ".@@@@@@@@@@@..+++++..@@@@@@@@. ", ".@@@@@@@@@@@@@.....@@@@@@@@.. ", " ..@@@@@@@@@@@@@@@@@@@@@@@. ", " ..@@@@@@@@@@@@@@@@@@@@. ", " ...@@@@@@@@@@@@@@@.. ", " ............... ", " .##############.... ", " ...###################. ", " ..#######################. ", " .##########################. ", " .############.....###########. ", ".#######...... ......######.", " ....... ....##.", " .. ", " ", " "}; xjump-2.7.5.orig/debian/0040755000175000017500000000000007424152512013567 5ustar tarutaruxjump-2.7.5.orig/debian/control0100644000175000017500000000063207423772627015206 0ustar tarutaruSource: xjump Section: games Priority: optional Maintainer: Masato Taruishi Build-Depends: debmake, xlibs-dev, libxaw7-dev Standards-Version: 3.1.1 Package: xjump Architecture: any Depends: ${shlibs:Depends} Description: A jumping game for X. A jumping game for X. The way to play this game is very simple, but nice game. What you do in this game is only to jump, jump and jump up above. xjump-2.7.5.orig/debian/rules0100755000175000017500000000243507206207077014655 0ustar tarutaru#!/usr/bin/make -f # Made with the aid of debmake, by Christoph Lameter, # based on the sample debian/rules file for GNU hello by Ian Jackson. package=xjump build: $(checkdir) make CFLAGS="-O2 -g -Wall" touch build clean: $(checkdir) -rm -f build -make clean -rm -f `find . -name "*~"` -rm -rf debian/tmp debian/files* core debian/substvars binary-indep: checkroot build $(checkdir) # There are no architecture-independent files to be uploaded # generated by this package. If there were any they would be # made here. binary-arch: checkroot build $(checkdir) -rm -rf debian/tmp install -d debian/tmp cd debian/tmp && install -d `cat ../dirs` make install DESTDIR=`pwd`/debian/tmp install -m 644 -o root -g root xjump-icon.xpm debian/tmp/usr/share/pixmaps/ ln -s ../man7/undocumented.7.gz debian/tmp/usr/man/man6/xjump.6.gz # Must have debmake installed for this to work. Otherwise please copy # /usr/bin/debstd into the debian directory and change debstd to debian/debstd debstd README.euc dpkg-gencontrol -isp chown -R root.root debian/tmp chmod -R go=rX debian/tmp dpkg --build debian/tmp .. define checkdir test -f debian/rules endef binary: binary-indep binary-arch checkroot: $(checkdir) test root = "`whoami`" .PHONY: binary binary-arch binary-indep clean checkroot xjump-2.7.5.orig/debian/dirs0100644000175000017500000000010207423773575014462 0ustar tarutaruvar/games/xjump usr/games usr/share/pixmaps/ usr/man usr/man/man6 xjump-2.7.5.orig/debian/postinst0100644000175000017500000000067107424150463015401 0ustar tarutaru#!/bin/sh -e if [ "$1" = configure ]; then if test -f /var/lib/games/xjump/record; then echo -n "Moving xjump record file to /var/games/xjump... " mv /var/lib/games/xjump/record /var/games/xjump/ rmdir /var/lib/games/xjump/ 2> /dev/null || true echo "done." elif ! test -f /var/games/xjump/record; then touch /var/games/xjump/record fi chmod 660 /var/games/xjump/record chgrp games /var/games/xjump/record fi xjump-2.7.5.orig/debian/copyright0100644000175000017500000000070106757147431015531 0ustar tarutaruThis package was debianized by Masato Taruishi Copyright (C) 1997-1999 Tatsuya Kudoh(CDR/TK) Masato Taruishi This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version without ANY WARRANTIES. xjump-2.7.5.orig/debian/changelog0100644000175000017500000000542507424152510015442 0ustar tarutaruxjump (2.7.5-1) unstable; urgency=high * Oops. Fixed the missing argument bug in postinst. (closes: #130731) * I'd like to say thank you to Colin Watson who worked for Bug#92517. * Added debian/debuild.sh. * Rebuiling makes the icon file to be included (closes: #122732). -- Masato Taruishi Fri, 25 Jan 2002 12:24:28 +0900 xjump (2.7.4-1) unstable; urgency=high * xjump isn't a debian native package. * Moved record file to /var/games/ (closes: #92517) Urgency=high, because this is a release-critical-bug. -- Masato Taruishi Thu, 24 Jan 2002 20:41:18 +0900 xjump (2.7.3) unstable; urgency=low * Added Build-Depends on libxaw-dev (closes: #84649). -- Masato Taruishi Sun, 4 Mar 2001 01:57:15 +0900 xjump (2.7.2) unstable; urgency=low * Added an icon from Robert Cleaver Ancell (closes: #75874). * Addded Build-Depends. -- Masato Taruishi Mon, 20 Nov 2000 20:48:16 +0900 xjump (2.7.1) unstable; urgency=low * Rebuilt against new xpm4g-dev (closes: #67936). -- Masato Taruishi Fri, 18 Aug 2000 23:55:05 +0900 xjump (2.7) unstable; urgency=low * debian/ included in orig.tar.gz. Now no need diffs for debian. * Score 10 digitization refering to the Linux Japan.com patch. -- Masato Taruishi Thu, 19 Aug 1999 20:50:52 +0900 xjump (2.6.1-5) unstable; urgency=low * Fixed prerm for the problem removing score file anyway. -- Masato Taruishi Sat, 20 Jun 1998 01:11:15 +0900 xjump (2.6.1-4) frozen-jp unstable-jp; urgency=low * Removed README.debian. -- Masato Taruishi Fri, 12 Jun 1998 05:29:05 +0900 xjump (2.6.1-3) unstable; urgency=low * Fixed it so that the obsolete copyright file had stayed. -- Masato Taruishi Fri, 5 Jun 1998 03:00:41 +0900 xjump (2.6.1-2) unstable; urgency=low * Fixed it with the bug original file not contain copyright file. -- Masato Taruishi Thu, 4 Jun 1998 01:17:34 +0900 xjump (2.6.1-1) unstable; urgency=low * Licence changed into GPL. * New upstream verion. -- Masato Taruishi Wed, 3 Jun 1998 02:38:59 +0900 xjump (2.6-3) unstable; urgency=low * Rebuild it associated with xfree86-freetype changes. -- Masato Taruishi Tue, 26 May 1998 02:20:40 +0900 xjump (2.6-2) unstable; urgency=low * Move record file removing script to prerm. * Change the maintainer's mail address and PGP key. -- Masato Taruishi Tue, 19 May 1998 16:33:47 +0900 xjump (2.6-1) unstable; urgency=low * Initial Release. -- Masato Taruishi Wed, 25 Feb 1998 16:47:20 +0900 Local variables: mode: debian-changelog End: xjump-2.7.5.orig/debian/menu0100644000175000017500000000020607206207121014444 0ustar tarutaru?package(xjump):needs="x11" section="Games/Arcade" icon="/usr/share/pixmaps/xjump-icon.xpm" title="Xjump" command="/usr/games/xjump" xjump-2.7.5.orig/debian/prerm0100644000175000017500000000016107423772267014650 0ustar tarutaru#!/bin/sh -e rm -f /var/lib/games/xjump/record case "$1" in remove) rm -f /var/games/xjump/record ;; esac xjump-2.7.5.orig/debian/suid0100644000175000017500000000002006762027074014453 0ustar tarutaruusr/games/xjump xjump-2.7.5.orig/debian/debuild.sh0100755000175000017500000000027507424152114015535 0ustar tarutaru#!/bin/sh -e dh_testdir fakeroot debian/rules clean pwd=`pwd` dirname=`basename $pwd` rm -rf ../$dirname.orig cp -a . ../$dirname.orig rm -f ../xjump_2.7.5.orig.tar.gz # evil debuild "$@" xjump-2.7.5.orig/copyright0100644000175000017500000000056506762025205014305 0ustar tarutaruCopyright (C) 1997-1998 Tatsuya Kudoh(CDR/TK) and Masato Taruishi This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version without ANY WARRANTIES. xjump-2.7.5.orig/resource.c0100644000175000017500000000640206757147346014360 0ustar tarutaru/***************************************** xjump version 2 resource.h フォールバックリソース (C) Nov 8, 1997 ROYALPANDA *****************************************/ #include char *DefaultResources[] = { "XJump*font : -adobe-*-*-*-*-*-24-*-*-*-*-*-*-*", "XJump*foreground : white", "XJump*background : black", "XJump*borderColor : white", "XJump*defaultDistance : 16", "XJump*borderWidth : 0", "XJump*title.label : FALLING TOWER ver 2.7", "XJump*title.horizDistance : 64", "XJump*title.foreground : white", "XJump*title.background : blue", "XJump*title.borderColor : navy", "XJump*title.borderWidth : 4", "XJump*scoreBoard.fromVert : title", "XJump*scoreBoard.horizDistance : 128", "XJump*scLabel.label : Floor", "XJump*score.fromHoriz : scLabel", "XJump*gameover.label : Game Over", "XJump*gameover.fromVert : scoreBoard", "XJump*gameover.horizDistance : 200", "XJump*gameover.vertDistance : 96", "XJump*gameover.foreground : white", "XJump*gameover.background : blue", "XJump*gameover.borderColor : navy", "XJump*gameover.borderWidth : 4", "XJump*pause.label : Pause", "XJump*pause.fromVert : scoreBoard", "XJump*pause.horizDistance : 224", "XJump*pause.vertDistance : 96", "XJump*pause.foreground : white", "XJump*pause.background : blue", "XJump*pause.borderColor : navy", "XJump*pause.borderWidth : 4", "XJump*scr.fromVert : scoreBoard", "XJump*scr.borderWidth : 0", "XJump*record_v.fromVert : scoreBoard", "XJump*record_v.allowVert : True", "XJump*record_v.allowHoriz : True", "XJump*record_v*borderWidth : 1", "XJump*record.font : -*-fixed-*-*-*-*-20-*-*-*-c-*-*-*", "XJump*copyright.label : (C) 1997 ROYALPANDA", "XJump*copyright.foreground : green", "XJump*copyright.fromVert : scr", "XJump*copyright.horizDistance : 64", "XJump*game.translations : #override \\n\ \ Left : key_on(LEFT) \\n\ Left : key_off(LEFT) \\n\ j : key_on(LEFT) \\n\ j : key_off(LEFT) \\n\ KP_4 : key_on(LEFT) \\n\ KP_4 : key_off(LEFT) \\n\ : key_on(LEFT) \\n\ : key_off(LEFT) \\n\ \ Right : key_on(RIGHT) \\n\ Right : key_off(RIGHT) \\n\ l : key_on(RIGHT) \\n\ l : key_off(RIGHT) \\n\ KP_6 : key_on(RIGHT) \\n\ KP_6 : key_off(RIGHT) \\n\ : key_on(RIGHT) \\n\ : key_off(RIGHT) \\n\ \ Up : key_on(UP)start() \\n\ Up : key_off(UP) \\n\ space : key_on(UP)start() \\n\ space : key_off(UP) \\n\ z : key_on(UP) \\n\ z : key_off(UP)start() \\n\ KP_8 : key_on(UP) \\n\ KP_8 : key_off(UP)start() \\n\ : key_on(UP) \\n\ : key_off(UP)start() \\n\ \ p : pause() \\n\ Shiftq : quit() \\n\ ", NULL}; xjump-2.7.5.orig/key.c0100644000175000017500000000150406425350115013275 0ustar tarutaru/***************************************** xjump version 2 key.c キー処理 (C) Oct 28, 1997 ROYALPANDA *****************************************/ #include #include #include #include"xjump.h" static int Keycode_raw[3]; static int Keycode_col[3]; void query_keycode( void ) { int i; KeyCode k; static KeySym sym[3] = {XK_space,XK_Left,XK_Right}; for( i = 0 ; i < 3 ; i++ ){ k = XKeysymToKeycode( Disp,sym[i] ); Keycode_raw[i] = k >> 3; Keycode_col[i] = 1 << (k & 7); } } void keymap( void ) { char key[32]; int i; XQueryKeymap( Disp,key ); for( i = 0 ; i < 3 ; i++ ) if( key[ Keycode_raw[i] ] & Keycode_col[i] ) Key[i] = 1; else Key[i] = 0; } void wait_keyup( void ) { do{ keymap(); }while( Key[0] || Key[1] || Key[2] ); } xjump-2.7.5.orig/XJump.ad0100644000175000017500000000507606431014002013707 0ustar tarutaruXJump*font : -adobe-*-*-*-*-*-24-*-*-*-*-*-*-* XJump*foreground : white XJump*background : black XJump*borderColor : white XJump*defaultDistance : 16 XJump*borderWidth : 0 XJump*title.label : FALLING TOWER ver 2.6 XJump*title.horizDistance : 64 XJump*title.foreground : white XJump*title.background : blue XJump*title.borderColor : navy XJump*title.borderWidth : 4 XJump*scoreBoard.fromVert : title XJump*scoreBoard.horizDistance : 128 XJump*scLabel.label : Floor XJump*score.fromHoriz : scLabel XJump*gameover.label : Game Over XJump*gameover.fromVert : scoreBoard XJump*gameover.horizDistance : 200 XJump*gameover.vertDistance : 96 XJump*gameover.foreground : white XJump*gameover.background : blue XJump*gameover.borderColor : navy XJump*gameover.borderWidth : 4 XJump*pause.label : Pause XJump*pause.fromVert : scoreBoard XJump*pause.horizDistance : 224 XJump*pause.vertDistance : 96 XJump*pause.foreground : white XJump*pause.background : blue XJump*pause.borderColor : navy XJump*pause.borderWidth : 4 XJump*scr.fromVert : scoreBoard XJump*scr.borderWidth : 0 XJump*record_v.fromVert : scoreBoard XJump*record_v.allowVert : True XJump*record_v.allowHoriz : True XJump*record_v*borderWidth : 1 XJump*record.font : -*-fixed-*-*-*-*-20-*-*-*-c-*-*-* XJump*copyright.label : (C) 1997 ROYALPANDA XJump*copyright.foreground : green XJump*copyright.fromVert : scr XJump*copyright.horizDistance : 64 XJump*game.translations : #override \n\ \ Left : key_on(LEFT) \n\ Left : key_off(LEFT) \n\ j : key_on(LEFT) \n\ j : key_off(LEFT) \n\ KP_4 : key_on(LEFT) \n\ KP_4 : key_off(LEFT) \n\ : key_on(LEFT) \n\ : key_off(LEFT) \n\ \ Right : key_on(RIGHT) \n\ Right : key_off(RIGHT) \n\ l : key_on(RIGHT) \n\ l : key_off(RIGHT) \n\ KP_6 : key_on(RIGHT) \n\ KP_6 : key_off(RIGHT) \n\ : key_on(RIGHT) \n\ : key_off(RIGHT) \n\ \ Up : key_on(UP)start() \n\ Up : key_off(UP) \n\ space : key_on(UP)start() \n\ space : key_off(UP) \n\ z : key_on(UP) \n\ z : key_off(UP)start() \n\ KP_8 : key_on(UP) \n\ KP_8 : key_off(UP)start() \n\ : key_on(UP) \n\ : key_off(UP)start() \n\ \ p : pause() \n\ Shiftq : quit() \n\ xjump-2.7.5.orig/README.euc0100644000175000017500000000424306431020065013772 0ustar tarutaruFALLING TOWER Version 2.6 説明書 (C) Oct 28, 1997 ROYALPANDA FALLING TOWERは、崩れる塔を上へ上へと登って行くゲームです。 インストール方は INSTALL.euc を読んで下さい。 ◎ 起動方法 xjump [-toolkitoption] [-graphic "graph_file"] [-private] [-keymap] [-help] -graphic ユーザーが定義したグラフィックを使用する時、 そのファイル名を指定(後述)。 -private プライベートカラーマップを使用。 -keymap キーマップを直接読む(後述) -help ヘルプ表示 ◎ 操作方法 Q : 終了 p : ポーズ/ポーズ解除 左カーソル J テンキー4 マウス中ボタン : 左移動 右カーソル l テンキー6 マウス右ボタン : 右移動 上カーソル z スペース テンキー8 マウス右ボタン : ゲームスタート、ジャンプ ◎ バグ 強制終了すると、キーリピートがオフになる場合があります。 このときは、 % xset r とすればなおります。 ◎ キーバインドの設定 キーバインドは XJump*game.translation リソースで設定できます。 次のアクションが使えます。 start() スタート pause() ポーズのトグル quit() 終了 key_on(key) keyが押された状態にする。 key_off(key) keyが離された状態にする。 keyは LEFT, RIGHT, UP のいずれかを指定します。 -keymapオプションが指定されている時は、キーマップを直接読むので、 key_on() , key_off()は無視されます。この時は、左右カーソルで移動、 スペースでジャンプします。 キーリピートの制御や、KeyReleaseイベントの発送が出来ないXサーバー上で 動かす時は、このオプションを使用します。 ◎ 自分のグラフィックを使う グラフィックは xpm形式で、144x64ピクセルです。 11223344A 11223344B 55667788C 55667788D 右上から128x64ピクセルの領域(上図の1〜8)に、主人公のキャラクタを描きます。 ひとつのキャラクタは32x32ピクセルです。 1 立っている時(パターン1)/左向き 2 立っている時(パターン1)/右向き 3 立っている時(パターン1)/左向き 4 立っている時(パターン1)/右向き 5 ジャンプ中/左向き 6 ジャンプ中/右向き 7 落下中/左向き 8 落下中/右向き 左上から16x64ピクセルの領域(上図のA〜C)に、背景のキャラクタを描きます。 ひとつのキャラクタは16x16ピクセルです。 A 背景の壁 B 左側の柱 C 右側の柱 D 床 ソースの中の picture.xpm を参考にして下さい。 xjump-2.7.5.orig/main.c0100644000175000017500000003002406757147740013450 0ustar tarutaru/***************************************** xjump version 2 main.c 初期化 / X Intrinsics関係 (C) Oct 28, 1997 ROYALPANDA *****************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include"xjump.h" #include"record.h" #include"picture.xpm" #include"icon.xbm" #include"icon_msk.xbm" #define TITLE 0 #define GAME 1 #define OVER 2 #define SPEED 25 extern char *DefaultResources[]; static XtAppContext App; /* アプリケーションコンテクスト */ static Widget Top, /* 最上位 */ Score, /* スコア(ラベル) */ Scr, /* メイン画面(コア) */ Score_v, /* ハイスコア(ビューポート) */ ScoreList, /* ハイスコア(ラベル) */ Gameover, /* ゲームオーバー(ラベル) */ Pause; /* ポーズ(ラベル) */ static Colormap Cmap; /* カラーマップ */ static int IntervalState; /* タイマ処理中? */ static XtIntervalId IntervalId; /* タイマー処理のID */ static char *GraphFile = NULL; /* ユーザーグラフィックファイル */ static int GameMode; /* モード (0タイトル 1ゲーム 2ゲームオーバー 3ポーズ) */ static unsigned int Sc_now; static char Score_list[43*(RECORD_ENTRY+2)+1]=""; /* ハイスコアテキスト */ static XKeyboardState Keyboard; /* キーボードステータス */ static int Repeat_mode = 1; /* キーリピートの状態(1:default 0:off) */ static int Use_keymap = 0; /* キーマップを直接読むか? */ /* プロトタイプ宣言 */ static void timi( XtPointer c, XtIntervalId id ); /* グローバル変数 */ Display *Disp; /* ディスプレイ構造体 */ GC Gc_nomask; /* GC (マスク無し) */ GC Gc_mask; /* GC (マスクあり) */ Drawable Scr_d; /* メイン画面 */ Pixmap Char_p; /* キャラクタ */ Pixmap Char_m; /* キャラクタ(マスク) */ Pixmap Floor_p; /* 床 */ Pixmap Back_p; /* 背景 */ int Key[3] = {0,0,0}; /* キーの状態 */ hero_t Hero; /* 主人公の状態 */ int Floor_L[ HEIGHT ]; /* 床の情報 */ int Floor_R[ HEIGHT ]; int Map_index; int Floor_top; record_t Record[ RECORD_ENTRY ]; /* ハイスコアリスト */ int Record_entry; /* ハイスコアリストの数 -1:記録しない */ char *Myname; /* プログラム名 */ /* キーリピートを止める */ static void repeat_off( void ) { if( Repeat_mode ){ XGetKeyboardControl( Disp,&Keyboard ); XAutoRepeatOff( Disp ); Repeat_mode = 0; } } /* キーリピートを元に戻す */ static void repeat_on( void ) { if( !Repeat_mode ){ if( Keyboard.global_auto_repeat ) XAutoRepeatOn( Disp ); else XAutoRepeatOff( Disp ); Repeat_mode = 1; } } /* スコア表示 */ static void put_score( void ) { char buf[12]; sprintf( buf,"%010d",Sc_now ); XtVaSetValues( Score,XtNlabel,buf,NULL ); } /* ハイスコア画面作成 */ static void make_score( void ) { int i; char *p; if( Record_entry == -1 ) return; p = Score_list; p += sprintf( p,"RANK FLOOR NAME\n\ ---- ---------- -------------------------------\n"); for( i = 0 ; i < Record_entry ; i++ ) p += sprintf( p,"%4d %10d %-20.20s\n",i+1, Record[i].score,Record[i].name ); p--; *p = '\0'; XtVaSetValues( ScoreList, XtNlabel,Score_list, NULL ); } /* タイマー中断 */ static void reset_timer( void ) { if( IntervalState ){ XtRemoveTimeOut( IntervalId ); IntervalState = 0; } } /* タイマースタート */ static void set_timer( void ) { if( IntervalState ) reset_timer(); IntervalId = XtAppAddTimeOut( App, SPEED ,(XtTimerCallbackProc)timi,NULL ); IntervalState = 1; } /* ゲームオーバー */ static void gameover( void ) { XtMapWidget( Gameover ); if( Use_keymap ) wait_keyup(); GameMode = OVER; save_record( Sc_now ); make_score(); } /* タイトル */ static void title( void ) { reset_timer(); XtUnmapWidget( Gameover ); XtUnmapWidget( Scr ); GameMode = TITLE; if( Record_entry != -1 ) XtMapWidget( Score_v ); } /* タイマー処理ルーチン */ static void timi( XtPointer c,XtIntervalId id ) { unsigned int floor; static int timer; IntervalState = 0; set_timer(); switch( GameMode ){ case GAME: if( Use_keymap ) keymap(); floor = move(); if( floor == DEAD ){ gameover(); timer = 0; } else if( floor > Sc_now ){ Sc_now = floor; if( Sc_now > UINT_MAX - 5) Sc_now = UINT_MAX - 5; put_score(); } break; case OVER: if( ++timer > 250 ) title(); break; } } /* フォーカス変更(キーリピートの切替え)(イベントハンドラ) */ static void focus( Widget w,XtPointer p,XEvent *e ) { if( e->type == FocusIn ) repeat_off(); else repeat_on(); } /* エクスポーズ処理 (イベントハンドラ) */ static void expose( Widget w,XtPointer p,XEvent *e ) { recover_scr( e->xexpose.x,e->xexpose.y, e->xexpose.width,e->xexpose.height ); } /* プログラム終了 (アクションハンドラ) */ static void quit_game( Widget w,XEvent *e,String *s,Cardinal *num ) { repeat_on(); XFlush( Disp ); exit(0); } /* プログラム終了(シグナルハンドラ) */ static void sig_handler( int i ) { repeat_on(); XFlush( Disp ); exit(0); } /* スタート (アクションハンドラ) */ static void start_game( Widget w,XEvent *e,String *s,Cardinal *num ) { switch( GameMode ){ case TITLE: if( Use_keymap ) wait_keyup(); XtUnmapWidget( Score_v ); XtUnmapWidget( Gameover ); reset_timer(); XtMapWidget( Scr ); init_game(); Sc_now = 0; GameMode = GAME; set_timer(); break; case OVER: title(); break; } } /* ポーズ (アクションハンドラ) */ static void pause_game( Widget w,XEvent *e,String *s,Cardinal *num ) { if( GameMode == 1 ){ reset_timer(); XtMapWidget( Pause ); GameMode = 3; }else if( GameMode == 3 ){ GameMode = 1; XtUnmapWidget( Pause ); set_timer(); } } /* キー押された(アクションハンドラ) */ static void key_on( Widget w,XEvent *e,String *s,Cardinal *num ) { if( Use_keymap ) return; switch( **s ){ case 'U': Key[ KEY_UP ] = 1; break; case 'R': Key[ KEY_RIGHT ] = 1; break; case 'L': Key[ KEY_LEFT ] = 1; break; } } /* キー離された (アクションハンドラ) */ static void key_off( Widget w,XEvent *e,String *s,Cardinal *num ) { if( Use_keymap ) return; switch( **s ){ case 'U': Key[ KEY_UP ] = 0; break; case 'R': Key[ KEY_RIGHT ] = 0; break; case 'L': Key[ KEY_LEFT ] = 0; break; } } /* アイコンの設定 */ static void set_icon( void ) { Pixmap icon,mask; icon = XCreateBitmapFromData( Disp,DefaultRootWindow(Disp),icon_bits, icon_width,icon_height ); mask = XCreateBitmapFromData( Disp,DefaultRootWindow(Disp),icon_msk_bits, icon_msk_width,icon_msk_height ); XtVaSetValues( Top,XtNiconPixmap,icon,XtNiconMask,mask,NULL ); } /* ヘルプ */ static void help() { fprintf( stderr,"Usage: %s [options]\n",Myname ); fprintf( stderr,"\t-toolkitoption ...\n" ); fprintf( stderr,"\t-private\t\tuse private colormap.\n" ); fprintf( stderr,"\t-graphic \"file\"\t\tuse your xpm graphic \"file\"\n" ); fprintf( stderr,"\t-keymap\t\t\tread keymap directly.\n" ); fprintf( stderr,"\t-help\t\t\tshow this messages.\n" ); } /* コマンドラインオプション解析 */ static void option( int argc, char **argv ) { int i; for( i = 1 ; i < argc ; i++ ){ if( strcmp( argv[i],"-private" ) == 0 ){ Cmap = XCreateColormap( Disp,DefaultRootWindow(Disp), DefaultVisual(Disp,DefaultScreen(Disp)),AllocNone ); XtVaSetValues( Top,XtNcolormap,Cmap,NULL ); continue; } if( strcmp( argv[i],"-graphic" ) == 0 ){ GraphFile = argv[++i]; continue; } if( strcmp( argv[i],"-keymap" ) == 0 ){ Use_keymap = 1; continue; } if( strcmp( argv[i],"-help" ) == 0 ){ help(); exit(0); } fprintf(stderr,"%s: Unknown command line option \"%s\".\n",Myname,argv[i]); help(); exit(1); } } /* グラフィックの作成/読み込み */ static void make_graphic( void ) { int i; XpmAttributes attr; attr.valuemask = XpmColormap; attr.colormap = Cmap; if( GraphFile != NULL ) i = XpmReadFileToPixmap( Disp,DefaultRootWindow(Disp),GraphFile, &Char_p,&Char_m,&attr ); else i = XpmCreatePixmapFromData( Disp,DefaultRootWindow(Disp), picture_xpm,&Char_p,&Char_m,&attr ); if( i ){ fprintf( stderr,"%s: %s\n",Myname,XpmGetErrorString(i) ); exit(1); } Gc_mask = XCreateGC( Disp,DefaultRootWindow(Disp),0,NULL ); XSetClipMask( Disp,Gc_mask,Char_m ); } /* Xlib関係の前処理 */ static int init_graph( void ) { int x; make_graphic(); Gc_nomask = XCreateGC( Disp,DefaultRootWindow(Disp),0,NULL ); Floor_p = XCreatePixmap( Disp,DefaultRootWindow(Disp), WIDTH*16,16, DefaultDepth(Disp,DefaultScreen(Disp)) ); XCopyArea( Disp,Char_p,Floor_p,Gc_nomask,128,16,16,16,0,0 ); XCopyArea( Disp,Char_p,Floor_p,Gc_nomask,128,32,16,16,WIDTH*16-16,0 ); for( x = 16 ; x < WIDTH*16-16 ; x+=16 ) XCopyArea( Disp,Char_p,Floor_p,Gc_nomask,128,48,16,16,x,0 ); Back_p = XCreatePixmap( Disp,DefaultRootWindow(Disp), WIDTH*16,16, DefaultDepth(Disp,DefaultScreen(Disp)) ); XCopyArea( Disp,Char_p,Back_p,Gc_nomask,128,16,16,16,0,0 ); XCopyArea( Disp,Char_p,Back_p,Gc_nomask,128,32,16,16,WIDTH*16-16,0 ); for( x = 16 ; x < WIDTH*16-16 ; x+=16 ) XCopyArea( Disp,Char_p,Back_p,Gc_nomask,128,0,16,16,x,0 ); } /* メイン */ int main( int argc,char **argv ) { static XtActionsRec a_table[] = { {"start", (XtActionProc)start_game}, {"pause", (XtActionProc)pause_game}, {"quit", (XtActionProc)quit_game}, {"key_on", (XtActionProc)key_on}, {"key_off",(XtActionProc)key_off}, }; Widget game,w; uid_t uid; if( (Myname = argv[0]) == NULL ) Myname = "xjump"; uid = geteuid(); seteuid(getuid()); XtSetLanguageProc( NULL,NULL,NULL ); Top = XtVaAppInitialize( &App,"XJump",NULL,0, &argc,argv,DefaultResources,NULL ); Disp = XtDisplay( Top ); Cmap = DefaultColormap( Disp,DefaultScreen(Disp) ); option( argc,argv ); seteuid( uid ); game = XtVaCreateManagedWidget( "game",formWidgetClass,Top,NULL ); XtVaCreateManagedWidget( "title",labelWidgetClass,game,NULL ); w = XtVaCreateManagedWidget( "scoreBoard",formWidgetClass,game, NULL ); XtVaCreateManagedWidget( "scLabel",labelWidgetClass,w, NULL ); Score = XtVaCreateManagedWidget( "score",labelWidgetClass,w, XtNlabel,"0000000000", NULL ); Gameover = XtVaCreateManagedWidget( "gameover",labelWidgetClass,game, XtNmappedWhenManaged,FALSE, NULL ); Pause = XtVaCreateManagedWidget( "pause",labelWidgetClass,game, XtNmappedWhenManaged,FALSE, NULL ); Scr = XtVaCreateManagedWidget( "scr",widgetClass,game, XtNwidth,WIDTH*16, XtNheight,HEIGHT*16, XtNmappedWhenManaged,FALSE, NULL ); Score_v = XtVaCreateManagedWidget( "record_v",viewportWidgetClass,game, XtNwidth,WIDTH*16, XtNheight,HEIGHT*16, NULL ); ScoreList = XtVaCreateManagedWidget( "record",labelWidgetClass,Score_v, XtNlabel,"", NULL ); XtVaCreateManagedWidget( "copyright",labelWidgetClass,game,NULL ); XtAddEventHandler( Top,FocusChangeMask,FALSE,(XtEventHandler)focus,NULL ); XtAddEventHandler( Scr,ExposureMask,FALSE,(XtEventHandler)expose,NULL ); XtAppAddActions( App,a_table,XtNumber(a_table) ); if( Use_keymap ) query_keycode(); if( signal( SIGINT,SIG_IGN ) != SIG_IGN ) signal( SIGINT,sig_handler ); if( signal( SIGTERM,SIG_IGN ) != SIG_IGN ) signal( SIGTERM,sig_handler ); XtRealizeWidget( Top ); init_graph(); set_icon(); Map_index = 0; Scr_d = XtWindow( Scr ); init_record(); if( Record_entry != -1 ) make_score(); srnd(); GameMode = TITLE; XtAppMainLoop( App ); return 0; } xjump-2.7.5.orig/misc.c0100644000175000017500000000051306365052263013445 0ustar tarutaru/***************************************** xjump version 2 misc.c 雑処理 (C) July 16, 1997 ROYALPANDA *****************************************/ #include /* 乱数 */ int rnd( int range ) { return ( random() & 0xffff ) * range / 0xffff ; } /* 乱数初期化 */ void srnd( void ) { srandom( time(NULL) ); } xjump-2.7.5.orig/record.c0100644000175000017500000000774506431013664014002 0ustar tarutaru/***************************************** xjump version 2 record.c 得点記録 (C) July 16, 1997 ROYALPANDA *****************************************/ #include #include #include #include #include #include #include #include #include"record.h" /* スペース読み飛ばし */ static int skipspace( FILE *fp ) { int c; for(;;){ c = fgetc(fp); if( c == EOF ) return -1; if( c == '\n' ) return -1; if( !isspace(c) ){ ungetc(c,fp); return 0; } } } /* 数値読み込み */ static int read_num( FILE *fp ) { int c,i; int err; if( skipspace( fp ) ) return -1; i = 0; err = 1; for(;;){ c = fgetc( fp ); if( isdigit( c ) ){ i = i * 10 + c - '0'; err = 0; }else break; } ungetc( c,fp ); if( err ) return -1; else return i; } /* 名前の読み込み */ static void read_name( char *buf, FILE *fp ) { int l,c; if( skipspace( fp ) ){ *buf = '\0'; return; } for( l = 0 ; l < 31 ; l++ ){ c = fgetc( fp ); if( c < 0 || iscntrl( c ) ){ ungetc( c,fp ); break; } *buf++ = c; } *buf = '\0'; } /* 行末まで読み飛ばす */ static void void_line( FILE *fp ) { int c; while( ( c = fgetc(fp) ) != '\n' && c != EOF ) ; } /* UIDからリアルネームを取り出す */ static char *get_name( int uid, char *name ) { struct passwd *pw; int i; if( ( pw = getpwuid( uid ) ) == NULL ) name[0] = '\0'; else{ i = 0; while( i < 31 && pw->pw_gecos[i] != '\0' && pw->pw_gecos[i] != ',' ){ name[i] = pw->pw_gecos[i]; i++; } if( i > 0 ) name[i] = '\0'; else strcpy( name,pw->pw_name ); } return name; } /* レコードの1エントリー読み込み */ static int read_entry( FILE *fp, record_t *rec ) { if( ( rec->score = read_num( fp ) ) < 0 ) return -1; if( ( rec->uid = read_num( fp ) ) < 0 ) return -1; read_name( rec->name,fp ); if( rec->name[0] == '\0' ) get_name( rec->uid,rec->name ); return 0; } /* レコード読みだし */ static void read_record( FILE *fp ) { int i; i = 0; while( !feof( fp ) && i < RECORD_ENTRY ){ if( read_entry( fp,&Record[i] ) == 0 ) i++; void_line( fp ); } Record_entry = i; } /* エラー */ static void error( void ) { perror( Myname ); fprintf( stderr,"%s: do not record high-score.\n",Myname); Record_entry = -1; } /* レコード関係の初期化 */ void init_record( void ) { FILE *fp; Record_entry = -1; if( ( fp = fopen( RECORD_FILE,"r+" ) ) == NULL ){ error(); return; } flock( fileno(fp),LOCK_EX ); read_record( fp ); fclose( fp ); } /* ソート比較関数 */ static int sort_cmp( record_t *r1, record_t *r2 ) { if( r1->score > r2->score ) return -1; else if( r1->score < r2->score ) return 1; else if( r1->rank > r2->rank ) return 1; else return -1; } /* ソート */ static void sort_record( void ) { int i; for( i = 0 ; i < Record_entry ; i++ ) Record[i].rank = i; qsort( Record,Record_entry,sizeof(record_t),sort_cmp ); } /* レコード記録 */ void save_record( int sc ) { FILE *fp; int i,r; int uid; if( Record_entry == -1 ) return ; if( (fp = fopen(RECORD_FILE,"r+")) == NULL ){ error(); return; } flock( fileno(fp),LOCK_EX ); read_record( fp ); r = -1; uid = (int)getuid(); for( i = 0 ; i < Record_entry ; i++ ) if( Record[i].uid == uid ){ r = i; break; } if( r == -1 ){ if( Record_entry < RECORD_ENTRY ){ r = Record_entry++; Record[r].score = 0; }else r = RECORD_ENTRY - 1; } if( sc > Record[r].score ){ Record[r].score = sc; Record[r].uid = uid; get_name( uid,Record[r].name ); sort_record(); rewind( fp ); ftruncate( fileno(fp) ,0 ); for( i = 0 ; i < Record_entry ; i++ ) fprintf( fp,"%d %d %s\n", Record[i].score,Record[i].uid,Record[i].name ); fclose( fp ); return; } fclose( fp ); } xjump-2.7.5.orig/record.h0100644000175000017500000000072206363306317013777 0ustar tarutaru/***************************************** xjump version 2 record.h ヘッダ( レコード関連 ) (C) July 16, 1997 ROYALPANDA *****************************************/ typedef struct { int score; /* 得点 */ int uid; /* ユーザーID */ char name[32]; /* 名前 */ int rank; /* 順位 */ } record_t; extern record_t Record[]; extern int Record_entry; extern char *Myname; void init_record( void ); void save_record( int score ); xjump-2.7.5.orig/xjump.h0100644000175000017500000000240506425350135013660 0ustar tarutaru/***************************************** xjump version 2 xjump.h ヘッダ( レコード関連除く ) (C) Oct 28, 1997 ROYALPANDA *****************************************/ /* キーの定義 */ #define KEY_UP 0 #define KEY_LEFT 1 #define KEY_RIGHT 2 /* 生死判定用 */ #define DEAD -1 /* 画面サイズ */ #define WIDTH 32 #define HEIGHT 24 typedef struct{ int x; /* 座標 x */ int y; /* 座標 y */ int vx; /* 速度 x */ int vy; /* 速度 y */ int jump; /* ジャンプ力 */ int pic; /* グラフィック */ int dir; /* 向き */ int g_count; /* アニメーション用カウンタ */ } hero_t; extern int Floor_L[]; extern int Floor_R[]; extern int Map_index; extern hero_t Hero; extern int Key[]; extern int Floor_top; extern Display *Disp; extern Drawable Scr_d; extern Pixmap Floor_p; extern Pixmap Back_p; extern Pixmap Char_p; extern Pixmap Char_m; extern GC Gc_nomask; extern GC Gc_mask; void init_game( void ); int move( void ); void recover_scr( int x, int y, int x2, int y2 ); int rnd( int range ); void srnd( void ); void query_keycode( void ); void keymap( void ); void wait_keyup( void ); /* マクロ */ #define floor_r(y) Floor_R[ ( y+Map_index) % HEIGHT ] #define floor_l(y) Floor_L[ ( y+Map_index) % HEIGHT ] xjump-2.7.5.orig/Makefile0100644000175000017500000000271207423771616014017 0ustar tarutaru######################################################## # 使用するコンパイラとオプションを指定 CC = gcc -O2 # 標準以外のインクルードファイルのディレクトリを指定 IDIR = -I/usr/X11R6/include # 標準以外のライブラリのディレクトリを指定 LDIR = -L/usr/X11R6/lib ######################################################### # インストール先を指定 TARGET = /usr/games/ # レコードファイルのディレクトリを指定 RECORD_DIR = /var/games/xjump #レコードファイルのファイル名を指定(注:これはバイナリに埋め込まれます) RECORD_FILE = $(RECORD_DIR)/record ######################################################### # レコードのエントリ数を指定(注:これはバイナリに埋め込まれます) RECORD_ENTRY = 20 ########################################################## xjump : main.o game.o key.o misc.o record.o resource.o $(CC) -o xjump \ main.o game.o key.o misc.o record.o resource.o\ -lXaw -lXmu -lXt -lXpm -lXext -lX11 $(LDIR) main.o : main.c xjump.h record.h \ picture.xpm icon.xbm icon_msk.xbm Makefile $(CC) -c -DRECORD_ENTRY=$(RECORD_ENTRY) main.c $(IDIR) resource.o : resource.c $(CC) -c resource.c game.o : game.c xjump.h $(CC) -c game.c $(IDIR) key.o : key.c xjump.h $(CC) -c key.c $(IDIR) misc.o : misc.c $(CC) -c misc.c record.o : record.c record.h Makefile $(CC) -c \ -DRECORD_ENTRY=$(RECORD_ENTRY) \ -DRECORD_FILE=\"$(RECORD_FILE)\" \ record.c install : xjump install -g games -c -s -m 2755 xjump $(DESTDIR)$(TARGET) clean: rm -f *.o xjump *~ xjump-2.7.5.orig/picture.xpm0100644000175000017500000002300206363127232014542 0ustar tarutaru/* XPM */ static char * picture_xpm[] = { "144 64 10 1", " s None c None", ". c black", "X c #AEBADB6CE79D", "o c #00000000FFFF", "O c #000000008207", "+ c #FFFFE79DC71B", "@ c #FFFF00000000", "# c #0000FFFF0000", "$ c #FFFFC30BCB2B", "% c #B2CA20812081", " ................", " XXXXXX.XXXXXXX.X", " ..... ..... ..... ..... oooooO.XoooooO.X", " ......... ......... ......... ......... OOOOOO.OOOOOOO.O", " ........... ........... ........... ........... ................", " ............. ............. ............. ............. XX.XXXXXXX.XXXXX", " .+++++....... .......+++++. .+++++....... .......+++++. oO.XoooooO.Xoooo", " .++++++++...... ......++++++++. .++++++++...... ......++++++++. OO.OOOOOOO.OOOOO", " .+++++++++..... .....+++++++++. .+++++++++..... .....+++++++++. ................", " . .++..++++++.... ....++++++..++. . .++..++++++.... ....++++++..++. XXXXXX.XXXXXXX.X", " .@. .++..+++++++... ...+++++++..++. .@. .++..+++++++... ...+++++++..++. oooooO.XoooooO.X", " .@@. .++++++++++++.. .. .. ..++++++++++++. .@@. .++++++++++++.. ..++++++++++++. OOOOOO.OOOOOOO.O", " .@@@. .+++++++++++. ..@@. .@@.. .+++++++++++. .@@@. ...... .+++++++++++. .+++++++++++. ......................", " .@@@. .+++++++++++. .@@@@. .@@@@. .+++++++++++. .@@@. .@@@@@.. .+++++++++++. .+++++++++++. ..@@@@@.XX.XXXXXXX.XXXXX", " .@@@@...+++++++++...@@@@. .@@@@...+++++++++...@@@@. .@@@@@@...+++++++++........... ...........+++++++++...@@@@@@. oO.XoooooO.Xoooo", " .@@@@@@@..+++++..@@@@@@. .@@@@@@..+++++..@@@@@@@. .@@@@@@@@..+++++..@@@@@@@@@@@..@@@@@@@@@@@..+++++..@@@@@@@@. OO.OOOOOOO.OOOOO", " .@@@@@@@@.....@@@@@@@. .@@@@@@@.....@@@@@@@@. ..@@@@@@@@.....@@@@@@@@@@@@@..@@@@@@@@@@@@@.....@@@@@@@@.. ................", " .@@@@@@@@@@@@@@@@@@. .@@@@@@@@@@@@@@@@@@. .@@@@@@@@@@@@@@@@@@@@@@@.. ..@@@@@@@@@@@@@@@@@@@@@@@. .XXXXXXXXXXXXXXX", " .@@@@@@@@@@@@@@@@. .@@@@@@@@@@@@@@@@. .@@@@@@@@@@@@@@@@@@@@.. ..@@@@@@@@@@@@@@@@@@@@. .XXXXXXXXXXXXXXO", " ..@@@@@@@@@@@@.. ..@@@@@@@@@@@@.. ..@@@@@@@@@@@@@@@... ...@@@@@@@@@@@@@@@.. .XXoooooooooooOO", " ............ ............ ............... ............... .XXoooooooooooOO", " ...############. .############... ....##############. .##############.... .XXoooooooooooOO", " .################. .################. .###################... ...###################. .XXoooooooooooOO", " .##################. .##################. .#######################.. ..#######################. .XXoooooooooooOO", " .##################. .##################. .##########################. .##########################. .XXoooooooooooOO", " .####################. .####################. .###########.....############. .############.....###########. .XXoooooooooooOO", " .######......########. .########......######. .######...... ......#######..#######...... ......######..XXoooooooooooOO", " .####.. ..#######. .#######.. ..####. .##.... ....... ....... ....##..XXoooooooooooOO", " .####. ...#####. .#####... .####. .. .. .XXoooooooooooOO", " .###. ...####. .####... .###. .XXoooooooooooOO", " .##. ..##. .##.. .##. .XOOOOOOOOOOOOOO", " .. .. .. .. .OOOOOOOOOOOOOOO", " ................", " .XXXXXXXXXXXXXXX", " .XXXXXXXXXXXXXXO", " .. .. .. .. .XXoooooooooooOO", " .@@. .@@. ....... ....##..##.... ....... .XXoooooooooooOO", " .@@@. .. .. .@@@. .#######...... ......######..######...... ......#######..XXoooooooooooOO", " .@@@. ..##..##.. .@@@. .############.....###########. .###########.....############. .XXoooooooooooOO", " .@@@@. ..####..####.. .@@@@. .##########################. .##########################. .XXoooooooooooOO", " .@@@@. ..#####. .#####.. .@@@@. ..#######################. .#######################.. .XXoooooooooooOO", " ..... .@@@@. .#######. .#######. .@@@@. ..... ...###################. .###################... .XXoooooooooooOO", " ..........@@@@. .#######. .#######. .@@@@.......... .##############.... ....##############. .XXoooooooooooOO", " .......+++.@@@@@.########. .########.@@@@@.+++....... ............... ............... .XXoooooooooooOO", " .......+++++.@@@@.#######.. ..#######.@@@@.+++++....... ...@@@@@@@@@@@@@@@.. ..@@@@@@@@@@@@@@@... .XXoooooooooooOO", " ......++++++.@@@@.#######. .#######.@@@@.++++++...... ..@@@@@@@@@@@@@@@@@@@@. .@@@@@@@@@@@@@@@@@@@@.. .XXoooooooooooOO", " ......++++++++.@@@.######.. ..######.@@@.++++++++...... ..@@@@@@@@@@@@@@@@@@@@@@@. .@@@@@@@@@@@@@@@@@@@@@@@.. .XOOOOOOOOOOOOOO", " .....+++++++++.@@@.######. .######.@@@.+++++++++..... .@@@@@@@@@@@@@.....@@@@@@@@.. ..@@@@@@@@.....@@@@@@@@@@@@@..OOOOOOOOOOOOOOO", " .....+++++++++.@@@.#####. .#####.@@@.+++++++++..... .@@@@@@@@@@@..+++++..@@@@@@@@. .@@@@@@@@..+++++..@@@@@@@@@@@.................", " ....++++++++++.@@@.#####. .#####.@@@.++++++++++.... ...........+++++++++...@@@@@@. .@@@@@@...+++++++++........... .$$$$$$$$$$$$$$$", " ....++++++++++.@@@.#####. .#####.@@@.++++++++++.... .+++++++++++. ..@@@@@..@@@@@.. .+++++++++++. .$$$$$$$$$$$$$$%", " ...+++..++++.@@@@.#####. .#####.@@@@.++++..+++... .+++++++++++. ............ .+++++++++++. .$$@@@@@@@@@@@%%", " ...+++..++++.@@@@.#####. .#####.@@@@.++++..+++... ..++++++++++++. .++++++++++++.. .$$@@@@@@@@@@@%%", " ..++++++++.@@@@@.#####. .#####.@@@@@.++++++++.. ...+++++++..++. .++..+++++++... .$$@@@@@@@@@@@%%", " ..+++++...@@@@@.######. .######.@@@@@...+++++.. ....++++++..++. .++..++++++.... .$$@@@@@@@@@@@%%", " ..... .@@@@. .#####. .#####. .@@@@. ..... .....+++++++++. .+++++++++..... .$$@@@@@@@@@@@%%", " .@@@@@. .######. .######. .@@@@@. ......++++++++. .++++++++...... .$$@@@@@@@@@@@%%", " .@@@@@. .#######. .#######. .@@@@@. .......+++++. .+++++....... .$$@@@@@@@@@@@%%", " .@@@@@. .#######. .#######. .@@@@@. ............. ............. .$$%%%%%%%%%%%%%", " .@@@@@. ..######..######.. .@@@@@. ........... ........... .$%%%%%%%%%%%%%%", " .@@@... ...###..###... ...@@@. ......... ......... ................", " ... ... ... ... ..... ..... XX.XXXXXXX.XXXXX", " oO.XoooooO.Xoooo", " OO.OOOOOOO.OOOOO"}; xjump-2.7.5.orig/icon.xbm0100644000175000017500000000156406363123671014015 0ustar tarutaru#define icon_width 32 #define icon_height 32 static unsigned char icon_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0x61, 0x00, 0xa0, 0xf9, 0xb3, 0x00, 0x60, 0xfd, 0xd7, 0x00, 0xa0, 0x0e, 0xae, 0x00, 0x60, 0x05, 0xd4, 0x00, 0xa0, 0x06, 0xac, 0x00, 0x40, 0x0d, 0x56, 0x00, 0xc0, 0xfa, 0x6b, 0x00, 0x80, 0x55, 0x35, 0x00, 0x00, 0xab, 0x1a, 0x00, 0x00, 0x56, 0x0d, 0x00, 0x00, 0xac, 0x06, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x80, 0x1f, 0x3f, 0x00, 0xc0, 0x0f, 0x7e, 0x00, 0xc0, 0x07, 0x7c, 0x00, 0xc0, 0x43, 0x78, 0x00, 0x80, 0x41, 0x30, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x49, 0x12, 0x00, 0x00, 0x09, 0x12, 0x00, 0x00, 0x09, 0x12, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}; xjump-2.7.5.orig/icon_msk.xbm0100644000175000017500000000160006363123671014656 0ustar tarutaru#define icon_msk_width 32 #define icon_msk_height 32 static unsigned char icon_msk_bits[] = { 0xe0, 0xf9, 0xf3, 0x00, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x80, 0x1f, 0x3f, 0x00, 0x80, 0x1f, 0x3f, 0x00, 0x80, 0x03, 0x38, 0x00, 0x80, 0x03, 0x38, 0x00}; xjump-2.7.5.orig/INSTALL.euc0100644000175000017500000000253506431017654014157 0ustar tarutaruFALLING TOWER Version 2 インストールマニュアル (C) July 17, 1997 ROYALPANDA ◎ xpmライブラリが必要です。 ◎ games というユーザーが必要です(標準であると思います)。 ● 動作環境 以下の環境での動作を確認しています。 NetBSD 1.2 / 1.3 FreeBSD 2.2.1 ● インストール方法 A)スーパーユーザーになれる人 1) Makefileを編集します(普通は必要ありません)。 2) % make で、xjump というバイナリができます。 3) あとは su して、 % make install でインストール完了です。 必要なら、XJump.adというリソースファイルを適当にインストールして下さい。 (標準設定はビルトインされているので、なくても動きます) B)一般ユーザーの人 1) Makefileの中の、レコードファイルのファイル名を設定します。 (ここでは、 /home/hogehoge/xjump_record/record と設定したとします。) 必要に応じて、他の所も設定します。 2) % make で、xjump というバイナリが出来ます。あとは、 % install -c -s -m 4755 xjump ~hogehoge/bin バイナリのインストール % mkdir ~hogehoge/xjump_record レコードファイルのディレクトリ作成 % touch ~hogehoge/xjump_record/record レコードファイル作成 とでもします。 重要なのは次の点です。 ◎ バイナリに埋め込んだレコードファイル名のファイルが存在している。 ◎ バイナリとレコードファイルの所有者が同じである。 ◎ バイナリのsetuidビットが立っている。 (バイナリがレコードファイルを読み書きできる。) そうでない時は、ハイスコアの記録ができません。(ゲーム自体は出来ます) xjump-2.7.5.orig/game.c0100644000175000017500000001077706425336372013443 0ustar tarutaru/***************************************** xjump version 2 game.c 移動・描画関係 (C) July 28, 1997 ROYALPANDA *****************************************/ #include #include #include"xjump.h" /* マクロ */ #define max( a,b ) ( (a) > (b) ? (a) : (b) ) #define min( a,b ) ( (a) < (b) ? (a) : (b) ) /* 変数 */ static int T_speed,T_count; /* スクロールスピード関係 */ /* 床を設定/描画する */ static void make_floor( int y ) { int f,x1,x2,l,fvec; static int fpos = WIDTH/2; f = Floor_top - y; if( f % 250 == 0 ){ floor_l(y) = 16; floor_r(y) = WIDTH*16-17; XCopyArea( Disp,Floor_p,Scr_d,Gc_nomask,0,0,WIDTH*16,16,0,y*16 ); return; } if( f % 5 == 0 ){ fvec = (rnd(2)*2-1) * ( rnd( (WIDTH-11)/4 ) + (WIDTH-11)/4 ); fpos = ( fpos + fvec +WIDTH-11 ) % (WIDTH-11); x1 = ( fpos+5 - rnd( 3 ) - 2)*16; x2 = ( fpos+5 + rnd( 3 ) + 2)*16+15; floor_l(y) = x1; floor_r(y) = x2; XCopyArea( Disp,Floor_p,Scr_d,Gc_nomask,x1,0,x2-x1+1,16,x1,y*16 ); }else{ floor_l(y) = WIDTH*16; floor_r(y) = 0; } } /* 主人公を表示 */ static void draw_hero( void ) { int pic; int sx,sy; pic = Hero.pic * 2 + Hero.dir; sx = ( pic & 3 ) * 32; sy = ( pic >> 2 ) * 32; XSetClipOrigin( Disp,Gc_mask,Hero.x-sx,Hero.y-sy ); XCopyArea( Disp,Char_p,Scr_d,Gc_mask,sx,sy,32,32,Hero.x,Hero.y ); } /* 主人公を消す */ static void del_hero( void ) { recover_scr( Hero.x, Hero.y, 32, 32 ); } /* 1ラインスクロール */ static void scroll_up( void ) { int i,x,width,y; for( y = Floor_top % 5 ; y < HEIGHT ; y += 5 ){ x = floor_l(y); width = floor_r(y)-x+1; XCopyArea( Disp,Back_p,Scr_d,Gc_nomask,x,0,width,16,x,y*16 ); if( y < HEIGHT-1 ) XCopyArea( Disp,Floor_p,Scr_d,Gc_nomask,x,0,width,16,x,y*16+16 ); } Floor_top++; if( --Map_index < 0 ) Map_index = HEIGHT - 1; make_floor( 0 ); Hero.y += 16; } /* 主人公が床の上にいるか判定 */ static int stand( void ) { int y; if( Hero.vy < 0 ) return 0; y = ( ( Hero.y + 32 ) / 16 ); if( y >= HEIGHT ) return 0; if( floor_l(y) < Hero.x+24 && Hero.x+8 < floor_r(y) ) return 1; else return 0; } /* 主人公の移動 */ int move( void ) { int acc,st,floor; del_hero(); if( T_speed < 5000 ) T_speed++; T_count += T_speed; if( T_count > 20000 ){ T_count -= 20000; scroll_up(); } Hero.x += Hero.vx / 2; Hero.y += Hero.vy; if( Hero.x < 16 ){ Hero.x = 16; Hero.vx = -Hero.vx/2; }else if( Hero.x > WIDTH*16-48 ){ Hero.x = WIDTH*16-48; Hero.vx = -Hero.vx/2; } if( Hero.y < 80 ){ scroll_up(); T_count = 0; } else if( Hero.y >= HEIGHT*16 ) return DEAD; if( ( st = stand() ) ){ acc = 3; floor = (Floor_top - Hero.y / 16)/5 + 1; Hero.pic &= 1; Hero.y = (Hero.y / 16 ) * 16; Hero.vy = 0; if( ++Hero.g_count == 5 ){ Hero.g_count = 0; Hero.pic ^= 1; } if( Key[ KEY_UP ] ){ Hero.jump = abs(Hero.vx)/4+7; Hero.vy = -Hero.jump/2-12; Hero.pic = 2; st = 0; } }else{ acc = 2; floor = 0; } if( Key[ KEY_LEFT ] ){ Hero.vx -= acc; if( Hero.vx < -32 ) Hero.vx = -32; Hero.dir = 0; }else if( Key[ KEY_RIGHT ] ){ Hero.vx += acc; if( Hero.vx > 32 ) Hero.vx = 32; Hero.dir = 1; }else if( st ){ if( Hero.vx < -2 ) Hero.vx+=3; else if( Hero.vx > 2 ) Hero.vx-=3; else Hero.vx = 0; } if( !st ){ if( Hero.jump ){ Hero.vy = -Hero.jump/2-12; if( Key[ KEY_UP ] ) Hero.jump--; else Hero.jump = 0; }else{ Hero.vy+=2; if( Hero.vy > 0 ) Hero.pic = 3; if( Hero.vy > 16 ) Hero.vy = 16; } } draw_hero(); return floor; } /* ゲーム初期化 */ void init_game( void ) { int x,y; Floor_top = HEIGHT - 4; for ( y = 0 ; y < HEIGHT ; y++ ){ XCopyArea( Disp,Back_p,Scr_d,Gc_nomask,0,0,WIDTH*16,16,0,y*16 ); make_floor(y); } Hero.x = WIDTH * 8 - 16; Hero.y = (HEIGHT - 4)*16-32; Hero.vx = Hero.vy = 0; Hero.pic = 0; Hero.dir = 0; Hero.g_count = 0; T_speed = 200; T_count = 0; Key[ KEY_UP ] = 0; draw_hero(); } /* 画面を修復 */ void recover_scr( int x, int y, int width, int height ) { int xl,xr,y2; y2 = (y+height-1) / 16; y /= 16; for( ; y <= y2 ; y++ ){ XCopyArea( Disp,Back_p,Scr_d,Gc_nomask,x,0,width,16,x,y*16 ); xl = max( x,floor_l(y) ); xr = min( x+width-1,floor_r(y) ); if( xl < xr ) XCopyArea( Disp,Floor_p,Scr_d,Gc_nomask,xl,0,xr-xl+1,16,xl,y*16 ); } }