Posts: 7
Threads: 1
Joined: Apr 2004
I'm trying to write a Galaga clone in screen 7. I'd like to use mode 13 but there's no page flipping which means my animation would suck so I've a few questions.
1. Is it possible to use Mode X in QB? That would sure make doing graphics and animation easier.
2. If that's not possible, how might I get more than the 16 colours in mode 7?
3. My game so far was running quite smoothly until i put 4 if statements in to prevent the ship from moving outside the screen, and subsequently crashing the game. Now it's too slow to be playable. I'm afraid to see how slow things will run once I put in my baddies and their own hit detection. Anyway to get things running more smoothly?
4. And lastly, does anyone know of a program that will convert a bmp, png, or similar image file inot data statements for use as a sprite in qb?
Posts: 1,752
Threads: 21
Joined: Jun 2002
1. Yes
2. Just use double buffering with screen 13
3. Doesn't sound right...post your code
4. DATA statements are teh suck for sprites...I'd suggest using BSAVEd binary files.
Posts: 7
Threads: 1
Joined: Apr 2004
That's a start. I'll post my code tomorrow because I've gotta pull it from another computer. In the meantime, could you help explain how to implement those suggestions of yours?
Posts: 3,288
Threads: 167
Joined: Nov 2001
There is double buffering in screen 13 without any lib help. Fast enough and easy to use:
Here are some stuff made with it.
http://rel.betterwebber.com/junk.php?id=8
http://rel.betterwebber.com/junk.php?id=16
It's called SuperPUT. Yep made byt the guy above(Plasma).
Here's a lil tute:
http://faq.qbasicnews.com/?blast=SetVide...enThirteen
There's also a PUT replacement which allows:
Transparency, Flipping, clipping, etc and you can read about it here:
http://faq.qbasicnews.com/?blast=SuperPu...enThirteen
Posts: 7
Threads: 1
Joined: Apr 2004
Here's my code:
http://evstar.eatsleepcode.ca/files/qb/Game/SPCATT.BAS
The game runs painfully slow, and I haven't even put in the baddies yet. I'm pretty sure I won't be able to use any libraries because this is for an assignment and we're supposed to write it ourself.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Uh...
I think you forgot to include the game code. There isn't any! Just the initialization stuff...
Posts: 7
Threads: 1
Joined: Apr 2004
My server's having issues, forgive me. I had to rename it and reupload it:
http://evstar.eatsleepcode.ca/files/qb/Game/SPCGAME.BAS
Posts: 6,419
Threads: 74
Joined: Mar 2002
1.- You don't need to use CALL. It is like using LET or REM. Instead of
just do
2.- CLS 1 is terribly slow. Use this instead:
Code:
LINE (0,0)-(319,199),0,BF
3.- In "Placehud" you are doing this once and again:
3.1. That CLS is not needed. You already cleared the screen.
3.2. That DIM takes time. You don't have to dim everytime.
3.3. Then you are printing lots of stuff. You don't have to print all that every time. PRINT is slow in graphics mode.
4.- You are putting the ship twice: in placehud and in putship.
5.- Your code needs vsync
Posts: 7
Threads: 1
Joined: Apr 2004
The problem with the PRINTing is that if I don't reprint that stuff if dissapears, and I need that as part of the heads up display. And how do I vsync?
Posts: 6,419
Threads: 74
Joined: Mar 2002
You don't need to reprint everything. Just print it at the beginning and don't erase it.
VSync:
http://faq.qbasicnews.com/?blast=VerticalRetraceGeneral