I have two classes:
playerBubble
class playerBubble
{
public:
int x, y, Mx, My, rad;
playerBubble()
{
x = 100;
y = 100;
rad = 32;
}
void MoveUp()
{
if ( y >= 0 )
{
y--;
}
}
void MoveDown()
{
if ( y <= 480-64)
{
y++;
}
}
void MoveRight()
{
if ( x <= 640-64 )
{
x++;
}
}
void MoveLeft()
{
if (x >= 0)
{
x--;
}
}
void Draw( Surface* a_Screen )
{
spr_playerBubble.Draw( x, y, a_Screen );
}
} player;
enemyBubble.
class enemyBubble
{
public:
float y, speed;
int x, Mx, My, rad;
enemyBubble()
{
x = 250;//rand() % 641 - 64;
y = 500;//rand() % 50 + 500;
speed = 0.1;
rad = 16;
}
void Move()
{
if (y <= -64)
{
if (speed < 1)
{
speed += 0.02;
}
srand ( rand() );
y = 250;//rand() % 100 + 500;
x = 500;//rand() % 641 - 64;
}
y -= speed;
}
void Draw( Surface* a_Screen )
{
spr_enemyBubble.Draw( x, y, a_Screen );
}
} enemy;
This is my "Tick" function:
void Game::Tick( float a_DT )
{
m_Screen->Clear( 0 );
if (GetAsyncKeyState( VK_UP ))
{
player.MoveUp();
}
if (GetAsyncKeyState( VK_DOWN ))
{
player.MoveDown();
}
if (GetAsyncKeyState( VK_LEFT ))
{
player.MoveLeft();
}
if (GetAsyncKeyState( VK_RIGHT ))
{
player.MoveRight();
}
enemy.Move();
enemy.Draw( m_Screen );
player.Draw( m_Screen );
}
I put a break at the last line the Tick function and when i open the watch menu i can type in my object "player" and get all the variables of that object. But when i type in "enemy" i see this:

As you can see the type of object "player" is it's accommodating class but the type of object "enemy" is enemy itself so there is clearly something going wrong here but the demo itself is working as it should.
Can someone please help me figure out what's wrong here?
Edit while making this post:
I just figured out that it does work when i edit the source code but don't delete anything (an enter, backspace or similar) and press F5 again, i don't even have to remove the breakpoint. So you would think that it would work if i ran the game and a after a few seconds placed the breakpoint, no it doesn't, i need to edit the source code while not changing anything except white space and it works. But i have to do this everytime i start debugging so that is no option. How can this happen?
I used Hyperdesktop to capture the screenshots, great program for use in situations like this. You have shortcuts to take a screenshot from your screen, the active window or a self drawn box. Then it uploads that to Imgur and the direct image link is copied to your clipboard so you just have to paste it in the add image box here.













