luisp
Central Cavern
Posts: 2
|
Post by luisp on May 26, 2020 18:06:48 GMT
Hi,
Can you read or change the contents of any screen programmatically?
So you can change the levels (only the blocks) of an explosion (a la bomberman)?
Thanks, Luis.
|
|
|
Post by AndyJF on May 26, 2020 20:57:19 GMT
|
|
luisp
Central Cavern
Posts: 2
|
Post by luisp on May 26, 2020 21:48:06 GMT
Thanks, that sound great.
|
|
|
Post by Jonathan Cauldwell on May 29, 2020 16:30:23 GMT
That code is fine for AGDx but you'll have to enter it differently if using AGD.
For MPAGD you can use GETBLOCK X Y and the block type at the specified coordinates will be returned in the BLOCK variable. To change the block type at a screen coordinate simply use PUTBLOCK Z where Z is the block number.
An example from the MPAGD manual:
GETBLOCK X Y ; top left of sprite IF BLOCK = FODDERBLOCK ; is it fodder? LET LINE = X LET COLUMN = Y DIVIDE LINE BY 8 DIVIDE COLUMN BY 8 PUTBLOCK 0 ; put a space there ENDIF
If you want the block to stay like that when the player leaves and re-enters the screen you will need to use adventure mode
|
|
|
Post by roolandoo on Jun 20, 2020 10:44:15 GMT
Jonathan, How do I activate Adventure Mode in MPAGD?
|
|
|
Post by Jonathan Cauldwell on Jun 20, 2020 11:54:03 GMT
If you're developing for the Spectrum, go to the Suite ZX subdirectory, you should see some batch files in there. You need to edit build.bat and export.bat in Notepad. In each you should see a line that has the command CompilerZX %1. Just add -a to the end of this line and adventure mode will be activated.
I'll record a YouTube tips video to clarify.
|
|
|
Post by roolandoo on Jun 20, 2020 14:06:18 GMT
Thank you very much, Jonathan.
|
|