+frankodragon Posted October 30, 2016 Share Posted October 30, 2016 I'm trying to learn from the Zelda demo DATA statements to build a smaller map 6 x 8, however things aren't working right. If I move the player down, then right, the same screen repeats. I must be forgetting something. Here are my DATA statements: rem ** Room Definitions 48 rooms data room_shape 2, 6, 8, 8, 8 ,8,7,7 12, 13, 8, 8, 7,14,5,5 13, 11, 8, 10, 7, 5,5,5 5, 4, 3, 3, 10,5,5,5 8, 5, 9, 12, 12 ,8,8,8 12, 10, 7, 8, 7,14,5,5 end data room_type 1, 1, 0, 1, 1,2,1,1 2, 1, 2, 1, 1,2,1,1 2, 1, 1, 1, 1 ,1,2,2 2, 1, 2, 2, 1,2,1,1 1, 2, 2, 2, 1,1,2,1 2, 1, 2, 2, 1,2,1,1 end data move_north 0,0,0,0,0,0,0,0 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, 32,33,34,35,36,37,38 end data move_south 8,9,10,11,12,13,14,15 16,17,18,19,20,21,22,23 24,25,26,27,28,29,31,32 33,34,35,36,37,38,39,40 41,42,43,44,45,46,47,48 0, 0, 0, 0, 0, 0,0, 0 end data move_west 0,0,1,2,3,4,5,6 0,7,8,9,10,11,12,13 0,14,15,16,17,18,19,20 0,21,22,23,24,25,26,27 0,28,29,30,31,32,33,34 0,35,36,37,38,39,40,41 end data move_east 1,2,3,4,5,6,7,0 8,9,10,11,12,13,14,0 15,16,17,18,19,20,21,0 22,23,24,25,26,27,28,0 29,30,31,32,33,34,35,0 36,37,38,39,40,41,42,0 end Just wondering if the DATA maps needs to be an even number of rows and columns? Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 31, 2016 Share Posted October 31, 2016 The data doesn't need to be on even rows. Just had a chance to look at this - if I walk through for "room 0" and I move down, the move_south map in position 0 says to go to room 8, so I'll wind up in room 8. If I then move right, the move_east map in position 8 says to go to room 8. So it repeats. A similar sequence happens if I walk through starting with "room 1", "room 2", ... You need to fix up the data in move_east to actually point to the rooms you want to move to. 1 Quote Link to comment Share on other sites More sharing options...
+frankodragon Posted November 18, 2016 Author Share Posted November 18, 2016 Just an update..it turns out my stupid brain didn't realize I was supposed to SKIP a number in each row of the MOVE_WEST and MOVE_EAST tables. For example the numbers in bold are the corrected ones: data move_west 0,0,1,2,3,4,5,6 0,8,9,10,11,12,13,14 0,16,17,18,19,20,21,22 0,24,25,26,27,28,29,30 0,32,33,34,35,36,37,38 0,40,41,42,43,44,45,46 end I guess you could replace the zeroes with their standard numbers but I used the code from the Adventurer demo. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.