In my space invaders clone I have a scrolling background with a 10x10 area with aliens that are 32x32px and its slow. Any suggestions on how to get smoother or faster drawing?
In my space invaders clone I have a scrolling background with a 10x10 area with aliens that are 32x32px and its slow. Any suggestions on how to get smoother or faster drawing?
Its with the Windows API. I'll post the source tomorrow.
Here's the source.
[edit]
removed uneccessary files.
Last edited by lambs4; 08-28-2003 at 09:37 AM.
That source you posted is all kinds of %%%%-ed up. It wont compile in msvc++ 6.0 = Probably the main reason its missing spaceinv.h
I tried the exe = it runs fast enough on my machine - what are you running a commador 64?
Heres what you might try for a tiny boost:
on all your graphic related functions that get called a lot during a loop (draw bullet - draw sprite) declare them as inline: ie.
Further should you think it neccesary - rip off the setPixel() function (I think the function is in the .lib - so youll have to hop on the microsoft newsgroup (free) and ask for the setPixel() function source thats how i got it) copy and paste that bad boy and change it to an inline function too!Code:inline void drawbullet(); inline int drawSprite();
That would take a bit of work of course.
Remember by making the deffinition inline you effectively Inflate your programs size - as the function's source gets copied exactly into the spot it was called - rather then having the function in some memory area - and branching off to that area when ever needed - its all throughout your program code.
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
Yes, I'm running this on a commodore 64.
You don't need spaceinv.h and the source I provided compiles fine using Dev-C++ and Borland.
Runs fine on my machine. Only thing is that it won't go to level 2
Runs fine on my machine.
Well, there are a few things wrong with your code:
1) It does not work.
2) It does not work.
3) It does not work.
Hope this helps.
It would be cool to add the horizontal velocity of the ship at the time a bullet is released to the bullet, though. So when you're moving sideways, your bullet "drifts"Originally posted by Thantos
Runs fine on my machine.
Away.
Also you might want to delay the firing time between bullets. As it is, you can just hold down the firing button and there's no way you can miss.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared