6

文字 ('<') が壁にぶつかったかどうかを確認する方法が必要です (黒いピクセルのグラフィック)

-ZX81 ゲームで。

私はコードを使用する別のゲームを見ています...

if peek(peek 16398 +256*peek 16399) = code "**blackpixel graphic**" then ...

彼らのために働くように見える...

これは正しいコードですか?

私はアドレスやメモリなどの取得についてあまり詳しくありません。

私を助けてください...

- もっと良い方法を知っていれば。お答えください :)

ありがとう、

4

3 に答える 3

2

peekメモリ位置でバイトを読み取ります。Sinclair ZX81 のシステム変数によると、メモリの場所1639816399形式は、現在の「表示ファイル内の PRINT 位置のアドレス」を含む 16 ビット値です。

したがって、peek 16398 + 256*peek 163992 つの値を 16 ビット アドレスに結合し、peekそのアドレスを (おそらく) その位置のピクセル/文字 (?) を取得します。

于 2010-07-07T13:37:15.330 に答える
2

Located at addresses 16398 and 16399 are two bytes that form the cursor location. (See http://web.ukonline.co.uk/sinclair.zx81/chap28.html). In other words,

peek 16398 + 256*peek 16399

gives you the memory address of the character on the screen where the next PRINT would go. Which apparently can be changed with PRINT AT.

peek(peek 16398 + 256*peek 16399)

finds the code for whatever character is at that location. The rest you should be able to figure out.

Now, the main question is: does your game use the cursor in the same way? If not you have to use a different solution.

于 2010-07-07T13:38:51.927 に答える
0

メモリアドレスによって異なりますが、peek は通常、「このメモリ位置にはどのような値があるか」を意味します。

これは、この特定のトピックの良い読み物になるはずです。

于 2010-07-07T13:31:31.617 に答える