當前位置:首頁 » 軟體設計 » 游戲代碼設計

游戲代碼設計

發布時間: 2020-11-27 16:51:30

1. 程序員與游戲程序設計師的區別

程序員是來完成某項工作的具體實現者,而游戲程序設計師是一個宏觀調控這項任務的負責者,類似於架構師一樣
程序員不用去管這個項目的任務分配的事情,只要完成自己被分配的事情就行了,但是設計師要從項目的性能優化等各方面去考慮這件事情

2. 一擔挑游戲代碼(C語言程序設計)

||#include <stdio.h>
#include <conio.h>
int main(void)
{
int player = 0; /* Player number - 1 or 2 */
int winner = 0; /* The winning player */
int choice = 0; /* Square selection number for turn */
int row = 0; /* Row index for a square */
int column = 0; /* Column index for a square */
int line=0; /* Row or column index in checking loop */

char board[3][3] = { /* The board */
{'1','2','3'}, /* Initial values are reference numbers */
{'4','5','6'}, /* used to select a vacant square for */
{'7','8','9'} /* a turn. */
};

/* The main game loop. The game continues for up to 9 turns */
/* As long as there is no winner */
for(int i = 0; i<9 && winner==0; i++)
{
/* Display the board */
printf("\n\n");
printf(" %c | %c | %c\n", board[0][0], board[0][1], board[0][2]);
printf("---+---+---\n");
printf(" %c | %c | %c\n", board[1][0], board[1][1], board[1][2]);
printf("---+---+---\n");
printf(" %c | %c | %c\n", board[2][0], board[2][1], board[2][2]);

player = i%2 + 1; /* Select player */

/* Get valid player square selection */
do
{
printf("\nPlayer %d, please enter the number of the square "
"where you want to place your %c: ",
player,(player==1)?'X':'O');
scanf("%d", &choice);

row = --choice/3; /* Get row index of square */
column = choice%3; /* Get column index of square */
}while(choice<0 || choice>9 || board[row][column]>'9');

3. 製作小游戲怎麼寫代碼

flash小游戲一般用flashMX 要用flash語言
覺得難可以用RPGMaker 不用會變成也能編游戲

4. 什麼是游戲設計

游戲設計或游戲策劃是設計游戲內容和規則的一個過程,好的游戲設計是這樣一個過程:創建能激起玩家通關熱情的目標,以及玩家在追求這些目標時做出的有意義的決定需遵循的規則。這個術語同時也可以表示游戲實際設計中的具體實現和描述設計細節的文檔。游戲設計涉及到好幾個范疇 :游戲規則及玩法、視覺藝術、編程、產品化、聲效、編劇、游戲角色、道具、場景、界面以上的元素都是一個游戲設計專案所需要的。
游戲設計者常常專攻於某一種特定的游戲類型,例如桌面游戲、卡片游戲或者視頻游戲等。盡管這些游戲類型看上去很不一樣,可是它們卻共同擁有很多潛在的概念上或者邏輯上的相似性。

http://ke..com/link?url=7xQ4rO6DBABC4J9HOzOVph_UPc_AhBAHRBEo5wHuFo65U5-_

5. 怎麼設計游戲

設計游戲方法如下:

1、游戲製作主要分為3大塊,即程序開發、美術設計和游戲策劃。


6. 用VB設計游戲,求方法和代碼

select case dre
case -1
if imperj<>1 then imperj=imperj-1
case 1
if imperj<>big then imperj=imperj+1
case 0
big = alldown * 2 - 2 - big
change()
end select
-------------------------
do
for(row;column;;column;row?)
........
next
if(true)then eat these to have 3 score
if(false)then exit do
loop
if(maxcolumn = cols)
print "GAME OVER!"
print "Your score is "&score

7. 哪些開源的游戲代碼風格清晰明了,設計規范,並可從中學習到很多編程方法

www.codeproject.com
其實重要的是文檔規范。

8. 游戲的連招動作是怎麼設計的代碼上又是怎樣實現的

你可以來看看怪物抄獵人OL參考一下襲
最喜歡怪物獵人OL裡面打怪了
每一個攻擊都是不一樣的感受
簡直不能再棒
現在有太刀 大劍 大錘 片手劍 弩炮 弓
選擇武器要慎重了
畢竟怪物獵人OL是根據武器來決定玩法的
怪物獵人OL這款游戲的可玩性還是相當高的
每一個BOSS都讓人有非常強烈的PK心理
每次跟小夥伴一起組隊玩耍都是爽到不能再爽

9. 學代碼,學設計游戲,學程序,是什麼課程

學習技術可以考慮一下:
1. 學習技術可以先從自己的興趣愛好來考慮,畢竟這回與讀書是有區別的,答學了技術一定程度上決定著今後你的工作類別,如果你有一門技術,那就往擅長的哪方面去發展,這樣上手快,相對應的工資也會好一點點。當然,如果你沒有特別明顯的技術或者長處,那就先培養技術。
2.首先,考慮好自己的愛好,喜歡做什麼類型的工作,那份工作需要什麼技能,然後去學習,去培養。
3.考慮今後幾年或者5年的發展趨勢,往熱門行業(廚師),雷軍說站在風口,豬都能飛起來,我同意這句話的,乘風可以破浪,熱門行業和新行業在未來幾年都會有人才短缺的現象。
4.慎重考慮,有始有終,持之以恆,祝你成功。

10. 小游戲程序設計代碼內容

||||http://www.pudn.com/

[我的早期C程序源代碼]黑白棋

#include<io.h>
#include<stdio.h>
#include<dos.h>
#include<string.h>
#include<math.h>
#include<bios.h>
#include<mem.h>
#include<fcntl.h>
#include<stdlib.h>
#include<conio.h>
#include <graphics.h>

#define HH '0'
#define N 6
int Q=0;
char key;
int fine=1;
int A=0,B=0;
char s[N][N],m[N][N];
void *ball;
int maxx;
unsigned int size;
loading()
{ int z=1;

while(z)
{ if(z>77)break;
printf("<");
delay(5000);
z++;
}
delay(2000);
cleardevice();

}
unsigned char Get_Ascii_Key(void)
{
if(bioskey(1))
return(bioskey(0));
else return(0);
}
int Test_Ascii_Key(int ascii)
{
if(Get_Ascii_Key()==ascii)
return(1);
else
return(0);
}
void tu(){
maxx=getmaxx();
size=imagesize(210,390,450,420);
ball=malloc(size);
setfillstyle(1,10);
bar(160,170,473,253);
setfillstyle(1,9);
bar(163,173,470,250);
setcolor(13);
outtextxy(200,200,"Welcome to BLACK & WHITE chess");
setcolor(14);
outtextxy(250,220,"Developer :Wu siyuan ");
outtextxy(290,240,"2002.8");
outtextxy(210,390,"Press any key to contunue...");
getimage(210,390,450,420,ball);

while(!kbhit()){
putimage(210,390,ball,XOR_PUT);
delay(30000);
}

cleardevice();
}
void sou(void){

}
void print()
{ int i=0,j=30;
setcolor(11);
outtextxy(35,20," 0 1 2 3 4 5");
outtextxy(14,50,"0");
outtextxy(14,100,"1");
outtextxy(14,150,"2");
outtextxy(14,200,"3");
outtextxy(14,250,"4");
outtextxy(14,300,"5");
setbkcolor(0);
setlinestyle(SOLID_LINE,0,2);
for(i=0;i<7;i++)
{ setcolor(GREEN);
line (j,30,j,330);
j+=50;
}

j=30;
for(i=0;i<7;i++)
{ setcolor(GREEN);
line(30,j,330,j);
j+=50;

}
for(i=0;i<6;i++)
for(j=0;j<6;j++)
{ if(s[i][j]=='o')

{
setcolor(WHITE);
circle(55+j*50,55+i*50,15);
}
else if(s[i][j]=='x')
{ setcolor(RED);
circle(55+j*50,55+i*50,15); }
}

}

int cal(char z)
{ int *p=0;
int num=0,i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(s[i][j]==z)num++;
p=#
return(*p);
}
void save()
{int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
m[i][j]=s[i][j];
}

void load()
{ int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
s[i][j]=m[i][j];
}

snew(int x,int y,char z1,char z2)
{int i,j,a;int can[]={0,0,0,0,0,0,0,0,0},k[N*N];
if(s[x][y-1]==z1&&(y-1)>=0)
{
i=0;
while(i<y)
{
if(s[x][i]==z2){ can[1]=1;break; }
i++;
}
}
if(s[x][y+1]==z1)
{
i=y+2;
while(i<N)
{
if(s[x][i]==z2){ can[2]=1;break;}
i++;
}
}
if(s[x-1][y]==z1&&(x-1)>=0)
{
i=0;
while(i<x)
{
if(s[i][y]==z2){can[3]=1;break;}
i++;
}
}
if(s[x+1][y]==z1)
{i=x+2;
while(i<N)
{
if(s[i][y]==z2){can[4]=1;break;}
i++;
}
}
if(s[x-1][y+1]==z1&&(x-1)>=0)
{i=2;
while(y+i<N&&(x-i>=0))
{if(s[x-i][y+i]==z2){can[5]=1;break;}
i++;
}
}
if(s[x+1][y-1]==z1&&(y-1)>=0)
{i=2;
while(i<N&&(y-i>=0))
{if(s[x+i][y-i]==z2)
{can[6]=1;break;}
i++;
}
}
if(s[x-1][y-1]==z1&&(x-1)*(y-1)>=0)
{i=2;
while(x-i>=0&&y-i>=0)
{if(s[x-i][y-i]==z2)
{can[7]=1;
break;}
i++;
}
}
if(s[x+1][y+1]==z1)
{i=2;
while(i+x<N)
{if(s[x+i][y+i]==z2)
{can[8]=1;
break;}
i++;
}
}
for(i=1,j=0;i<=8;i++)
if(can[i]==0)j++;

if(j==8&&Q==1)
{printf("error!");
exit(1); }
else if(j!=8)s[x][y]=z2;

if(can[1]==1)
{ i=1;
while(s[x][y-i]==z1)
{s[x][y-i]=z2;
i++;
}
can[1]=0;
}
if(can[2]==1)
{i=1;
while(s[x][y+i]==z1)
{s[x][y+i]=z2;
i++;
}
can[2]=0;
}
if(can[3]==1)
{i=1;
while(s[x-i][y]==z1)
{ s[x-i][y]=z2;
i++;
}
can[3]=0;
}
if(can[4]==1)
{i=1;
while(s[x+i][y]==z1)
{s[x+i][y]=z2;
i++;
}
can[4]=0;
}
if(can[5]==1)
{i=1;
while(s[x-i][y+i]==z1)
{s[x-i][y+i]=z2;
i++;
}
can[5]=0;
}
if(can[6]==1)
{i=1;
while(s[x+i][y-i]==z1)
{s[x+i][y-i]=z2;
i++;
}
can[6]=0;
}
if(can[7]==1)
{i=1;
while(s[x-i][y-i]==z1)
{s[x-i][y-i]=z2;
i++;
}
can[7]=0;
}
if(can[8]==1)
{i=1;
while(s[x+i][y+i]==z1)
{s[x+i][y+i]=z2;
i++;
}
can[8]=0;
}

} /* snew */

void one()
{ int a,b;char g='o';

load();
setcolor(15);
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\n To exit the Game press the 'q' key.\n");
print();

printf("Please input x (0 to 5):");
while(1){

a=Get_Ascii_Key();

if(a==113||a==81){
printf("\nQuit?(y or n)");
while(1)
{
if(Test_Ascii_Key(89)||Test_Ascii_Key(121))
exit(0);
else if(Test_Ascii_Key(110)||Test_Ascii_Key(78))
{printf("\n\tWelcome to return the Game !\n");break; }

}}

if(a>=48&&a<=53){printf("\tGood! x has get!\n");
break;}
}
a=a-48;
printf("Please input y (0 to 5):");

while(1){

b=Get_Ascii_Key();
if(b==113||b==81)
{
printf("\nQuit?(y or Y)");
while(1)
{
if(Test_Ascii_Key(89)||Test_Ascii_Key(121))
exit(0);
else if(Test_Ascii_Key(110)||Test_Ascii_Key(78))
break;

}}
if(b>=48&&a<=53){printf("\tGood! y has get!");break;}
}
b=b-48;

Q=1;
snew(a,b,'x','o');
Q=0;
save();

A=cal(g);
B=cal('x');
/* printf("\t\t\t\t\t\t\rA=%d,B=%d",A,B);*/

}/* one */
void search()
{
int i,j,r=0;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(s[i][j]==HH)
r++;
if(r==0)fine=0;

}
void two()
{ char h='x';int row[N*N],col[N*N];
int a=1,ii,j,t,t1,k[N*N];
load();
for(ii=0;ii<N;ii++)
for(j=0;j<N;j++)
if(s[ii][j]==HH)
{
row[a]=ii;
col[a]=j;
a++;
}
/* space right */

for(ii=1;ii<a;ii++)
{
load(); /*two*/
snew(row[ii],col[ii],'o','x');
k[ii]=cal(h);

}
t=k[1];
ii--;
t1=ii;
while(ii)
{
if(t<=k[ii])
{t=k[ii];t1=ii;}
ii--;
}

a=t1;
A=cal('o');
B=t;
load();

snew(row[a],col[a],'o','x');
save();
cleardevice();

printf("\n\n\t\t\t\t\t Computer located :%d,%d",row[a],col[a]);

}

main()
{ int i,j;
int gd=DETECT,gm;
clrscr();
initgraph(&gd,&gm,"d:\\tc\\bgi");

setbkcolor(BLACK);

tu();

sou();
setbkcolor(0);

for(i=0;i<N;i++)
for(j=0;j<N;j++)
s[i][j]='0';
s[2][2]=s[3][3]='x';
s[2][3]=s[3][2]='o';
save();
loading();
cleardevice();

while(fine)

{
print();
one();
two();
search();
if(key==113||key==81)
{
printf("\nQuit?(y or Y)");
while(!Test_Ascii_Key(89)&&!Test_Ascii_Key(121));
break;
}
}
if(A>B)outtextxy(400,200, " You win!");
else if(A<B)outtextxy(400,200," I win!");
else outtextxy(400,200," It's a draw!");
printf("\n You:%d I:%d",A,B);
getch();
}

熱點內容
美發店認證 發布:2021-03-16 21:43:38 瀏覽:443
物業糾紛原因 發布:2021-03-16 21:42:46 瀏覽:474
全國著名不孕不育醫院 發布:2021-03-16 21:42:24 瀏覽:679
知名明星確診 發布:2021-03-16 21:42:04 瀏覽:14
ipad大專有用嗎 發布:2021-03-16 21:40:58 瀏覽:670
公務員協議班值得嗎 發布:2021-03-16 21:40:00 瀏覽:21
知名書店品牌 發布:2021-03-16 21:39:09 瀏覽:949
q雷授權碼在哪裡買 發布:2021-03-16 21:38:44 瀏覽:852
圖書天貓轉讓 發布:2021-03-16 21:38:26 瀏覽:707
寶寶水杯品牌 發布:2021-03-16 21:35:56 瀏覽:837