|
Post by Alex Khan on Mar 5, 2010 1:36:53 GMT -5
Hi all, I am using Elf's example tutorials to draw a 320 x 62 background in Scroll plane B. I am using Elf's Sonic image "Fondo" as an example. I am assuming scroll0 is the 320 x 62 image. And scroll_map is the 320 x 62 image redrawn for the loop. -Problem When I load the rom the image is a mess. I think there is perhaps a problem with array DIM? Here is the code: uploading.com/files/md4m4581/scroll.txt/-Objective My objective is to draw a 960 px wide 240 px high level which is scrollable in plane B with keyboard Using this image: uploading.com/files/3a8eamff/dd2.bmp/Please point me in the right direction.
|
|
|
Post by Alex Khan on Mar 5, 2010 1:38:13 GMT -5
I've been over the code again and again for almost three hours now ....
|
|
|
Post by abokys on Mar 5, 2010 8:00:02 GMT -5
Simple! you forgot to push the map.bin archives. I explain it, when you import one file from imagenesis, if you optimitzse the file, the best way for put the graphic file into your code is in bin format, also you must import the map, you can do it in actions->export tile map, and save it in bin format. then in your code you must to declare the label map like a grafics.
example: grafic: datafile yourgraf.bin,bin
map: datafile yuormap.bin,bin
I hope hepful you!
|
|
|
Post by abokys on Mar 5, 2010 8:00:56 GMT -5
P.D: Sorry my english.... I hope you understand me
|
|
|
Post by Alex Khan on Mar 5, 2010 12:47:20 GMT -5
Yes I understand you This is what i did: 1) Opened image in Imagenesis and exported level.bin as Tile Data 2)Exported levelmap.bin as Tile Map Here is the code: 'Intro to Game' 'Credit to The Elf for his fantastic Tuts Dim Map(63,27) as Integer loadtiles scroll0,828,514 Pallettes scroll0_pal,0,0,16 setgfxplane SCROLL_B ' reload scroll0_map For Y=0 to 27 For X=0 to 63 readint Map(X,Y) Next X Next Y For Y=0 to 27 For X=0 to 63 DrawTile Map(X,Y)+pallette(0)+514,X,Y Next X Next Y do setscrollplane SCROLL_B scroll LEFT,1 sleep 1 loop scroll0_pal: DATAINT $0EC6,$0EC6,$0EEC,$028C,$046A,$086A,$0866,$0464 DATAINT $02A6,$06E2,$04A2,$02A2,$04E4,$02E6,$04A6,$02C2 scroll0: datafile level.bin,BIN scroll0_map: datafile levelmap.bin,BIN I have attached level.bin uploading.com/files/73ebf83e/level.bin/I have attached levelmap.bin uploading.com/files/91126a49/levelmap.bin/This is the image I am using for level it is 320 x 224: uploading.com/files/3f8mb132/Sean_01%2Bcopy%2B2.bmp/Problem: Check it the scene is scrolling but tiles are broken and missing in places.
|
|
|
Post by abokys on Mar 5, 2010 12:54:53 GMT -5
Remember, the two bin files must be in the same folder that basic code
|
|
|
Post by abokys on Mar 5, 2010 13:07:04 GMT -5
I revised your code. Well, your mistake is the followin: Dim Map(63,27) as Integer (well, your image is 40*28 tiles, yes? then you must change every 63 for 39 (the number of your tiles)). When you optimitze files from imagenesis, you must pai atention for the number of tiles. And another problem is that you charge a lot of tiles, you only must charge the tiles that you need, in this case 587, not 828.
|
|
|
Post by abokys on Mar 5, 2010 13:11:09 GMT -5
This is your code revised:
'Intro to Game'
'Credit to The Elf for his fantastic Tuts
Dim Map(39,27) as Integer----------------------Here is the correct array
loadtiles scroll0,587,514-------------------------your image is only 587 tiles, not 828 Pallettes scroll0_pal,0,0,16
setgfxplane SCROLL_B '
reload scroll0_map For Y=0 to 27 For X=0 to 39------------------------the same, your image is 40 tiles widht readint Map(X,Y) Next X Next Y
For Y=0 to 27 For X=0 to 39------------------------------welll, another one ;-) DrawTile Map(X,Y)+pallette(0)+514,X,Y Next X Next Y
do setscrollplane SCROLL_B scroll LEFT,1 sleep 1 loop
scroll0_pal: DATAINT $0EC6,$0EC6,$0EEC,$028C,$046A,$086A,$0866,$0464 DATAINT $02A6,$06E2,$04A2,$02A2,$04E4,$02E6,$04A6,$02C2
scroll0: datafile level.bin,BIN
scroll0_map: datafile levelmap.bin,BIN
|
|
|
Post by Alex Khan on Mar 5, 2010 13:46:26 GMT -5
AHA! I see I was not paying attention to information Imagenesis was gving me. You are correct. 39,27 for size and 587 to charge tiles Thank You Thank You! One Small Problem: I am using this loop to scroll map, 'Map Scrolling Controls do setscrollplane SCROLL_B J=JoyPad() if j.3 then scroll LEFT,1 end if if j.2 then scroll RIGHT,1 end if sleep 1 loop But when I scroll I am getting small blue space between my two images ... There is break in images then map reloads I want to join them making them 320 + 320 = 640 wide image but I am getting gap. Blue Gap!
|
|
|
Post by abokys on Mar 6, 2010 5:44:52 GMT -5
Uff, that's you want is a bitte complicate, see my post called "How tho do a big map", ther is a example of big map, maybe you can find the diferences. Good Luck! ;-)
|
|
|
Post by Alex Khan on Mar 6, 2010 12:42:20 GMT -5
Abokys look I saw your big map thread and am using Martrius's Scroll Engine routine. Problem is my map is 960 and I cannot scroll past 720! I have attached a rom, code and map with this zip. Have a look what do you think? uploading.com/files/d68ed6b8/Martrius%2BScroll.zip/
|
|
|
Post by Alex Khan on Mar 7, 2010 4:17:32 GMT -5
Hi Abokys,
I e-mailed Martrius he said there was a problem with the value I was giving for #Right Boundary!
Thanks for your help ... can you tell me how I can get my hands on a Sega intro binary file I want to put Sega title before my game starts but I don't have binary for Sega tile.
Thanks.
|
|
|
Post by abokys on Mar 13, 2010 6:51:01 GMT -5
|
|
|
Post by Mairtrus on Mar 13, 2010 9:53:54 GMT -5
|
|
|
Post by TheMVRules on Mar 13, 2010 11:07:56 GMT -5
Abokys look I saw your big map thread and am using Martrius's Scroll Engine routine. Problem is my map is 960 and I cannot scroll past 720! I have attached a rom, code and map with this zip. Have a look what do you think? uploading.com/files/d68ed6b8/Martrius%2BScroll.zip/You'll need to modify it for 960 map. Look for variables.
|
|