Hello Lcl!
The drawing of lives seems to be good, but the movement is weak, because the player and the enemeis can go into walls.
But I attach the game. (It is a small pac-man clone I make to my nephew.)
int i,j,xplace,yplace;
char level1[20][30] =
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,1,0,0,0,0,0,1,0,0,0,0,0,1},
{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1},
{0,0,0,0,0,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1},
{0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1},
{0,0,0,0,0,1,0,1,0,1,0,1,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1},
{0,0,0,0,0,1,0,1,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0},
{1,1,1,1,1,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1,0,1,0,0,0,0},
{1,2,1,1,0,3,0,0,4,1,0,1,1,0,0,1,1,0,0,0,4,0,0,1,0,1,0,0,0,0},
{1,0,1,1,0,1,1,1,0,1,0,0,1,1,0,1,1,0,1,1,1,1,0,1,0,1,1,0,0,0},
{1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0},
{1,1,1,1,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,1,1,1,1,1,1,0,1,0,0,0},
{0,0,0,0,0,1,0,1,1,0,1,1,1,1,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,4,1,0,0,0},
{1,1,1,1,1,1,0,1,1,0,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,0,1,0,0,0},
{1,0,0,0,0,0,0,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
{1,0,1,1,1,1,0,1,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1},
{1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,1},
{1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1},
};
//
xplace=0;
yplace=0;
walls=0;
for(j = 0; j < 20; j++)
{
for(i=0; i < 30; i++)
{
switch (level1[j][i])
{
case 1: CreateActor("wall", "wall", "no parent", "no path",xplace,yplace,true);
placeofwall[walls][0]=xplace;
placeofwall[walls][1]=yplace;
walls+=1;
break;
case 2: CreateActor("teleport", "teleport", "no parent", "no path",xplace,yplace,true); break;
case 3: CreateActor("ghost", "ghost0", "no parent", "no path",xplace,yplace,true); break;
case 4: CreateActor("dot", "dot", "no parent", "no path",xplace,yplace,true); break;
};
xplace+=wall.width;
};
xplace=0;
yplace+=wall.height;
};
for (i=0;i<walls;i+=1)
{
CreateActor("dot", "dot", "no parent", "no path",placeofwall[i][0],placeofwall[i][1],true);
}
ITomi wrote:I almost done with my program, but I found a big problem again:
I put out the elements of the game with the following code:
- Code: Select all
int i,j,xplace,yplace;
char level1[20][30] =
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,1,0,0,0,0,0,1,0,0,0,0,0,1},
{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1},
{0,0,0,0,0,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
{0,0,0,0,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
for(i=0; i < 30; i++)
{
switch (level1[j][i])
{
case 1: CreateActor("wall", "wall", "no parent", "no path",xplace,yplace,true);
placeofwall[walls][0]=xplace;
placeofwall[walls][1]=yplace;
walls+=1;
break;
case 2: CreateActor("teleport", "teleport", "no parent", "no path",xplace,yplace,true); break;
case 3: CreateActor("ghost", "ghost0", "no parent", "no path",xplace,yplace,true); break;
case 4: CreateActor("dot", "dot", "no parent", "no path",xplace,yplace,true); break;
};
xplace+=wall.width;
};
xplace=0;
yplace+=wall.height;
};
Everything are on their place, so everything OK. But when I try to place other things on the coordinates of the walls, these things will be on totally different places, however I have saved their coordinates into placeofwall arrays. To see it, I placing these things with the following code:
- Code: Select all
for (i=0;i<walls;i+=1)
{
CreateActor("dot", "dot", "no parent", "no path",placeofwall[i][0],placeofwall[i][1],true);
}
But it is not good; the dots appears on wrong coordinates! What is the problem and how can I solve this?
int falhely[600][1];
falhely[falhelydb][0]=xhely;
falhely[falhelydb][1]=yhely;
ITomi wrote:I hope, finally I will be able to make my first GE game.
ITomi wrote:Thank you, everybody!
As soon as I will done with my game, I will publish it.
And: köszönöm a biztatást!
lcl wrote:Hey, Hungarian! I've been to Budapest twice
ITomi wrote:lcl wrote:Hey, Hungarian! I've been to Budapest twice
Did you like my capital? I live there for 5 years.
And my older brother have been to Finland, about 20 years ago. Beautiful country!
Users browsing this forum: No registered users and 1 guest