fonzo
Central Cavern
Posts: 2
|
Post by fonzo on Oct 9, 2021 19:47:36 GMT
Hey,
Im new to AGD and i cant seem to figure out how to set collecting settings per room.
At the moment i got in:
EVENT GAMEINIT
I = 4
and
EVENT COLLECTBLOCK
SUBTRACT 1 FROM I
IF I = 0
NEXTLEVEL
ENDIF
When the 4 blocks are collected, then room 1 is loaded. but how do i set the collectblocks for room 1, 2 ect?
|
|
|
Post by Minilop on Oct 10, 2021 9:59:49 GMT
Are you looking for a way to manage having different numbers of collectables in each room and then when all collected the player goes to the next level?
In which case this would be a good use of MPAGDs READ & DATA.
Say you have 8 screens (screen #0-7) each with a different number of collectables
Screen 0 : 4 collectables Screen 1 : 5 collectables Screen 2 : 3 collectables Screen 3 : 9 collectables Screen 4 : 3 collectables Screen 5 : 5 collectables Screen 6 : 7 collectables Screen 7 : 10 collectables
This could be represented as:
DATA 4,6,3,9,3,5,7,10
Then, in your RESTARTSCREEN event:
RESTORE ; restore the data READ L ; read the first value of the DATA and put it in L IF SCREEN >= 1 ; if it is screen 1 or above REPEAT SCREEN ; then repeat SCREEN-many times READ L ; read the next value ENDREPEAT ; so we've found the right L value for the Screen ENDIF
; put the rest of your restartscreen code in here
; and at the bottom, put your collectable DATA:
DATA 4,6,3,9,3,5,7,10
Hope this helps!
|
|
fonzo
Central Cavern
Posts: 2
|
Post by fonzo on Nov 14, 2021 11:24:03 GMT
Thank you for your help, this helps me a lot! Also thank you for all the great tutorials you made.
|
|