迷路作成しています…
Posted: 2013年2月22日(金) 22:54
初心者です…。
壁の当たり判定がうまくいきません。
初期位置から動きません…
よければ誤りを指摘してもらえないでしょうか?
#include<stdio.h>
#include"CScreen.h"
#include<windows.h> /*
1="─"
2="┐"
3="|"
4="┬"
5="└"
6="├"
7="┘"
8="┌"
9=" "
*/
// 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9
int stage1[28][69]={{8,0,1,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,2},//1
{3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3},//2
{6,0,1,0,2,0,9,0,3,0,9,0,5,0,1,0,2,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,5,0,1,0,2,0,9,0,3,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3},
{3,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3},
{3,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,5,0,2,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3},
{3,0,9,0,3,0,9,0,5,0,1,0,2,0,9,0,3,0,9,0,9,0,5,0,2,0,9,0,3,0,9,0,9,0,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0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,7}};/*28*/
int x,y;/*配列stage1の要素数*/
int p=3,q=2;/*プレイヤーの位置情報*/
int b=10,r=20,g=30,yel=40;
/*プロトタイプ宣言*/
void map(void);
void play(void);
void control(void);
int main(void)
{
int i;
while(1){
if(GetAsyncKeyState(VK_ESCAPE))
break;
CLS();
map();
play();
control();
for(i=0;i<160000000;i++);
}
return 0;
}
void control(void)
{
int i;
if(GetAsyncKeyState(VK_DOWN))
{
q+=1;
b=12;
r=20;
g=30;
yel=40;
if(stage1[q][p]!=9)
q-=1;
}
if(GetAsyncKeyState(VK_RIGHT))
{
rewind(stdin);
p+=2;
b=10;
r=22;
g=30;
yel=40;
if(stage1[q][p]!=9)
p-=2;
}
if(GetAsyncKeyState(VK_LEFT))
{
rewind(stdin);
p-=2;
b=10;
r=20;
g=32;
yel=40;
if(stage1[q][p]!=9)
p+=2;
}
if(GetAsyncKeyState(VK_UP))
{
rewind(stdin);
q-=1;
b=10;
r=20;
g=30;
yel=42;
if(stage1[q][p]!=9)
q+=1;
}
}
void map(void)
{
/*
1="─"
2="┐"
3="|"
4="┬"
5="└"
6="├"
7="┘"
8="┌"
9=" "
*/
int i;
for(x=0;x<28;x++){
for(y=0;y<69;y++){
if(stage1[x][y]==8){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┌");
}
else if(stage1[x][y]==1){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("─");
}
else if(stage1[x][y]==2){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┐");
}
else if(stage1[x][y]==3){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("|");
}
else if(stage1[x][y]==4){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┬");
}
else if(stage1[x][y]==5){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("└");
}
else if(stage1[x][y]==6){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("├");
}
else if(stage1[x][y]==7){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┘");
}
}
}
return;
}
void play(void)
{
int i;
if(b==12&&r==20&&g==30&&yel==40){
LOCATE(p,q);
printf("●");
}
else if(b==12&&r==20&&g==30&&yel==40){
LOCATE(p,q);
COLOR(BLUE);
printf("●");
}
else if(b==10&&r==22&&g==30&&yel==40){
LOCATE(p,q);
COLOR(RED);
printf("●");
}
else if(b==10&&r==20&&g==32&&yel==40){
LOCATE(p,q);
COLOR(GREEN);
printf("●");
}
else if(b==10&&r==20&&g==30&&yel==42){
LOCATE(p,q);
COLOR(YELLOW);
printf("●");
}
return;
}
壁の当たり判定がうまくいきません。
初期位置から動きません…
よければ誤りを指摘してもらえないでしょうか?
#include<stdio.h>
#include"CScreen.h"
#include<windows.h> /*
1="─"
2="┐"
3="|"
4="┬"
5="└"
6="├"
7="┘"
8="┌"
9=" "
*/
// 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9 1 3 5 7 9
int stage1[28][69]={{8,0,1,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,1,0,1,0,4,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,1,0,4,0,1,0,4,0,1,0,1,0,2},//1
{3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3},//2
{6,0,1,0,2,0,9,0,3,0,9,0,5,0,1,0,2,0,9,0,9,0,3,0,9,0,9,0,3,0,9,0,5,0,1,0,2,0,9,0,3,0,9,0,3,0,9,0,9,0,3,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,3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,9,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,9,0,3},
{3,0,9,0,3,0,9,0,3,0,9,0,3,0,9,0,9,0,5,0,1,0,7,0,9,0,9,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,9,0,9,0,5,0,1,0,7,0,9,0,9,0,9,0,9,0,3},
{3,0,9,0,3,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,3,0,9,0,3,0,9,0,3,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,3},
{5,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,7}};/*28*/
int x,y;/*配列stage1の要素数*/
int p=3,q=2;/*プレイヤーの位置情報*/
int b=10,r=20,g=30,yel=40;
/*プロトタイプ宣言*/
void map(void);
void play(void);
void control(void);
int main(void)
{
int i;
while(1){
if(GetAsyncKeyState(VK_ESCAPE))
break;
CLS();
map();
play();
control();
for(i=0;i<160000000;i++);
}
return 0;
}
void control(void)
{
int i;
if(GetAsyncKeyState(VK_DOWN))
{
q+=1;
b=12;
r=20;
g=30;
yel=40;
if(stage1[q][p]!=9)
q-=1;
}
if(GetAsyncKeyState(VK_RIGHT))
{
rewind(stdin);
p+=2;
b=10;
r=22;
g=30;
yel=40;
if(stage1[q][p]!=9)
p-=2;
}
if(GetAsyncKeyState(VK_LEFT))
{
rewind(stdin);
p-=2;
b=10;
r=20;
g=32;
yel=40;
if(stage1[q][p]!=9)
p+=2;
}
if(GetAsyncKeyState(VK_UP))
{
rewind(stdin);
q-=1;
b=10;
r=20;
g=30;
yel=42;
if(stage1[q][p]!=9)
q+=1;
}
}
void map(void)
{
/*
1="─"
2="┐"
3="|"
4="┬"
5="└"
6="├"
7="┘"
8="┌"
9=" "
*/
int i;
for(x=0;x<28;x++){
for(y=0;y<69;y++){
if(stage1[x][y]==8){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┌");
}
else if(stage1[x][y]==1){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("─");
}
else if(stage1[x][y]==2){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┐");
}
else if(stage1[x][y]==3){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("|");
}
else if(stage1[x][y]==4){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┬");
}
else if(stage1[x][y]==5){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("└");
}
else if(stage1[x][y]==6){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("├");
}
else if(stage1[x][y]==7){
LOCATE(y+1,x+1);
COLOR(WHITE);
printf("┘");
}
}
}
return;
}
void play(void)
{
int i;
if(b==12&&r==20&&g==30&&yel==40){
LOCATE(p,q);
printf("●");
}
else if(b==12&&r==20&&g==30&&yel==40){
LOCATE(p,q);
COLOR(BLUE);
printf("●");
}
else if(b==10&&r==22&&g==30&&yel==40){
LOCATE(p,q);
COLOR(RED);
printf("●");
}
else if(b==10&&r==20&&g==32&&yel==40){
LOCATE(p,q);
COLOR(GREEN);
printf("●");
}
else if(b==10&&r==20&&g==30&&yel==42){
LOCATE(p,q);
COLOR(YELLOW);
printf("●");
}
return;
}