free Pascal编写游戏
freepascal吧
全部回复
仅看楼主
level 7
codetyphon 楼主
2014年03月28日 23点03分 1
level 8
没这个能力
2015年03月21日 07点03分 2
很简单的
2015年03月21日 07点03分
我编过石头剪刀布的,用random随机函数
2015年03月21日 07点03分
回复
������
:那个可以用函数计算出电脑会出什么的
2015年07月13日 13点07分
回复 吾乃掳至深 :嗯,其实早就回了
2015年07月13日 13点07分
level 1
var hp,atk,guai,gl,boss,c,xg,g,a:integer;name:string;xz:char;
const ta=50;tj=500;ja=100;jj=1000;za=150;zj=2000;
begin
hp:=1000;
atk:=50;
guai:=300;
g:=guai;
gl:=30;
c:=1;
writeln('It is about 10 layer game,please write your name:');
readln(name);
repeat
if hp>3000 then hp:=3000;
if hp<0 then hp:=0;
writeln('Layer:',c);
writeln('HP:',hp,' ATK:',atk);
writeln('Monster:',guai,' ',gl);
writeln('A.Common attack B.Recovery blood C.Random effect');
readln(xz);
if xz='A' then begin
writeln('Your use the commom attack cause damage ',atk,' drop.');
guai:=guai-atk;
end;
if xz='B' then begin
writeln('Your use the recovery blood recpvery ',atk,' drop.');
hp:=hp+atk;
end;
if xz='C' then begin
writeln('Guess what it happen');
randomize;
xg:=random(5);
if xg=0 then begin writeln('Sorry,your are poisoning,lose ',atk,' drop.');hp:=hp-atk;end;
if xg=1 then writeln('Sorry,it not happen anything.');
if xg=2 then begin writeln('Your are vampire!');hp:=hp+(atk div 2);guai:=guai-(atk div 2);end;
if xg=3 then begin writeln('Crit!Atk*2!');guai:=guai-(atk*2);end;
if xg=4 then begin writeln('Double Hit!Three times!Good luck!');guai:=guai-(atk*3);end;
end;
writeln('Monster attack you!');hp:=hp-gl;
if (guai<0) or (guai=0) then begin
writeln('You win the ',c,' layer.Next layer.');
c:=c+1;
gl:=gl+10;
g:=g+100;
guai:=g;
a:=c;
end;
if a=3 then begin writeln('You found a lron sword!Atk+50.');atk:=atk+50;a:=0;end;
if a=5 then begin writeln('You found a lron armor!Hp+500.');hp:=hp+500;a:=0;end;
if a=7 then begin writeln('You found a gold sword!Atk+100.');atk:=atk+100;a:=0;end;
if a=9 then begin writeln('You found a gold armor!Hp+1000.');hp:=hp+1000;a:=0;end;
if (hp<0) or (hp=0) then begin writeln('You lose,game over.');exit;end;
writeln;
until c=10;
writeln('Boss is coming.You must found diamond sword and diamond armor!');
writeln('A.found diamond sword B.found diamond armor')
end.
2015年05月24日 12点05分 3
没做完,自己玩
2015年05月24日 12点05分
回复
ȡ���������°�
:英文不要在意,大概看懂就行,不行找翻译
2015年05月24日 12点05分
level 6
编游戏没有算法,应该好说
2015年07月27日 17点07分 4
level 6
其实很简单的
2015年07月27日 17点07分 5
level 14
楼主是问问题吗[黑线][疑问][疑问]
2015年08月17日 11点08分 6
level 5
这甚么游戏
2016年09月30日 12点09分 7
level 2
shit。。。。。。。根本玩不过,怪物无敌!已经译成中文版:
var hp,atk,guai,gl,boss,c,xg,g,a:integer;name:string;xz:char;const ta=50;tj=500;ja=100;jj=1000;za=150;zj=2000;beginhp:=1000;atk:=50;guai:=300;g:=guai;gl:=30;c:=1;writeln('它是关于10层游戏,请写下你的名字:');readln(name);repeatif hp>3000 then hp:=3000;if hp<0 then hp:=0;writeln('层:',c);writeln('HP:',hp,' 攻击力:',atk);writeln('怪物:',guai,' ',gl);writeln('A.常见的攻击 B.恢复血 C.随机效应');readln(xz);if xz='A' then beginwriteln('你用普通攻击造成damaget',atk);guai:=guai-atk;end;if xz='B' then beginwriteln('你使用恢复血recpvery ',atk);hp:=hp+atk;end;if xz='C' then beginwriteln('猜一猜发生了什么事');randomize;xg:=random(5);if xg=0 then begin writeln('对不起,你的中毒,输了',atk);hp:=hp-atk;end;if xg=1 then writeln('对不起,它不会发生任何事情。');if xg=2 then begin writeln('你是吸血鬼!');hp:=hp+(atk div 2);guai:=guai-(atk div 2);end;if xg=3 then begin writeln('暴击!攻击力×2!');guai:=guai-(atk*2);end;if xg=4 then begin writeln('双重打击!三次!祝你好运!');guai:=guai-(atk*3);end;end;writeln('怪物攻击你!');hp:=hp-gl;if (guai<0) or (guai=0) then beginwriteln('你赢了 ',c,' 层,下一层。');c:=c+1;gl:=gl+10;g:=g+100;guai:=g;a:=c;end;if a=3 then begin writeln('你发现了一个铁的剑!攻击+ 50。');atk:=atk+50;a:=0;end;if a=5 then begin writeln('你发现了一个铁盔甲!HP+ 500。');hp:=hp+500;a:=0;end;if a=7 then begin writeln('你找到了一把金剑!Atk+100.');atk:=atk+100;a:=0;end;if a=9 then begin writeln('你找到了一个金色的盔甲!Hp+1000.');hp:=hp+1000;a:=0;end;if (hp<0) or (hp=0) then begin writeln('你输了,game over.');exit;end;writeln;until c=10;writeln('Boss 来了,你必须找到钻石剑和钻石盔甲!');writeln('A.发现金刚石刀B.发现钻石装甲')end.
2016年10月29日 09点10分 8
[泪]跪求完整版
2016年10月29日 09点10分
本人怎么越看越像minecraft[滑稽]
2016年12月01日 11点12分
level 2
hehe
2016年11月03日 12点11分 9
level 2
我自己弄了以完整版:
var hp,atk,guai,gl,boss,c,xg,g,a,huaji:integer;name:string;xz:char;sb:string;
begin
hp:=1000;
atk:=50;
guai:=300;
g:=guai;
gl:=30;
c:=1;
writeln('它是关于10层游戏,请写下你的名字:');
readln(name);
repeat
if hp<0 then hp:=0;
writeln('层:',c);
writeln('HP:',hp,' 攻击力:',atk);
writeln('怪物:',guai,' ',gl);
writeln('A.常见的攻击 B.恢复血 C.随机效应');
readln(xz);
if xz='D' then
readln(sb);
if sb='KILL' then guai:=guai-9999;
if sb='BAOFA' then hp:=hp+9000;
if sb='BISHA' then atk:=1000;
if xz='A' then begin
writeln('你用普通攻击造成damaget',atk);
guai:=guai-atk;
end;
if xz='B' then begin
writeln('你使用恢复血recpvery ',atk);
hp:=hp+atk;
end;
if xz='C' then begin
writeln('猜一猜发生了什么事');
randomize;
xg:=random(5);
if xg=0 then begin writeln('对不起,你中毒了,输了',atk);hp:=hp-100;end;
if xg=1 then writeln('对不起,它不会发生任何事情。');
if xg=2 then begin writeln('你是吸血鬼!');hp:=hp+(atk div 2);guai:=guai-(atk div 2);end;
if xg=3 then begin writeln('暴击!攻击力×2!');guai:=guai-(atk*2);end;
if xg=4 then begin writeln('双重打击!三次!祝你好运!');guai:=guai-(atk*3);end;
end;
writeln('怪物攻击你!');hp:=hp-gl;
if (guai<0) or (guai=0) then begin
writeln('你赢了 ',c,' 层,下一层。');
c:=c+1;
gl:=gl+10;
g:=g+100;
guai:=g;
a:=c;
end;
if a=3 then begin writeln('你发现了一个铁的剑!攻击+ 50。');atk:=atk+50;a:=0;end;
if a=5 then begin writeln('你发现了一个铁盔甲!HP+ 500。');hp:=hp+500;a:=0;end;
if a=7 then begin writeln('你找到了一把金剑!Atk+100.');atk:=atk+100;a:=0;end;
if a=9 then begin writeln('你找到了一个金色的盔甲!Hp+1000.');hp:=hp+1000;a:=0;end;
if (hp<0) or (hp=0) then begin writeln('你输了,game over.');exit;end;
until c=10;
writeln('Boss 来了,你必须找到钻石剑和钻石盔甲!');
writeln('A.发现金刚石刀B.发现钻石装甲');
readln(xz);
if xz='A' then atk:=atk
+3
00;
if xz='b' then hp:=hp+2000;
writeln('boss来了');
boss:=20000;gl:=500;
repeat
if hp<0 then hp:=0;
if hp=0 then writeln('你输了');
writeln('HP:',hp,' 攻击力:',atk);
writeln('boss:',boss,' ',gl);
writeln('A.常见的攻击 B.恢复血 C.随机效应');
readln(xz);
if xz='D'then
readln(sb);
if sb='KILL' then boss:=boss-9999;
if sb='BAOFA' then hp:=hp+9000;
if sb='BISHA' then atk:=1000;
if xz='A' then begin
writeln('你用普通攻击造成damaget',atk);
boss:=boss-atk;
end;
if xz='B' then begin
writeln('你使用恢复血recpvery ',atk);
hp:=hp+atk;
end;
if xz='C' then begin
writeln('猜一猜发生了什么事');
randomize;
xg:=random(5);
if xg=0 then begin writeln('对不起,你中毒了,输了',atk);hp:=hp-100;end;
if xg=1 then writeln('对不起,它不会发生任何事情。');
if xg=2 then begin writeln('你是吸血鬼!');hp:=hp+(atk div 2);boss:=boss-(atk div 2);end;
if xg=3 then begin writeln('暴击!攻击力×2!');boss:=boss-(atk*2);end;
if xg=4 then begin writeln('双重打击!三次!祝你好运!');boss:=boss-(atk*3);end;
end;
randomize;
huaji:=random(3);
if (huaji=0)or(huaji=1)or(huaji=2) then begin writeln('boss攻击你!');hp:=hp-gl;end;
if huaji=3 then begin writeln('滑稽了~');boss:=boss*2;gl:=gl+200;end;
if boss<0 then boss:=0;
if boss=0 then begin
writeln('你赢了!');
writeln('恭喜通关');
end;
until boss=0;
end.
2016年11月05日 03点11分 10
顺便加了作弊码[滑稽]
2016年11月05日 03点11分
level 5
我的石头剪刀布出2了……英语多的要命
uses crt;
var
c:string;
n,i,j,compu:integer;
com,pla:array[1..2]of integer;
comp,play:string;
begin
textcolor(9);
writeln('This is the *minecraft* game:paper-scissors-stone!');
writeln('Press spase to start game!!!');
readln(c);
while c=' 'do
begin
textcolor(14);
writeln('Write creeper, steve, or slime.');
writeln('The creeper wins the steve;');
writeln('the steve wins the slime;');
writeln('And, the slime wins the steve');
textcolor(9);
writeln('Okay, you can play 5 set. How many times do you plan to play elery game?');
textcolor(10);
readln(n);com[1]:=0;pla[1]:=0;
for i:=1 to 5 do begin
com[2]:=0;pla[2]:=0;
for j:=1 to n do begin
randomize;
textcolor(10);
write('you:');
readln(play);
compu:=random(2);
if compu=0 then comp:='creeper' else if compu=1 then comp:='steve' else comp:='slime';
textcolor(12);
writeln('computer:',comp);
if play='steve' then if comp='creeper'then inc(com[2])
else if comp='slime'then inc(pla[2]);
if play='creeper' then if comp='slime'then inc(com[2])
else if comp='steve'then inc(pla[2]);
if play='slime' then if comp='steve'then inc(com[2])
else if comp='creeper'then inc(pla[2]);
textcolor(9);
writeln(pla[2],':',com[2]);
readln;
end;
if pla[2]>com[2] then inc(pla[1]);
if com[2]>pla[2] then inc(com[1]);
textcolor(5);
writeln(pla[1],':',com[1]);
end;
textcolor(9);
write('okay. ');
if com[1]>pla[1] then write('you lost.')
else if com[1]>pla[1] then write('you win.');
writeln('if you want to play again, please press spase.');
readln(c);
end;
writeln('Well, the game is over, goodbye!');
readln;
end.
呵呵我分享的本来不是这个贴
2016年11月07日 13点11分 11
level 5
完全是我自己编的
2016年11月07日 13点11分 12
1