PDA

Click to See Complete Forum and Search --> : Speed problems...


Sc0rp
Feb 24th, 2001, 12:19 PM
I got an assignment in school to create a game. I'm using DX7 and VB to create it. I have a couple of problems with it:

The background of the game is constant, and blitting it on the buffer every cycle in my loop eats up a lot of time. Since it's a constant background, can it be 'fixed' to the buffer so it will always be it's background?
The second problem is that the game is supposed to run on the computers in my school. I'm creating the game at home on a 733Mhz proccessor, and the speed looks fine to me, but on the computers in my school it will probably be slower. How can I keep the speed constant no matter where I run the game?

Thanks!

YoungBuck
Feb 24th, 2001, 01:25 PM
Q1. You will have to blt it to the surface each time around in the loop, but as long as you are keeping it on a seperate surface to where the only thing you have to do is blt it then I wouldn't worry about the speed.

Q2. I run a P1 200 mhz 32mb ram system with no real graphics card to speak of and everything I've done in DX7 ran really smooth so I wouldn't worry about it.

plenderj
Feb 28th, 2001, 11:12 AM
1 ;
If you're using a control to blit to, then just set its background picture/colour to some value, and then blit on top of that.

In my game im blitting onto a form, and I just set the background color = vbBlack to make it look like space.
Then i used shapes to make starts, and then I blitted the bitmaps on top of that for other ships etc.


2 ;
If you want the game to run the same speed regardless of the spec (within reason), then throw in some GetTickCount() into a Do...Loop
Take a look at the thread I posted a few days ago.
Look in the main form, at the RunGameLoop.
Thats how I do it in all of my games.


- jamie