# DarkBASIC Programming/2D Game Programming Pt 2
### Day 19

Okay, so we've made Pong the next step is to make a Break-Out game. Just giving you, the source code of the game would prove you didn't code the pong game by yourself. So what I'm going to do is let you program your own break-out game, and I will give some guided examples. After this quick break-out game exercise I will be discussing multimedia!
Collisions
if sprite collision(paddle,ball) = 1 then bouncball = 1
Possible Solutions to Make the Ball Bounce :S
-Setup a variable called ballmovex, set it's value to random 1 or 0. -if the ball strikes 0 make it move left, and in the case of 1 right -do the same thing with a variable called ballmovey, except in this -case moving up or down.
Possible Solutions of Setting Up Blocks
-Setup an array which holds the x positions of your bricks, and the y positions of your bricks. Then one for if the brick has been struck, so if the brick has been struck it will equal 1 or true and then have conditional statements(if and thens) for the action to break the brick.
if if sprite collision(paddle,brickhit(bricknum)) = 1 then destroybrick = 1
if destroybrick = 1
endif
Something to Remember:
I've given lots of suggestions as to how to complete the Break-Out game, hopefully this will go down nice and easy without heartburn. If you have a case of "what thes" then I suggest you visit the codebase on the official DarkBASIC home page: http://www.thegamecreators.com, it has everything a DarkBASIC coder shall need.
Not many people can say that they hate music, in fact most people love hearing ambient music in games, I know I do! Above, I used some strange commands, play sound, play music, load music, play music. Well, DarkBASIC has three audio supports, MP3, Wave, and Midi. Loading music is very simple, and sound works the same way. So I'm going to give you a code example, you bring the sounds, I'll bring the code!
Code Example for Audio:
So what are the numbers at the end? Remember in images, well this number is a numeric ID given. Remember the location of your audio, and extension!
This will probably be the last multimedia entry, unless someone does one on dlls, I won't be, since I have an older version of DarkBASIC.
Animations at this point in time do not include those such as mario walking, however they do include those such as animated GIFs(Graphic Interchange Format), and AVIs(Audio Video Interleave). So far I believe there are two formats for animation .gif, and .avi please tell me so if otherwise. Animations can be useful for game over screens and maybe even some Mortal Kombat style finishers!!
Code Sample
-PLEASE HELP FINISH THIS BOOK, CONTRIBUTE IN ANY WAY POSSIBLE PLEASE!-
________________________________________________________________
This is about 2D Games. This Wiki helped me become the programmer I am today. No, I am not DBTutor, but I will contribute. I am IRON PROGRAMMER!! Talk to me on the DarkBASIC Forums if you have a question.
I challenge YOU to create a 2D Melee Game. These are simple. Here is an example:
That is a simple format for a multiplayer melee game in 2D. Notice I have cleverly not supplied the media! Hahahahahaaaa! Now get programming!

### Day 20

->>3d Programming<<- Tadadada! (I'm not DBtutor, nor IRONPROGRAMMER, i'm gluon, you can find me on the DexOS forums) First Example A controlable cube:
Instead of MAKE OBJECT CUBE we can say SPHERE,etc. A textured object:
Moving an object