The Partridge Family were neither partridges nor a family. Discuss.
-
Craigspaz
- Posts: 33
- Joined: June 9th, 2012, 12:23 am
Post
by Craigspaz » June 22nd, 2012, 8:59 pm
This part of the code is in game.h
This part of the code is in game.cpp
Code: Select all
void Game::UpdateGame()
{
if( kbd.RightIsPressed() )
{
Fighter.x++;
}
if( kbd.LeftIsPressed() )
{
Fighter.x--;
}
if( kbd.UpIsPressed() )
{
Fighter.y++;
}
if( kbd.DownIsPressed() )
{
Fighter.y++;
}
}
The error says syntax error missing : ';' before '.'
Does anybody know how to fix this?
CraigSpaz
-
chili
- Site Admin
- Posts: 3948
- Joined: December 31st, 2011, 4:53 pm
- Location: Japan
-
Contact:
Post
by chili » June 23rd, 2012, 1:11 am
Your problem probably lies elsewhere. Read the rules and post your solution folder. We will help you.
Chili
-
Craigspaz
- Posts: 33
- Joined: June 9th, 2012, 12:23 am
Post
by Craigspaz » June 23rd, 2012, 1:50 am
I attached my solution.
-
Attachments
-
- MYGAME.zip
- (653.47 KiB) Downloaded 156 times
CraigSpaz
-
zentojamorn
- Posts: 10
- Joined: May 22nd, 2012, 4:22 am
Post
by zentojamorn » June 23rd, 2012, 3:45 am
Errors are from struct that you declared in Game.h.
You treat struct-name as variable.
You code should be like
Code: Select all
struct Character
{
int lookingup_x;
int lookingupt_y;
int lookingleft_x;
int lookingleft_y;
int lookingdown_x;
int lookingdown_y;
int lookingright_x;
int lookingright_y;
}Fighter,BlueEnemy,BlueRedWhiteEnemy,BlueRedWhiteBigEnemy,BlueYellowEnemy,BlueYellowRedEnemy,BossEnemy;
Download link below will help you understand more about struct.
-
Attachments
-
- Test2.zip
- Example of how to using Struct.
- (714.96 KiB) Downloaded 127 times
Sorry for my poor english..
-
Craigspaz
- Posts: 33
- Joined: June 9th, 2012, 12:23 am
Post
by Craigspaz » June 23rd, 2012, 10:57 am
Thanks it helped a lot.
CraigSpaz