DOWNLOAD HERE
I've been working on my own game and thought that people might benefit from a few tweaks/changes I've made to the doUpdateCamera script. (the script that handles all scrolling)
Below is a version of the script that I've modified mostly by copy/pasting from other peoples tweaks. It started with the most stable scrolling script I am aware of, the
"Scrolling with Re-centering" by AllDarnDavey, which corrects a lot of screen issues on its own
Bug Fixes:
-Multiple objects spawning at once when scrolling
-
No inputs scripts needed
-Screen flags no longer update every frame, instead they update when a new screen is centered. so changes can be made without being lost immediatly
-Warpto screen now updates, no longer only uses the settings set on the first screen of the level
New Features:
-toggle between no scroll, autoscroll, and player following "camera modes"
-
all scrolling features can be adjusted screen by screen, so you can have sections that autoscroll and sections that follow the player in the same level.
-left and right scrolling/autoscrolling
-adjust autoscroll speed with "screenSpeed" variable in screen settings dropdown
-while scrolling, the following gets adjusted when the new screen comes fully into frame:
- scroll speed
- screen flags
- warpto screen
- tile pallette
- music
HOW TO USE THIS
A more detailed walkthrough can be found
HERE (thank you
baardbi )
1: replace your "handle camera" script with the file attached to this post
2: delete all the input scripts that control scrolling
- By default, the camera will follow the player. To change to autoscroll, screenflag6 is the flag to check. (this can be changed at the beginning of the script)
- To determine the direction of the autoscroll, check "right edge for scroll" to go left, and "left edge for scroll" to go right.
- For no scrolling at all, check both the right and left edge flags and the camera will not move
- When the scrolling comes across a scroll edge, it will stop. to start it going again, uncheck the screen flag. for example, this will uncheck right edge:
Code:
LDA ScreenFlags00
AND #%11101111
STA ScreenFlags00
I'm sure theres a lot that can be improved or made more efficient. IF anyone has any suggestions or issues, we can all edit it together and I'll keep it updated on this first post.
EXTRA:
you can edit your physics script to help push your player along any autoscrolling areas:
https://www.nesmakers.com/index.php...-along-with-your-camera-scrolling-4-5-9.8055/
for horizontal shooter games, adjust the speed of your ship along with the scrolling here:
http://www.nesmakers.com/index.php?...-dohandlecamera-updates-fixes.7929/post-48125
OTHER FIXES
FOR COLLISION FIX WITH THE SEAM, CHECK OUT THIS LINK:
https://www.nesmakers.com/index.php?threads/scrolling-platformer-seam-collision-fix-4-5-9.7266/
FOR CORRUPTED TILES DURING SCROLLING AFTER WARPING:
http://www.nesmakers.com/index.php?...arping-without-buffer-screens.7295/post-40092