Really, all you folks need to do is code a scrolling algorithm that allows use of ZCLASSIC native entities like npcs, secret flags, and so forth. So, you know, basically a whole new engine.
EDIT: Here's the basic skeleton of such an engine. Note that it would not allow combo animation or cycling as I've designed it, but you might be able to code up shortcuts.
Define the size of the screen
(use an ordered pair to determine size in X,Y measured in screens. This will define an x,y grid made up of the pixels taken up by those screens.)
Locate player on the screen
(On initial entrance, set where the player is using the x,y grid.)
Draw the screen
1 - Check player’s location. Using x,y grid, determine which screen the player is on, and what portions of side screens might also be visible. Call this the Visible(x,y)
2 - Get the ComboAt data from all combos on the screens overlapping Visible(x,y) and determine the proper place to draw each one. Put these in a temporary X+1,Y+1 array. It’s bigger than the screen because you might have to offset it by the player not standing directly on the 16x16 grid.
3 - Get the walkability data from all one-fourth of combos on screens overlapping Visible(x,y) and save them into an array of (x,y) so we know where the player can and cannot walk.
4 - Get the Screen “secret” status of each screen within Visible(x,y). If it’s triggered, get the secret combo data from each combo overlapping Visible(x,y) and replace the appropriate combos in the X+1,Y+1 array you made.
5 - Get the Flags from each combo with in the Visible(x,y). Store them in another X+1,Y+1 array mirroring the combo array you are building, for use this frame in checking for secret interactions.
6 - Draw each combo’s graphics to the screen.
Place Enemies and FFCS
1 - Check if any of the flags in the X+1,Y+1 array of flags you just made represent enemy flags that this script has not dealt with since the player entered the screen. (Remember those that have been dealt with by saving the x,y coordinate of those you have dealt with). If so, check the Screen data related to that enemy flag and spawn the appropriate enemy.
2 - Check to see if your Visible Area now overlaps the x,y coordinates of any FFCs on Screens you have not yet dealt with. If so, copy those FFCs and move them onto the screen with the player at the approprate x,y location and initiate their scripts. (Remember FFCs that have been dealt with by saving the x,y coordinate of those you have dealt with).
3 - Check the array you’ve made of stashed FFCs and enemies that may have scrolled off of the screen. If one of them is now on the screen again, load it up at the appropriate location and remove it from the stashed array.
Player movement
1 - If the player is pushing a direction, first check whether the direction would push the Visible Area outside of the defined x,y. If so, keep drawing the screen as it is. Don’t move any enemies or FFCs or weapons. Block the player from moving if the movement would take them into a part of your x,y grid that is set to non-walkable.
2 - If the player pushes a direction that will move the visible area without exiting x,y, and is not trying to walk into a non-walkable combo, and the player is sufficiently close to the edge of x,y, then do the following:
3a - Shift the Visible Area
3a - Move all enemies, FFCs, and weapons equally to how the Visible Area is shifting.
4 - For each enemy, FFC, or weapon that moved, check where they are on the screen. If they’re now scrolling off the screen, copy all relevant data of the entity and stash it in an array with its last location so you can recover it if you scroll back to that location in the future. (Will reset FFCs, potentially, so if you want FFC scripts to keep working regardless of player location, build a way to have the FFC follow the player around into the code)
Secret Combos
1 - For each secret combo in the temporary array you built, check for the state or event the combo cares about. For example, check to see if a sword weapon is next to a sword combo, etc. If so, set secrets on the relevant Screen at that Combo.
Flags and Combo Types
1 - Check the flags and combo types of the combos on the screen. If they have an impact on the player (conveyer, etc) then implement those effects in script.
Subscreen
1 - To avoid messing up the draw function, you can’t use a normal subscreen. So, code up an entirely custom subscreen and map experience and implement this when the player hits “start” by freezing the enemies/weapons/ffcs/collision detection (might need a global variable for the latter) and using player input to interact with the screen.
Edited by C-Dawg, 05 May 2015 - 11:35 AM.