Posted Sun Mar 9, 2008 3:59 AM
Posted Sun Mar 9, 2008 6:06 AM
Posted Sun Mar 9, 2008 6:12 AM
MausGames, on Sun Mar 9, 2008 7:06 AM, said:
Posted Sun Mar 9, 2008 10:53 AM
Posted Sun Mar 9, 2008 10:59 AM
Fort Apocalypse, on Sun Mar 9, 2008 11:53 AM, said:
Posted Sun Mar 9, 2008 4:54 PM
Random Terrain, on Sun Mar 9, 2008 12:59 PM, said:
Fort Apocalypse, on Sun Mar 9, 2008 11:53 AM, said:
player0: %00111100 %01000010 %10011001 %10100101 %10000001 %10100101 %01000010 %00111100 end player1pointerhi = player0pointerhi player1pointerlo = player0pointerlo player1height = player0heightIt's really only when you want the two sprites to share the same data tables, yet be able to have different shapes than each other at any given time, that you might need to start using any assembly code-- and even then, you don't need assembly, you really just need a way to set the pointers as needed. For example:
rem * define a table of three 8x8 sprite shapes, using player0 player0: %00111100 %00011000 %00011000 %00011000 %00011000 %00011000 %00111000 %00011000 %01111110 %00110000 %00011000 %00001100 %00000110 %00000110 %01100110 %00111100 %00111100 %01100110 %00000110 %00000110 %00011100 %00000110 %01100110 %00111100 end rem * set the hi pointers and heights (player0pointerhi is already set) player1pointerhi = player0pointerhi player0height = 7 : player1height = 7 rem * save the lo pointer for the start of the table dim save_pointerlo = a save_pointerlo = player0pointerlo rem * you could also save a variable by using a constant, rem * but then you'd need to know where the shape table is stored in ROM rem * so you could set the constant to the appropriate value rem * define a table of offset values data offset 0,8,16 end rem * set the two players to whichever shapes are desired rem * the three shapes are numbered 0 to 2 rem * set player0 to shape 1 player0pointerlo = save_pointerlo + offset[1] rem * set player1 to shape 2 player1pointerlo = save_pointerlo + offset[2]This example assumes that all the shapes in the table are the same height. You could also use shapes of different heights, but then you'd also need a table of height values:
rem * define a table of offset values rem * each offset increases by the height of the previous shape data offset 0,4,10,18,28 end rem * define a table of height values rem * the height values are 1 less than the actual height rem * (i.e., 4 lines high would be a value of 3), rem * since the line numbers begin with 0 data height 3,5,7,9,11 end rem * set the two players to whichever shapes are desired rem * the five shapes are numbered 0 to 4 rem * set player0 to shape 2 player0pointerlo = save_pointerlo + offset[2] player0height = height[2] rem * set player0 to shape 4 player1pointerlo = save_pointerlo + offset[4] player1height = height[4]Michael
Edited by SeaGtGruff, Sun Mar 9, 2008 4:56 PM.
Posted Sun Mar 9, 2008 5:17 PM
SeaGtGruff, on Sun Mar 9, 2008 5:54 PM, said:
on frequency goto 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Posted Sun Mar 9, 2008 6:43 PM
Random Terrain, on Sun Mar 9, 2008 6:17 PM, said:
SeaGtGruff, on Sun Mar 9, 2008 5:54 PM, said:
on frequency goto 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Posted Sun Mar 9, 2008 7:04 PM
SeaGtGruff, on Sun Mar 9, 2008 7:43 PM, said:
0 player1: %00000000 %11100000 %10100000 %10100000 %10100000 %10100000 %10100000 %11100000 end goto gameloop 1 player1: %00000000 %11100000 %01000000 %01000000 %01000000 %01000000 %11000000 %01000000 end goto gameloop 2 player1: %00000000 %11100000 %10000000 %10000000 %11100000 %00100000 %00100000 %11100000 end goto gameloop 3 player1: %00000000 %11100000 %00100000 %00100000 %01100000 %00100000 %00100000 %11100000 end goto gameloop . . . blah blah blah . . . 29 player1: %00000000 %11100010 %10000010 %10000010 %11101110 %00101010 %00101010 %11101110 end goto gameloop 30 player1: %00000000 %11101110 %00101010 %00101010 %01101010 %00101010 %00101010 %11101110 end goto gameloop 31 player1: %00000000 %11101000 %00101000 %00101000 %01101000 %00101000 %00101000 %11101000 end goto gameloop
Posted Tue Mar 11, 2008 5:00 AM
Posted Tue Mar 11, 2008 2:36 PM
rem * set player0 to shape 1 player0pointerlo = save_pointerlo + offset[1] rem * set player1 to shape 2 player1pointerlo = save_pointerlo + offset[2]
rem * set player0 to shape 1 player0pointerlo = tone * 7 + 1 rem * set player1 to shape 2 player1pointerlo = frequency * 7 + 1
0 members, 1 guests, 0 anonymous users