Raftronaut
Member
Mugi said:here's another idea for you though.
since if this glitch only occurs when you actually touch the edge, you could simply make your input script not allow you to touch it.
i use this code on my wall grab tile to prevent wallgrab from ever happening on the top 16 pixels and bottom 16 pixels of the screen.
Code:; Bounds checker to not tilt the game when wallgrabbing on nametable edge. ; not used on 4-way scroller. ; CLC ; ADC Object_y_hi,x ; are we in map bounds ? ; CMP #$10 ; BCC dontMessWithGravity ; CMP #$D6 ; BCS dontMessWithGravity
as imilar check could be implemented into your "move left" script that checks if you're in the first.... say 4 pixels of the screen, you could not move left anymore, thus far never touching the edge.
for a check against left, it would be something along the lines of:
Code:LDX player1_object LDA Object_h_speed_hi,x CLC ADC Object_x_hi,x CMP #$08 BCC + ; try BCS instead of BCC if this doesnt work, i always mix this stuff up lol RTS
tack that to the beginning of your "move left" script and it should disallow you to ever move to the first 8 pixels of the left edge of a screen.
(im not sure but you might have to factor in scroll for this and deal with the xscroll offsetting of nametables, but the basic idea is the same.)
this also would have the added benefit of that with this, you could just leave the edge code in place to kill the player when the edge is touched.
that way you could never touch it by driving into the edge, but if a solid object would push you, it would still push you all the way to the edge and then kill you by touching it.
Wow! This is an excellent solution Mugi! I previously had thought limiting the players ability to move into that left area would prevent the screen wrap, even 4-8 pixels even. I hadn't thought to actually add this into my input left code. That is really really smart! I hadn't thought to add anything into the left input script, Even after I had implemented Dale's code fix for disabling inputs during cutscenes (when player is under cuttercross's dissapear tile) into my actual input scripts (including your pause function, which works great btw mugi). I will have a chance to try this out tonight, I hope to report back with some good news.
Dale, thank you for the insight on this. Yes, it is true under all conditions that the player would never need to cross left into a new screen. The player would only ever cross the threshold to the right in order to continue progress. I will give your script a shot when I get home as well, before messing with Mugi's input suggestions so I can confirm this would do the trick. It should fix the underlying problem with the shooter module itself, at least, for 98% of the examples of licensed era nes shooters, the player would never pass backwards like that. At least not in the Gradius/TwinBee school of one-directional scrolling.
I am getting really close to releasing version 2.0 of the demo, hopefully by the end of the month. I am really looking forward to sharing all these great changes i've made in the past few months! Both the gameplay and presentation have been greatly improved.