BUILDING QUESTION: Those bridges in Keen 1.. :)
re: FE05
Alright, so putting switches above and to the left of our bridges is ideal, simply because that way we get to use positive numbers for locating things (like $H0305 for a bridge that is 3 tiles down and 5 tiles right of our switch)... But for those of us who are foolish and construct our levels with the switches below and to the right of our bridges, we need to work with negative numbers. Forgive my n00bishness here: FE is -2... would FF be -1 and FD be -3, then, and so on? or is it more complex than that?
Thanks!
--Xky
Thanks!
--Xky
re: HEX
Yeah, my guess was correct... FF is -1, FE is -2, and so on... so -20 would be EC.
HEX isn't horribly hard to understand, it just takes a while. The really hard stuff is the assembly language Durdin swims through for us! ;-)
--Xky
HEX isn't horribly hard to understand, it just takes a while. The really hard stuff is the assembly language Durdin swims through for us! ;-)
--Xky
Okay, here goes ...
Hmmm! I wasn't expecting this kind of response!
Anyway, I wrote the program on my graphing calculator (I've got a TI-85), and not in, say, QuickBasic so I didn't have to switch over to the program while editing.
The following QB code was written just now as I'm making the post:
I hope that code works.
Anyway, I wrote the program on my graphing calculator (I've got a TI-85), and not in, say, QuickBasic so I didn't have to switch over to the program while editing.
The following QB code was written just now as I'm making the post:
Code: Select all
'vars default to long integer
deflng a-z
cls
print "The CK Guy's Commander Keen Bridge Sprite Helper"
'get info
input "Switch X, Y"; x1, y1
input "Bridge X, Y"; x2, y2
'find offsets
xoff = x2 - x1
yoff = y2 - y1
'if less than zero, add 256
if xoff < 0 then xoff = xoff + 256
if yoff < 0 then yoff = yoff + 256
sprite = xoff + yoff * 256
'output
print "Use sprite # hex "; hex$(sprite)
'now, this next bit is kind of confusing. In Andy's KeenWright (dos version) when you enter a sprite number, it has to be a short integer. Short integers go from -32768 to 32767. So, if sprite is from 32768 to 65535, we must subtract 65536 from it. Got that? ;-)
if sprite > 32767 then sprite = sprite - 65536
print "Or, in KeenWright, # ";sprite
Dang, you got the jump on me - I converted it to VB. =P
Anyway, here's my version: http://grelphy.spatang.com/bridgecalc.zip
Anyway, what a great development!
Anyway, here's my version: http://grelphy.spatang.com/bridgecalc.zip
Anyway, what a great development!
Wow! nice work.
One point though, while waiting for you to write this program I wrote my own in the inferior language of BASIC, it says that the sprite value to make a switch a bridge (i.e act as if there was no sprite there.) is -512 Your program suggests -256 (which is wrong.)
Your program works however with most other sprite values, but I have had some problems (Keen moves but the screen don't.)
I have noticed your program always produces somewhat large sprites (-18427 vs -6907 for my program.)
Am I using your program incorrectly? Does it matter which version of Keen you have (1.31)? Why do both sprite values from each program work even though they have different values?
One point though, while waiting for you to write this program I wrote my own in the inferior language of BASIC, it says that the sprite value to make a switch a bridge (i.e act as if there was no sprite there.) is -512 Your program suggests -256 (which is wrong.)
Your program works however with most other sprite values, but I have had some problems (Keen moves but the screen don't.)
I have noticed your program always produces somewhat large sprites (-18427 vs -6907 for my program.)
Am I using your program incorrectly? Does it matter which version of Keen you have (1.31)? Why do both sprite values from each program work even though they have different values?