Game creation

Blitz3D Forums/Blitz3D Beginners Area/Game creation

Spence(Posted 2004) [#1]
Hi, I'm new to Blitz Basic and I am interested in game creation. What I would like to do is creat a game like space invaders. The problem that I've encounterd is as follows: the enemy bullet's often flicker when they shoot across the screen. What are good programs for this process, and what are the correct sizes for the images. please help, any tutuorials if any.


Kanati(Posted 2004) [#2]
take a look in the code archives. I think there's a space invaders clone or two out there. Look at other people's code and it should give you lots of insight into how to get rid of that flicker.

As to the sizes of the images... There's no "correct" sizes. Anything you want to put on the screen is fine with blitz.


WolRon(Posted 2004) [#3]
If the bullets are flickering, then you are probably doing something "incorrectly".

My first guess would be that you are drawing to the frontbuffer(). Since you (the user) can actually see the front buffer at all times, you can sometimes see when the computer is 'drawing' the image but hasn't finished yet. (I apologize for the poor explanation.)

It's better to draw to the back buffer and then 'flip' it forward to become the front buffer (the front buffer then becomes the back buffer). This causes it to switch instantaneously and will eliminate flicker.

The tutorials that came with Blitz explain this and more.


eBusiness(Posted 2004) [#4]
A code example:
;Make backbuffer the default drawing buffer
SetBuffer BackBuffer()
;The main loop
While Not KeyHit(1)
  ;Do your drawing here
  ;The command that swap the front- and backbuffer
  Flip
Wend
By default, use this structure :)

And welcome to the forum.


puki(Posted 2004) [#5]
Have a look at this sucker - this is the most recent 'space invader' thing that I have seen on this site (Although it's not actually a Space Invaders clone):

http://www.blitzbasic.com/codearcs/codearcs.php?code=985#comments