Hey guys, Finally had a chance to play around with Allegro, and I've made quite a lot of progress, but I have a few things which are proving awkward. 1. I'm in the middle of making a Pong clone and I'm setting up the batons (paddles, whatever you want to call them), to be 10 pixels from the edge of each side of the screen. So player 1 would be 10 pixels in from the left edge of the screen, and player 2, would be 10 pixels in from the right. Here's my CBaton class:
#pragma warning(disable : 4312)
#ifndef BATON_H
#define BATON_H
#include <allegro.h>
class CBaton
{
private:
int m_x; // x coord.
int m_y; // y coord.
int m_width; // Baton width.
int m_height; // Baton height.
int m_colour; // Baton colour.
int m_batonSpeed; // Speed at which the baton will move.
public:
// Constructor.
CBaton(const int ALIGNMENT, int colour);
// Constants to aid drawing different batons.
static const int ALIGN_BATON_LEFT = 10;
static const int ALIGN_BATON_RIGHT = SCREEN_W - 10;
// Draw the baton to the target bitmap. In this case,
// the background.
void Draw(BITMAP *bmp);
// Method to move the baton.
void Move();
};
#endif
I'm having a problem with the ALIGN_BATON_RIGHT constant. It draws player 2's baton about 5 pixels away from player 1's, which seems to make no sense at all, so they're both on the left edge of the screen. Any ideas what the problem here is? You'll see why I'm having trouble debugging it from my next question. 2. I can't seem to debug the application in the debugger. As soon as it goes fullscreen, if it hits a breakpoint, I can't alt+tab to the debugger without everything going nuts, which is making life
incredibly awkward. Anyone know how I can successfully debug the application? 3. This one's not as important, but still a little annoying. 23yrold3yrold gave me a sweet tip to disable compiler warnings that I get with Allegro. It works great, except that I have to put the line in every single header file in the project. Is there a work-around to that? Here's the line, just for reference:
#pragma warning(disable : 4312)
Any help would be gratefully received. [smile] -hellz