-
Useful class hierarchy?
Would you implement animated Sprites in this way:
class Animation{
LPDIRECTDRAWSURFACE7 lpDDSgraphic;
RECT StartFrame,EndFrame,CurrentFrame,VisiblePart;
int frameDelay;
public:
bool Create(LPDIRECTDRAWSURFACE7 lpDDSx,int LinesOnSurf,
int RowsOnSurf,int StartXindex,int StartYindex,int EndXindex,
int EndYindex, int framedelay,int Colorkey=RGB(255,255,255));
bool Draw(LPDIRECTDRAWSURFACE7 lpDDSbackbuffer,
RECT WhereToDrawThere,RECT WhatToDrawThere);
};
class ComplexSprite{
Animation* AvailableAnimations; // Will be initialized with
// actual Animation-array
int Status; // f.e. jumping, smiling, doesn't matter what
// but I'm hoping to control the Animation shown with this
// member
//
// Rest is something like SetXY() any easy Sprite-functions
};
Do I have to 'invent' a class hierarchy on my own or are there
resources somewhere on the internet I can learn from?
Oh - my very first 'game' is attached, you'll need DirectX 8.1- I guess (and a 800x600x16-able screen)
-
Question Frames
How to calculate the amount of videomemory a 800x600 16-bit surface uses?
Also, if a game runs with 50 frames (screen updates) per second: Would you say this is fast or slow? How many different Blits from videomemory to a backbuffer can a program do in 1/50 seconds?
How to know how many procedures calculating the state of the game (Position in Level, Position on Screen, Collision ...) can be executed in 1/50 seconds? Do you know an example for a professionally written game updating its screen 50 times a second and can you tell me how complex it is (or what you guess how many function calls and blits are done in 0.02 seconds in this specific game). I'm afraid to call to many functions and do to many blits in my programs, because I've no idea of professionally efficient programming.