• PUDN用户
    了解作者
  • C/C++
    开发工具
  • 57KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 26
    下载次数
  • 2005-09-17 17:46
    上传日期
用C做的一个泡泡糖程序.可以俩人玩.哎呀.装了C就可以玩了.混点份怎么这么难啊
泡泡糖.zip
  • 泡泡糖
  • 泡泡堂.files
  • bbs.css
    2.5KB
  • P5-02-03.gif
    78B
  • P5-02-02.gif
    1.1KB
  • P5-02-04.gif
    60B
  • bbs.js
    14.4KB
  • P5-02-01.gif
    1.2KB
  • counter.htm
    32B
  • ubb.js
    4.3KB
  • west263.gif
    29.4KB
  • Thumbs.db
    9.5KB
  • 泡泡堂.htm
    81.6KB
内容介绍
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>C语言基地 →</TITLE> <META http-equiv=Content-Type content=text/html;charset=gb2312><LINK href="泡泡堂.files/bbs.css" rel=stylesheet> <SCRIPT src="泡泡堂.files/bbs.js"></SCRIPT> <SCRIPT src="泡泡堂.files/ubb.js"></SCRIPT> <META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD> <BODY> <TABLE cellSpacing=0 cellPadding=0 width=740 align=center border=0> <TBODY> <TR> <TD>- <B>C语言基地</B> ( http://jay.99isp.com/Index.asp )<BR>-- <B>经典源码共享</B> ( http://jay.99isp.com/ShowForum.asp?forumid=24 )<BR>--- <B>TC写的“泡泡堂”</B> ( http://jay.99isp.com/ShowPost.asp?id=695 ) <BR><BR> <HR> <P>作者:jaycxm<BR>发表时间:2005-1-13 12:07:05<BR><BR> <P>/* <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 泡泡堂(单机两人对站版,编译器:TC 2.0) <BR><BR>使用方法: <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 双击PAOPAO.EXE运行,如果不是全屏的话,请按Alt+Enter键使它变成全屏。 <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; 玩家一:黄色的笑脸 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向上: w <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向下: s <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向左: a <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向右: d <BR>&nbsp; &nbsp; &nbsp; &nbsp; 放泡泡:空格 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 玩家二:红色的笑脸 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向上: UP(方向键) <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向下: DOWN <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向左: LEFT <BR>&nbsp; &nbsp; &nbsp; &nbsp; 向右: RIGHT <BR>&nbsp; &nbsp; &nbsp; &nbsp; 放泡泡:回车 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 退出: <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ESC <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; o: 增加泡泡个数 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 上下方向的箭头: 增加泡泡的威力。 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 人物被泡泡炸后就不能动了,过一段时间才能恢复,如果在这段时间被另外一个玩家碰了的话,就输了。 <BR><BR>编程思想: <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 在游戏循环中不端检查按键,对控制键执行相关操作,对其他键则忽略处理。 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 对于还没有爆炸的泡泡(或刚爆炸还没有擦除的泡泡)用“队列”存储。每 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 循环一次就检查“队头”元素的时间到了没有,时间到了就让它爆炸(或擦除爆炸 <BR>&nbsp; &nbsp; &nbsp; &nbsp; 痕迹)。爆炸时还要检查其爆炸范围内有没有其他的泡泡,有的话就引爆它。 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 游戏策划: 王宸博 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 游戏编程: 王德浩 <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2004年3月17日 <BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */ <BR><BR>3月24日,增加了一些注释和空格。 <BR><BR>/*------------------------------------------------- <BR>&nbsp; paopaodang.c -- a demo of paopaotang game <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (c) wonderful,wangchengbo 2004 <BR>-------------------------------------------------*/ <BR><BR>/**********************************************************/ <BR>/* 程序中用到的库函数所在头文件应用 #include 命令包含进来 */ <BR><BR>#include <STDIO.H><BR>#include <STDLIB.H><BR>#include <BIOS.H><BR>#include <CTYPE.H><BR>#include <CONIO.H><BR>#include <DOS.H><BR>#include <TIME.H><BR>#include <aLLOC.H rel='nofollow' onclick='return false;'><BR><BR>/**********************************************************/ <BR><BR><BR>#define TIME_DELAY 3/* 人物移动的延时*/ <BR>#define WIN_DELAY 18 <BR>#define MAXQSIZE&nbsp; 100 <BR>#define PAO_TIME&nbsp; 50 /*放泡泡后,等待泡泡爆炸的时间*/ <BR>#define BLAST_TIME 10 /*爆炸消失的时间*/ <BR>#define PAOMAN_DELAY 60 /* 人被炸后恢复需要的时间 */ <BR><BR>/*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 键盘中断函数(借用一个TC做的CS游戏中的)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */ <BR>#define KEY_Y 0x15 <BR>#define KEY_N 0x31 <BR><BR><BR><BR>#define KEY_A 0x1E <BR>#define KEY_D 0x20 <BR>#define KEY_S 0x1f <BR>#define KEY_W 0x11 <BR>#define KEY_ESC 0x01 <BR>#define KEY_ENTER 0x1c <BR>#define KEY_SPACE 0x39 <BR>#define KEY_UP 0x48 <BR>#define KEY_LEFT 0x4b <BR>#define KEY_RIGHT 0x4d <BR>#define KEY_DOWN 0x50 <BR><BR>#define PLAY1UP KEY_W <BR>#define PLAY1LEFT KEY_A <BR>#define PLAY1DOWN KEY_S <BR>#define PLAY1RIGHT KEY_D <BR>#define PLAY1FIRE KEY_SPACE <BR><BR>#define PLAY2UP KEY_UP <BR>#define PLAY2DOWN KEY_DOWN <BR>#define PLAY2LEFT KEY_LEFT <BR>#define PLAY2RIGHT KEY_RIGHT <BR>#define PLAY2FIRE KEY_ENTER <BR><BR><BR><BR>void InstallKeyboard(void); <BR>void ShutDownKeyboard(void); <BR>void far interrupt NewInt9(void); <BR>int GetKey(int ScanCode); <BR><BR>char key_state[128],key_pressed[128]; <BR>void interrupt far (*OldInt9Handler)(); <BR><BR><BR><BR><BR><BR>void InstallKeyboard(void)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*键盘中断程序*/ <BR>{ <BR>int i; <BR>for(i=0;i&lt;128;i++) <BR>key_state[i ]=key_pressed[i ]=0; <BR>OldInt9Handler = getvect(9);&nbsp; &nbsp; &nbsp; &nbsp; /*中断向量值*/ <BR>setvect(9,NewInt9);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*中断程序NewInt9地址存入指定的中断向量表中INT 09H*/ <BR>} <BR><BR><BR>void ShutDownKeyboard(void) <BR>{ <BR>setvect(9,OldInt9Handler); <BR>} <BR><BR><BR>void far interrupt NewInt9(void) <BR>{ <BR>unsigned char ScanCode,temp; <BR>ScanCode=inportb(0x60); <BR>temp=inportb(0x61); <BR>outportb(0x61,temp | 0x80); <BR>outportb(0x61,temp &amp; 0x7f); <BR>if(ScanCode&amp;0x80) <BR>&nbsp; { <BR>&nbsp; &nbsp; ScanCode&amp;=0x7f; <BR>&nbsp; &nbsp; key_state[ScanCode]=0; <BR>&nbsp; } <BR>else <BR>&nbsp; { <BR>&nbsp; &nbsp; key_state[ScanCode]=1; <BR>&nbsp; &nbsp; key_pressed[ScanCode]=1; <BR>&nbsp; } <BR>outportb(0x20,0x20); <BR>} <BR><BR><BR>int GetKey(int ScanCode) <BR>{ <BR>int res; <BR>res=key_state[ScanCode]|key_pressed[ScanCode]; <BR>key_pressed[ScanCode]=0; <BR>return res; <BR>} <BR><BR><BR><BR>/*&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Man function -- copyright Wonderful and WangChengBo &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;*/ <BR>typedef enum <BR>{ <BR>&nbsp; &nbsp; PLAY1=1, PLAY2 <BR>}which_play; <BR><BR><BR>typedef enum <BR>{ <BR>&nbsp; &nbsp; CAN, <BR>&nbsp; &nbsp; CANNOT <BR>}MOVE; <BR><BR>typedef struct <BR>{ <BR>&nbsp; &nbsp; int x, y;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*the position of the man */ <BR>&nbsp; &nbsp; which_play which;&nbsp; &nbsp; /* play1 or play2?*/ <BR>&nbsp; &nbsp; MOVE can_move;&nbsp; &nbsp; &nbsp; /* can man move? */ <BR>&
评论
    相关推荐
    • soaplands.rar
      类似炸弹人、泡泡糖的完整小游戏,有源码和程序
    • state.rar
      依据设计模式中状态模式一个泡泡糖的相关示例代码
    • 泡泡糖.rar
      简单的泡泡堂游戏,使用devc++运行,
    • -data_structure_and-_-_algo
      -data_structure_and -___ algo C ++中的数据结构 *大批 1.数组中所有元素的总和 2.删除数组中的一个元素(排序数组) 3....4,使用二进制搜索在数组中查找元素 5,反转任何给定的数组 ...泡泡糖 选择排序 合并排序
    • 泡泡糖游戏五色球游戏
      完整的好用的五色球游戏。利用C++开发的关于泡泡糖系列的游戏
    • duivision一套与duilib相似的dui界面库
      一套与duilib相似的dui界面库,有很多bug,不过代码逻辑清楚值得学习。
    • snowglobe-src-viewer-2.0.0-r0.tar.gz
      国外的开源游戏引擎,能够承载上千人,属于社交类的游戏
    • 彩球射手.rar
      该游戏适合于平时娱乐之用,娱乐时只需将大于等于三个的连在一块就得分,直到最地层触底为止.
    • 是男人就下一百层SHY.rar
      制作的第一款休闲类的手机游戏,适合初学者参考
    • Java拼图游戏源码.rar
      Java拼图游戏源码,挺经典是一个源码,内附解压密码