Collision + scrolling : think about it, you only need to modify the nib{ used for collision the exact same way you modified the nib{ used for tilemapping to implement scrolling.

Scrolling detection : just do a good ol' test. If the character isn't at the center of the screen or if you can't scroll, move the character, else scroll the map.
I sadly can't figure this out ;c
My character is all jumpy and teleporty.

Code:

//From the MOVE source
getKey->K

S->N //X Reset position if on place 1
T->O //Y Reset position if on place 1

If K=1
B++ //Y Offset of Map
T++ //Y Position of Character
End
If K=2
A-- //X Offset of Map
S-- //X Position of Character
End
If K=3
A++
S++
End
If K=4
B--
T--
End

nib{T+B*12+GDB1*2+S+B}->U


And now from the CHECK source, which checks positions and resets them if they're in the wrong place/out of bounds.

Code:

If A>>4
4->A
End
If A<<0
0->A
End
If B>>8
8->B
End
If B<<0
0->B
End

If U=1
N->S
O->T
End


It's a 16x16 map, if that means anything..
I can't find out what to do, but my character doesn't quite follow the camera, he just disappears occasionally and doesn't quite collide correctly :<

EDIT: (I've learned that I need to scroll the screen when my character's in the center, and keep from scrolling when it's viewing an edge of the map.) But I still don't know how i'd do it ;c
I was wondering if there was a way to have more than 10 tiles at once
Of course it is. Just use the correct numbers in any code related to the map. You can also write some code to have width and height for each map, for example store them in the 2 bytes before the map data.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement