Talk:Mortal Kombat PTC Edition/@comment-50.93.176.50-20140419233807/@comment-24273571-20140420005436

That is a bit complicated. I tried to explain in the tutorial. The GRP file holds the face images of all characters. When the program starts is loads the file to the top screen. I turned of visible so no one would see it. The program then goes through a two nested FOR loops to copy the images into double arrays. GSPOIT is used to get the color number from the face image. I use offsets for the start point of each image because they are not in the same place in the GRP file. I read one row of pixels, move down a row, and then read another row filling the array. With all the faces in the arrays named after the characters, I can now place the faces where I want with another two nested FOR loops. The hard part to explain is the use of indexes 0 thru 8 to select the different characters. Each character has a position defined by two arrays (psx, psy).

The sprites are also explained in the tutorial. Only one sprite (0) is for the player character. SEL * 32 determines which character is used. One row of 32x32 images represents all the images of each character. You would have to create a new file name like MKPEP5. Draw your sequence of images for that character. Add the loading of that SPU file as LOAD "SPU4:MKPEP5",0. If the tons of code is repeated correctly for the new character, you should be able to get to it through SEL selected to 8.

Then each character shares some code (sweeps and jumps) and has their own special code for attacks. (sub-zero freeze, etc..)