Author |
Message |
metachief
|
Posted: Thu Feb 07, 2008 5:40 pm Post subject: please a tutorial |
|
|
Her fellow programmers.
I and probably most of the not so advanced programmers have problems with collision detection for images. That is why if any of you have the time to make a basic tutorial explaining collisiond detection with "whatdotcolor" or what ever works best for it, it would help a load of us to proggress with our programs. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Nick
|
|
|
|
|
ericfourfour
|
Posted: Thu Feb 07, 2008 5:50 pm Post subject: RE:please a tutorial |
|
|
whatdotcolour requires either solid background or solid foreground colours (or both solid). If you are using images, you have to do your collision detection differently. My suggestion would be to keep track of whatever is colliding using variables. The image would be a separate part of the objets colliding. Your main goal should be to make your program, graphics independent (separate the back-end from the front-end). |
|
|
|
|
|
Tony
|
Posted: Thu Feb 07, 2008 7:55 pm Post subject: RE:please a tutorial |
|
|
I second ericfourfour.
The only thing whatdotcolour does is that it uses the screen as a giant 2D array. You write to the array by drawing stuff to the screen.
The same could be done, in much simpler terms, with a smaller array. Some collision approximations (such as circular) work with arrays of size 1. Increasing the array size simply increases the precision. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
CodeMonkey2000
|
Posted: Thu Feb 07, 2008 8:32 pm Post subject: RE:please a tutorial |
|
|
Or you could go old school and use 2d tile maps. 2d Tile maps are great because you can easily load and edit your maps. Here is my old game, the file is at the bottom.
http://compsci.ca/v3/viewtopic.php?t=15765&start=15 |
|
|
|
|
|
|