|
Post by daveysloan on Jul 10, 2021 21:30:13 GMT
Hi all,
I'm using MPADG to make a Speccy game & I feel a bit stupid for asking (I'm still very new at all this) but I can't find the answer searching the forum.
Basically, I've got a game where I'm collecting a block from each room & I want the game to be completed when you have collected every block from every room.
* Every time I leave a room & re-enter the block has reappeared, is there a way to remove a block permanently when you collect it?
* Is there a way to display the number of blocks you have collected?
I have 30 rooms & my code is:
In EVENT GAMEINIT
LET I = 30
In EVENT COLLECTBLOCK
SUBTRACT 1 FROM I
IF I = 0
ENDGAME
ENDIF
Thank you!
|
|
yellowbelly1970
Processing Plant
Scratching my head, trying to add Arkos Music to MPAGD
Posts: 20
|
Post by yellowbelly1970 on Jul 12, 2021 11:54:25 GMT
as regarding displaying if you gave space for score and lives etc, i have a same thing the very top of my screen is reserved for lives and collected blocks (tapes) LET T = 0 AT 0,22 PRINT "Tapes " AT 0,29 DISPLAY T
in the collect block section i have ADD 1 TO T AT 0,29 DISPLAY T
|
|
yellowbelly1970
Processing Plant
Scratching my head, trying to add Arkos Music to MPAGD
Posts: 20
|
Post by yellowbelly1970 on Jul 12, 2021 12:02:35 GMT
i havent worked out the respawning block issue yet
|
|
|
Post by daveysloan on Jul 13, 2021 9:15:39 GMT
Thanks for this, that's sorted it right out!
I had something almost identical, but it produced a number with a lot of leading zeros, which overwrote the text.
Hopefully I'll find a way to make the blocks permanently disappear when you collect them, or find another work around. If I do, I'll post it here.
Cheers.
|
|
yellowbelly1970
Processing Plant
Scratching my head, trying to add Arkos Music to MPAGD
Posts: 20
|
Post by yellowbelly1970 on Jul 13, 2021 12:08:37 GMT
if you look at the mpagd manual you can specify Doubledigits, may sort the leading 0 issue
|
|
|
Post by daveysloan on Jul 13, 2021 12:33:01 GMT
Sorry, I meant that the last time I tried to display the number of blocks collected it had leading zeros, but I'd tweaked it in line with what you did & it somehow sorted it. Thanks!
|
|
|
Post by daveysloan on Jul 13, 2021 18:35:12 GMT
OK on the Facebook page, the extremely helpful Kees van Oss has come up with a solution...
I have tried this & it works when collecting blocks horizontally, as I'm flying round Jetpac style I need to work out how it would do the same when I collect blocks from above or below or diagonally!
|
|
|
Post by ramon on Jul 18, 2021 10:38:22 GMT
I propose an Idea to you.
Design your rooms or screens with a few "prize" blocks, when collisions with one of them seed the screen with the collectible blocks you want. In this way, when you re-enter the room you will have to repeat the mechanism of the "prize" block so that the blocks you want appear again. Similar to Mario games.
|
|
|
Post by daveysloan on Jul 19, 2021 7:11:38 GMT
I propose an Idea to you. Design your rooms or screens with a few "prize" blocks, when collisions with one of them seed the screen with the collectible blocks you want. In this way, when you re-enter the room you will have to repeat the mechanism of the "prize" block so that the blocks you want appear again. Similar to Mario games. Thank you. I really like this idea. I have done a work around by placing blocks just above the collectblocks so you have to collect them horizontally . It doesn't seem to have had any detrimental effects on the playability, in fact I think it might have even improved some rooms. I like your idea though & am keeping it in mind for the next game.
|
|
|
Post by ramon on Aug 1, 2021 19:36:49 GMT
I have found another approach to the problem that I had never considered. 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 Adventure mode in MPAGD records blocks which are removed or put on the screen in a table after the screen is build. When you re-enter the screen, the screen is build and then blocks are removed or placed according to the table. 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. Information collected from: arcadegamedesigner.proboards.com/search/results?captcha_id=captcha_search&what_at_least_one=adventure+mode&who_only_made_by=0&display_as=0&search=Search
|
|