游戏代码设计
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();
}